-
Notifications
You must be signed in to change notification settings - Fork 12.8k
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
Copy stage0 binaries into stage0-sysroot #101711
Conversation
(rust-highfive has picked a reviewer for you, use r? to override) |
r? @jyn514 |
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.
This looks good :) have you tested locally that it fixes the two problems I mentioned in the issue? The rustup one should be easy to test (same way as for the stage 1 sysroot).
src/bootstrap/compile.rs
Outdated
@@ -1143,6 +1143,12 @@ impl Step for Sysroot { | |||
} | |||
} | |||
|
|||
if compiler.stage == 0 { |
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.
Oh, please also leave a comment explaining why we're special casing stage 0.
4817a0f
to
7a7c0d1
Compare
t!(fs::create_dir_all(&sysroot_bin_dir)); | ||
builder.cp_r(&stage0_bin_dir, &sysroot_bin_dir); | ||
|
||
// copy all *.so files from stage0/lib to stage0-sysroot/lib |
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.
Are you sure this is correct? We shouldn't be copying any artifacts at all for libstd, I don't remember whether we distribute it as an .so or not.
7a7c0d1
to
32f8eb2
Compare
@bors r+ Thanks! Can you also make a PR to rustc-dev-guide mentioning you can use this for a rustup toolchain, under "suggested workflows"? |
☀️ Test successful - checks-actions |
Finished benchmarking commit (0ee5a1a): comparison URL. Overall result: no relevant changes - no action needed@rustbot label: -perf-regression Warning ⚠: The following benchmark(s) failed to build:
Instruction countThis benchmark run did not return any relevant results for this metric. Max RSS (memory usage)ResultsThis is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.
CyclesResultsThis is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.
Footnotes |
Revert "Copy stage0 binaries into stage0-sysroot" This reverts PR rust-lang#101711. The PR broke the rustc/bootstrap benchmark on rustc-perf, I believe due to the assumption that the stage0 directory exists. Fixing that by just skipping this logic might be reasonable, but I think there's a larger discussion to be had around the right behavior when we don't have a single bin/ directory (when rustc= and cargo= are specified in config.toml). I think it's potentially reasonable to put those binaries (cargo, rustc, rustfmt?) into the bin directory, but for now just want to get us back to a healthy state. r? `@jyn514` (but would appreciate review from others as this is just a direct revert).
…crum Copy stage0 `rustc` binaries to `stage0-sysroot` This is basically a revival of rust-lang#101711 and rust-lang#107956, with an added check that the full sysroot will only be created if the original rustc comes from `stage0/bin`. What is/should be tested: - [x] `rustup toolchain link stage0` (new libstd is used correctly) - [x] `python3 x.py fmt dist --stage 0` - [x] Custom rustc/cargo in `config.toml` (in this case this logic is ignored) - [x] Perfbot (try perf run has succeeded) - [x] Real use case (rust-lang/backtrace-rs#542) (Hopefully) fixes: rust-lang#101691 This is not the "end all, be all" solution to this problem, but as long as it resolves the basic use-case, and doesn't break perfbot, I say ship it. This code will probably be nuked anyway Soon™ because of the stage redesign.
Copy stage0 `rustc` binaries to `stage0-sysroot` This is basically a revival of rust-lang/rust#101711 and rust-lang/rust#107956, with an added check that the full sysroot will only be created if the original rustc comes from `stage0/bin`. What is/should be tested: - [x] `rustup toolchain link stage0` (new libstd is used correctly) - [x] `python3 x.py fmt dist --stage 0` - [x] Custom rustc/cargo in `config.toml` (in this case this logic is ignored) - [x] Perfbot (try perf run has succeeded) - [x] Real use case (rust-lang/backtrace-rs#542) (Hopefully) fixes: rust-lang/rust#101691 This is not the "end all, be all" solution to this problem, but as long as it resolves the basic use-case, and doesn't break perfbot, I say ship it. This code will probably be nuked anyway Soon™ because of the stage redesign.
Fixes #101691