-
Notifications
You must be signed in to change notification settings - Fork 13.3k
Use the bootstrap compiler for x check
on bootstrap tools
#139170
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? @onur-ozkan rustbot has assigned @onur-ozkan. Use |
9ed6969
to
3a3f90e
Compare
} | ||
Mode::ToolStd => { | ||
compiler = builder.compiler(0, host); | ||
builder.ensure(Std::new(target).with_compiler(compiler)); |
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.
We also have similar macros for building tools. Why can these work without with_compiler
?
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 compile::Std
step takes an explicit compiler argument, so the equivalent of with_compiler
is built into the constructor.
The check::Std
step does not, and is hardcoded to use the top_stage
compiler unless overridden.
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 reason I added with_compiler
, instead of reworking the check::Std::new
constructor, was that this PR had already grown in scope beyond my original intentions (I just wanted to be able to register non-wasteful check builds for other bootstrap tools), and I didn't want to have to go down the extra rabbit hole of redesigning the check::Std
step.
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 see. Yeah, that's a common situation in bootstrap, when you touch something, it's often immediately time for refactoring of the previous state :D
Can't we skip ensuring Std for bootstrap tools? |
3a3f90e
to
1c8801e
Compare
Added comments to the |
With this PR, most bootstrap tools use We only do a check build of std for tools explicitly marked with |
☔ The latest upstream changes (presumably #139525) made this pull request unmergeable. Please resolve the merge conflicts. |
The existing implementation of
tool_check_step!
uses the specified--stage
compiler, assumesMode::ToolRustc
, and unconditionally performs a check build of the compiler before checking the tool.That behaviour makes sense for tools like rustdoc, but is inappropriate for checking things like bootstrap itself, or compiletest. Bootstrap tools are built the bootstrap compiler, and should be checked with that same compiler. And they have no reason to check the compiler crates.
This PR therefore adds support for specifying a mode in
tool_check_step!
, and using that mode to determine which compiler to use.