about summary refs log tree commit diff
path: root/src/bootstrap
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2025-03-08 15:34:51 +0000
committerbors <bors@rust-lang.org>2025-03-08 15:34:51 +0000
commit07292ccccde8b64d87036b2f90b70bc54ab68456 (patch)
tree447f3149f7998334dd2ceee55c7ed050b423a7cc /src/bootstrap
parent79b43dfde9dd1e3bed3c6ef7e9cfc708422f671f (diff)
parent028aaa12b6936362f78fe553e820471c36a5a0f5 (diff)
downloadrust-07292ccccde8b64d87036b2f90b70bc54ab68456.tar.gz
rust-07292ccccde8b64d87036b2f90b70bc54ab68456.zip
Auto merge of #138224 - onur-ozkan:fix-multiple-candidates, r=jieyouxu
skip `compile::Std` and `compile::Rustc` on `forced_compiler`

Fixes https://github.com/rust-lang/rust/issues/138220

Set `download-rustc = true/false` and run `x test tests/ui/meta/no_std-extern-libc.rs --force-rerun` to debug it.
Diffstat (limited to 'src/bootstrap')
-rw-r--r--src/bootstrap/src/core/build_steps/tool.rs14
1 files changed, 11 insertions, 3 deletions
diff --git a/src/bootstrap/src/core/build_steps/tool.rs b/src/bootstrap/src/core/build_steps/tool.rs
index 704feac54de..96f2274a9d7 100644
--- a/src/bootstrap/src/core/build_steps/tool.rs
+++ b/src/bootstrap/src/core/build_steps/tool.rs
@@ -121,10 +121,18 @@ impl Step for ToolBuild {
 
         match self.mode {
             Mode::ToolRustc => {
-                builder.ensure(compile::Std::new(self.compiler, self.compiler.host));
-                builder.ensure(compile::Rustc::new(self.compiler, target));
+                // If compiler was forced, its artifacts should be prepared earlier.
+                if !self.compiler.is_forced_compiler() {
+                    builder.ensure(compile::Std::new(self.compiler, self.compiler.host));
+                    builder.ensure(compile::Rustc::new(self.compiler, target));
+                }
+            }
+            Mode::ToolStd => {
+                // If compiler was forced, its artifacts should be prepared earlier.
+                if !self.compiler.is_forced_compiler() {
+                    builder.ensure(compile::Std::new(self.compiler, target))
+                }
             }
-            Mode::ToolStd => builder.ensure(compile::Std::new(self.compiler, target)),
             Mode::ToolBootstrap => {} // uses downloaded stage0 compiler libs
             _ => panic!("unexpected Mode for tool build"),
         }