-
Notifications
You must be signed in to change notification settings - Fork 13.3k
redesign stage 0 std #119899
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
redesign stage 0 std #119899
Conversation
This comment has been minimized.
This comment has been minimized.
9fcee5c
to
066ce06
Compare
This comment has been minimized.
This comment has been minimized.
066ce06
to
472c50c
Compare
This comment has been minimized.
This comment has been minimized.
ce81474
to
b688ffa
Compare
This comment has been minimized.
This comment has been minimized.
5f1747d
to
00e59f0
Compare
This PR modifies If appropriate, please update |
@rustbot ready r? bootstrap |
00e59f0
to
8ac271c
Compare
@rustbot author (currently stage 2 std is copied from stage 1 and this behaviour should change with the beta std change) |
redesign stage 0 std ### Summary This PR changes how bootstrap builds the stage 1 compiler by switching to precompiled stage 0 standard library instead of building the in-tree one. The goal was to update bootstrap to use the beta standard library at stage 0 rather than compiling it from source (see the motivation at rust-lang/compiler-team#619). Previously, to build a stage 1 compiler bootstrap followed this path: ``` download stage0 compiler -> build in-tree std -> compile stage1 compiler with in-tree std ``` With this PR, the new path is: ``` download stage0 compiler -> compile stage1 compiler with precompiled stage0 std ``` This also means that `cfg(bootstrap)`/`cfg(not(bootstrap))` is no longer needed for library development. ### Building "library" Since stage0 `std` is no longer in-tree `x build/test/check library --stage 0` is now no-op. The minimum supported stage to build `std` is now 1. For the same reason, default stage values in the library profile is no longer 0. Because building the in-tree library now requires a stage1 compiler, I highly recommend library developers to enable `download-rustc` to speed up compilation time. <hr> If you encounter a bug or unexpected results please open a topic in the [#t-infra/bootstrap](https://rust-lang.zulipchat.com/#narrow/channel/326414-t-infra.2Fbootstrap) Zulip channel or create a [bootstrap issue](https://github.com/rust-lang/rust/issues/new?template=bootstrap.md). (Review thread: https://rust-lang.zulipchat.com/#narrow/channel/326414-t-infra.2Fbootstrap/topic/Review.20thread.3A.20stage.200.20redesign.20PR/with/508271433) ~~Blocked on rust-lang#122709 try-job: dist-x86_64-linux
☀️ Try build successful - checks-actions |
It worked, nice :) @rustbot ready |
std: make `cmath` functions safe The floating point intrinsics are more difficult, I'll probably wait until rust-lang#119899 has merged before making them safe as well.
std: make `cmath` functions safe The floating point intrinsics are more difficult, I'll probably wait until rust-lang#119899 has merged before making them safe as well.
std: make `cmath` functions safe The floating point intrinsics are more difficult, I'll probably wait until rust-lang#119899 has merged before making them safe as well.
std: make `cmath` functions safe The floating point intrinsics are more difficult, I'll probably wait until rust-lang#119899 has merged before making them safe as well.
std: make `cmath` functions safe The floating point intrinsics are more difficult, I'll probably wait until rust-lang#119899 has merged before making them safe as well.
Rollup merge of rust-lang#139107 - joboet:safe_cmath, r=ibraheemdev std: make `cmath` functions safe The floating point intrinsics are more difficult, I'll probably wait until rust-lang#119899 has merged before making them safe as well.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I just learned about compiletest-use-stage0-libtest
. Does this PR make true
the default value for that? It seems like there's no good reason to even still support false
for that option, or is there?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It seems like there's no good reason to even still support false for that option, or is there?
true
might make sense as a default (since libtest programmatic API changes relatively unfrequently), but if someone is working on a libtest
(programmatic API) change that can require changing compiletest
, in which case the contributor would probably want to use false
so that they can test their changes for compiletest too.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I just learned about
compiletest-use-stage0-libtest
. Does this PR maketrue
the default value for that? It seems like there's no good reason to even still supportfalse
for that option, or is there?
The default value for that option is already true
and false
is useful to detect breaking changes from libtest to compiletest. Currently we run x check compiletest
with compiletest-use-stage0-libtest=false
on couple of CI runners to prevent that.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The default value for that option is already true
The reason I thought it was "false" is that the change notification says
"Added a new option build.compiletest-use-stage0-libtest
to force compiletest
to use the stage 0 libtest."
That sure sounds like if I want compiletest to use stage 0 libtest I need to "force" that to happen by manually changing the configuration.
The default value for that option is already true
Ah, that part was not clear to me, thanks. :)
(Sorry for not replying in-thread, github reply-by-mail does not support that.)
|
std: make `cmath` functions safe The floating point intrinsics are more difficult, I'll probably wait until rust-lang#119899 has merged before making them safe as well.
…, r=jieyouxu,kobzol make it possible to use stage0 libtest on compiletest With rust-lang/rust#119899, building the library tree will require a stage 1 compiler. This is because `compiletest` is defined as a `ToolStd` (since rust-lang/rust#68019) in order to use the in-tree library. As a result, rust-lang/rust#119899 makes certain development workflows more difficult as changes on the compiler tree will now require recompiling `compiletest` each time. This PR allows switching `ToolStd` to `ToolBootstrap` with a simple boolean option in `bootstrap.toml` to allow `compiletest` to use the stage 0 `libtest` instead. The changes under `src/ci` are clearly intended to make sure that `compiletest` doesn't break during future bootstrap beta bumps.
Any idea what we are waiting for? |
A few small things:
FYI @rust-lang/bootstrap since this is a major bootstrap change, in case you have any last minute review feedback. |
Okay. @rustbot blocked |
compiletest: Remove the libtest-based executor and its dependency Now that rust-lang#140288 has landed and the new compiletest executor is used by default, we can now move forward with removing the libtest dependency from compiletest. My hope is that after landing this, we can configure bootstrap to build compiletest with the pre-built stage0 library by default, instead of the in-tree stage0 library. That would give the stage0 redesign one less thing to worry about. --- This PR has deliberately been kept small and simple, to make it easier to revert if necessary. Further cleanup can take palce after we're confident that it won't need to be reverted. r? jieyouxu Blocker for rust-lang#119899
Rollup merge of rust-lang#140392 - Zalathar:goodbye-libtest, r=jieyouxu compiletest: Remove the libtest-based executor and its dependency Now that rust-lang#140288 has landed and the new compiletest executor is used by default, we can now move forward with removing the libtest dependency from compiletest. My hope is that after landing this, we can configure bootstrap to build compiletest with the pre-built stage0 library by default, instead of the in-tree stage0 library. That would give the stage0 redesign one less thing to worry about. --- This PR has deliberately been kept small and simple, to make it easier to revert if necessary. Further cleanup can take palce after we're confident that it won't need to be reverted. r? jieyouxu Blocker for rust-lang#119899
onur-ozkan, first, I think this work is really cool! We've got a custom rust bootstrapping setup that doesn't invoke
Naively, this looks related to this commit 3962069#diff-002b2429c67f4267af1485b8b9e2f95cbfe586971ed97f832da4d4d45d0e1e41, where the source file was removed from both the library and compiler sides in lockstep. How does the redesigned bootstrap workflow handle cases like this? |
Do we still need
|
I think rustc_expand will need to be changed to depend on the in-tree libproc_macro directly rather than fetching it from the sysroot. It needs to link against a libproc_macro built from the same sources as the one that will end up in it's own sysroot. It doesn't care about the libproc_macro copy that is in the sysroot with which rustc itself was built. It just happens to be the case that before this PR, both copies are built from the same source and thus are ABI compatible (libproc_macro uses the C ABI internally, so only the source needs to match for ABI compat, not the rustc it was built with). |
Summary
This PR changes how bootstrap builds the stage 1 compiler by switching to precompiled stage 0 standard library instead of building the in-tree one. The goal was to update bootstrap to use the beta standard library at stage 0 rather than compiling it from source (see the motivation at rust-lang/compiler-team#619).
Previously, to build a stage 1 compiler bootstrap followed this path:
With this PR, the new path is:
This also means that
cfg(bootstrap)
/cfg(not(bootstrap))
is no longer needed for library development.Building "library"
Since stage0
std
is no longer in-treex build/test/check library --stage 0
is now no-op. The minimum supported stage to buildstd
is now 1. For the same reason, default stage values in the library profile is no longer 0.Because building the in-tree library now requires a stage1 compiler, I highly recommend library developers to enable
download-rustc
to speed up compilation time.If you encounter a bug or unexpected results please open a topic in the #t-infra/bootstrap Zulip channel or create a bootstrap issue.
(Review thread: https://rust-lang.zulipchat.com/#narrow/channel/326414-t-infra.2Fbootstrap/topic/Review.20thread.3A.20stage.200.20redesign.20PR/with/508271433)
Blocked on #122709try-job: dist-x86_64-linux