Skip to content

Commit 07292cc

Browse files
committed
Auto merge of rust-lang#138224 - onur-ozkan:fix-multiple-candidates, r=jieyouxu
skip `compile::Std` and `compile::Rustc` on `forced_compiler` Fixes rust-lang#138220 Set `download-rustc = true/false` and run `x test tests/ui/meta/no_std-extern-libc.rs --force-rerun` to debug it.
2 parents 79b43df + 028aaa1 commit 07292cc

File tree

1 file changed

+11
-3
lines changed
  • src/bootstrap/src/core/build_steps

1 file changed

+11
-3
lines changed

src/bootstrap/src/core/build_steps/tool.rs

+11-3
Original file line numberDiff line numberDiff line change
@@ -121,10 +121,18 @@ impl Step for ToolBuild {
121121

122122
match self.mode {
123123
Mode::ToolRustc => {
124-
builder.ensure(compile::Std::new(self.compiler, self.compiler.host));
125-
builder.ensure(compile::Rustc::new(self.compiler, target));
124+
// If compiler was forced, its artifacts should be prepared earlier.
125+
if !self.compiler.is_forced_compiler() {
126+
builder.ensure(compile::Std::new(self.compiler, self.compiler.host));
127+
builder.ensure(compile::Rustc::new(self.compiler, target));
128+
}
129+
}
130+
Mode::ToolStd => {
131+
// If compiler was forced, its artifacts should be prepared earlier.
132+
if !self.compiler.is_forced_compiler() {
133+
builder.ensure(compile::Std::new(self.compiler, target))
134+
}
126135
}
127-
Mode::ToolStd => builder.ensure(compile::Std::new(self.compiler, target)),
128136
Mode::ToolBootstrap => {} // uses downloaded stage0 compiler libs
129137
_ => panic!("unexpected Mode for tool build"),
130138
}

0 commit comments

Comments
 (0)