-
Notifications
You must be signed in to change notification settings - Fork 13.5k
Add ToolTarget
to bootstrap
#143641
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?
Add ToolTarget
to bootstrap
#143641
Conversation
#142357 was merged, so undrafting. |
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 need to sit on this scheme a bit, I still find it a bit confusing.
(I was reviewing this commit-by-commit, but now I realize I should've looked at the overall diff)
This comment has been minimized.
This comment has been minimized.
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.
Thanks. I'm on-board with the overall change, just some small nits and a double-check.
impl LldWrapper { | ||
/// Returns `LldWrapper` that should be **used** by the passed compiler. | ||
pub fn for_use_by_compiler(builder: &Builder<'_>, target_compiler: Compiler) -> Self { | ||
Self { | ||
build_compiler: get_tool_target_compiler( | ||
builder, | ||
ToolTargetBuildMode::Dist(target_compiler), | ||
), | ||
target: target_compiler.host, | ||
} | ||
} | ||
} |
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.
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.
Re. test coverage, should we explicitly add coverage for ./x build compiler/
w/ e.g. llvm-bitcode-linker under cross-compile at stage 2? Or would that be redundant? 🤔
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.
Yeah, this is the optimal case to avoid needless rebuilds. We don't need to build lld-wrapper with stage 2, we just need to build it with an in-tree compiler (so stage 1), both to enable cross-compilation, and to ensure that we build distributed tools with in-tree code (because of stdlib security fixes and stuff).
We already have build_compiler_tools_cross
, which builds the compiler with linker tools in stage 2, AND cross-compiles. I think that's enough.
@rustbot author |
Clarified comments. @rustbot ready |
Oh, you thought I'm done with refactoring bootstrap tools? Na-ah, think again! After the failure of #143581,
ToolTarget
is back with a vengeance. This time, I implemented the test changes and tool cleanups without forcing these tools to be built with the stage0 compiler.There are still some small wins though,
LlvmBitcodeLinker
now starts at stage 1, and not stage 2. Cargo should also be ported to this new mode, but I'm leaving that for a follow-up PR.Hopefully X-th time's the charm 🤞
r? @jieyouxu