bootstrap: Don't trigger an unnecessary LLVM build from check builds#144011
Merged
bors merged 3 commits intorust-lang:masterfrom Jul 20, 2025
Merged
bootstrap: Don't trigger an unnecessary LLVM build from check builds#144011bors merged 3 commits intorust-lang:masterfrom
bors merged 3 commits intorust-lang:masterfrom
Conversation
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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_buildcheck 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_stageis now false, becausetop_stageis 1 (due to the renumbering) butbuild_stageis 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)