-
Notifications
You must be signed in to change notification settings - Fork 13.8k
Remove unnecessary stage2 host builds from cross-compiled dist builders #145874
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
Conversation
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.
Oof, thanks
@bors r+ rollup=never |
This is causing some unnecessary builds also on dist builders with docs (because dist docs steps unnecessarily build stage 2 rustc). I'll fix that with a more general approach later, once this lands. |
Looking at the queue, since it's rather tame, let's bump this to p=5. @bors p=5 (unnecessary builds) |
// Normally, to build stage N libstd, we need stage N rustc. | ||
// However, if we know that we will uplift libstd from stage 1 anyway, building the stage N | ||
// rustc can be wasteful. | ||
// In particular, if we do a cross-compiling dist stage 2 build from T1 to T2, we need: |
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.
Does 'T' stand for target? I suggest spelling it out whatever it is. Alternatives: machine, arch(itecture)
// Enable dist cranelift tarball by default with `x dist` if cranelift is enabled in | ||
// `rust.codegen-backends`. | ||
/// Simulates e.g. the powerpc64 builder, which is fully cross-compiled from x64, but it does | ||
/// not build docs. Crutically, it shouldn't build host stage 2 rustc. |
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.
Crucially or Critically?
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.
Haha :D Thanks, I'll fix it in a followup PR.
☀️ Test successful - checks-actions |
What is this?This is an experimental post-merge analysis report that shows differences in test outcomes between the merged PR and its parent PR.Comparing 4356e83 (parent) -> 5ab6924 (this PR) Test differencesShow 7 test diffsStage 0
Additionally, 4 doctest diffs were found. These are ignored, as they are noisy. Job group index Test dashboardRun cargo run --manifest-path src/ci/citool/Cargo.toml -- \
test-dashboard 5ab69249f36678c0a770a08d3d1b28a8103349ff --output-dir test-dashboard And then open Job duration changes
How to interpret the job duration changes?Job durations can vary a lot, based on the actual runner instance |
Finished benchmarking commit (5ab6924): comparison URL. Overall result: no relevant changes - no action needed@rustbot label: -perf-regression Instruction countThis benchmark run did not return any relevant results for this metric. Max RSS (memory usage)Results (primary 2.3%, secondary -3.0%)A less reliable metric. May be of interest, but not used to determine the overall result above.
CyclesResults (primary -2.2%, secondary 2.1%)A less reliable metric. May be of interest, but not used to determine the overall result above.
Binary sizeThis benchmark run did not return any relevant results for this metric. Bootstrap: 468.126s -> 466.377s (-0.37%) |
Avoid more rustc rebuilds in cross-compilation scenarios This is a continuation of #145874. It adds a `compiler_for_std` function, which is a slimmed down version of `compiler_for`, which is much simpler, and designed to be used only for the standard library. The build, dist and doc steps somtimes work with a stage2 std for a given target. That currently requires building a stage2 host compiler. However, if we uplift the stage1 libstd anyway, that is wasteful, in particular when we are cross-compiling. The last two commits progressively make the stage 2 host rustc build avoidance more and more aggressive. I think that if we decide that it is fine to ship stage1 libstd everywhere, then it makes sense to go all the way. When we ship stuff, we always build it with the stage 1 compiler (e.g. we ship stage 2 rustc which is built with stage 1 rustc). Libstd is the only component where stage N is built with the stage N compiler. So I think that shipping stage 1 libstd is "enough", and we could thus optimize what gets built on CI. r? `@jieyouxu`
Avoid more rustc rebuilds in cross-compilation scenarios This is a continuation of rust-lang/rust#145874. It adds a `compiler_for_std` function, which is a slimmed down version of `compiler_for`, which is much simpler, and designed to be used only for the standard library. The build, dist and doc steps somtimes work with a stage2 std for a given target. That currently requires building a stage2 host compiler. However, if we uplift the stage1 libstd anyway, that is wasteful, in particular when we are cross-compiling. The last two commits progressively make the stage 2 host rustc build avoidance more and more aggressive. I think that if we decide that it is fine to ship stage1 libstd everywhere, then it makes sense to go all the way. When we ship stuff, we always build it with the stage 1 compiler (e.g. we ship stage 2 rustc which is built with stage 1 rustc). Libstd is the only component where stage N is built with the stage N compiler. So I think that shipping stage 1 libstd is "enough", and we could thus optimize what gets built on CI. r? `@jieyouxu`
This is a repeated regression (#138004, #138123) that was reintroduced in #145472. I thought that we have a test for it, but alas, the "correct" test required
--disable-docs
. I added the test in this PR, and re-added thedist::Std
build optimization that solves this.r? @jieyouxu