-
Notifications
You must be signed in to change notification settings - Fork 13.5k
bootstrap: Don't trigger an unnecessary LLVM build from check builds #144011
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?
Conversation
|
r? bootstrap |
This comment has been minimized.
This comment has been minimized.
Hmm, in addition to those snapshot failures, I'm also seeing LLVM builds in subsequent manual testing. Mysterious. @rustbot author |
Reminder, once the PR becomes ready for a review, use |
444b227
to
2aafc40
Compare
Updated snapshot tests, several of which included the inappropriate LLVM build (diff). |
This comment has been minimized.
This comment has been minimized.
2aafc40
to
857b6a2
Compare
This comment has been minimized.
This comment has been minimized.
Having to deal with PR CI failures for |
857b6a2
to
bf75472
Compare
@bors2 try jobs=x86_64-pc-windows-gnu |
bootstrap: Don't trigger an LLVM build from check builds using the stage 0 compiler Coming back to r-l/r development after a few weeks away, I found a major regression in my dev workflows: running `x check compiler` (either manually or via rust-analyzer) would have the side-effect of building LLVM, even though that shouldn't be necessary. For my main build directory this would be a minor annoyance, but for my separate rust-analyzer build directory it's a huge problem because it causes a completely separate build of LLVM, which takes a long time and should be completely unnecessary. --- After some investigation, I tracked down the problem to the `can_skip_build` check in this code: https://github.com/rust-lang/rust/blob/3014e79f9c8d5510ea7b3a3b70d171d0948b1e96/src/bootstrap/src/core/build_steps/compile.rs#L1382-L1396 Historically, this would skip the LLVM build for stage 0 check builds. But after the recent stage 0 std redesign and some associated check stage renumbering (e.g. #143048), the condition `builder.top_stage == build_stage` is now false, because `top_stage` is 1 (due to the renumbering) but `build_stage` is 0 (because a “stage 1” non-library check build still uses the stage 0 compiler). --- Because this is a critical contributor roadblock for me, I have tried to fix this in a relatively narrow way. It's possible that all of this surrounding logic could be greatly simplified (especially in light of the stage redesign changes), but I didn't want this fix to be held back by scope creep. --- (Zulip thread: https://rust-lang.zulipchat.com/#narrow/channel/326414-t-infra.2Fbootstrap/topic/Bootstrap.20incorrectly.20building.20LLVM.20for.20check.20builds/near/528991035) r? Kobzol try-job: x86_64-pc-windows-gnu
💔 Test failed
|
@bors2 try jobs=x86_64-mingw-1,x86_64-mingw-2 |
bootstrap: Don't trigger an LLVM build from check builds using the stage 0 compiler Coming back to r-l/r development after a few weeks away, I found a major regression in my dev workflows: running `x check compiler` (either manually or via rust-analyzer) would have the side-effect of building LLVM, even though that shouldn't be necessary. For my main build directory this would be a minor annoyance, but for my separate rust-analyzer build directory it's a huge problem because it causes a completely separate build of LLVM, which takes a long time and should be completely unnecessary. --- After some investigation, I tracked down the problem to the `can_skip_build` check in this code: https://github.com/rust-lang/rust/blob/3014e79f9c8d5510ea7b3a3b70d171d0948b1e96/src/bootstrap/src/core/build_steps/compile.rs#L1382-L1396 Historically, this would skip the LLVM build for stage 0 check builds. But after the recent stage 0 std redesign and some associated check stage renumbering (e.g. #143048), the condition `builder.top_stage == build_stage` is now false, because `top_stage` is 1 (due to the renumbering) but `build_stage` is 0 (because a “stage 1” non-library check build still uses the stage 0 compiler). --- Because this is a critical contributor roadblock for me, I have tried to fix this in a relatively narrow way. It's possible that all of this surrounding logic could be greatly simplified (especially in light of the stage redesign changes), but I didn't want this fix to be held back by scope creep. --- (Zulip thread: https://rust-lang.zulipchat.com/#narrow/channel/326414-t-infra.2Fbootstrap/topic/Bootstrap.20incorrectly.20building.20LLVM.20for.20check.20builds/near/528991035) r? Kobzol try-job: x86_64-mingw-1 try-job: x86_64-mingw-2
Historical note: The existing stage-sensitive check was introduced back in #110122. From looking at the context, and considering the many changes that have been made since, I think it should be fine to remove the stage-number check. |
TBH that error would happen on any Windows target other than |
Coming back to r-l/r development after a few weeks away, I found a major regression in my dev workflows: running
x check compiler
(either manually or via rust-analyzer) would have the side-effect of building LLVM, even though that shouldn't be necessary.For my main build directory this would be a minor annoyance, but for my separate rust-analyzer build directory it's a huge problem because it causes a completely separate build of LLVM, which takes a long time and should be completely unnecessary.
After some investigation, I tracked down the problem to the
can_skip_build
check in this code:rust/src/bootstrap/src/core/build_steps/compile.rs
Lines 1382 to 1396 in 3014e79
Historically, this would skip the LLVM build for stage 0 check builds. But after the recent stage 0 std redesign and some associated check stage renumbering (e.g. #143048), the condition
builder.top_stage == build_stage
is now false, becausetop_stage
is 1 (due to the renumbering) butbuild_stage
is 0 (because a “stage 1” non-library check build still uses the stage 0 compiler).Because this is a critical contributor roadblock for me, I have tried to fix this in a relatively narrow way. It's possible that all of this surrounding logic could be greatly simplified (especially in light of the stage redesign changes), but I didn't want this fix to be held back by scope creep.
(Zulip thread: https://rust-lang.zulipchat.com/#narrow/channel/326414-t-infra.2Fbootstrap/topic/Bootstrap.20incorrectly.20building.20LLVM.20for.20check.20builds/near/528991035)