about summary refs log tree commit diff
diff options
context:
space:
mode:
authorJubilee <workingjubilee@gmail.com>2024-10-07 11:10:52 -0700
committerGitHub <noreply@github.com>2024-10-07 11:10:52 -0700
commit8cd9d954c72d71dbca603efccbd70098f8625fd4 (patch)
treed21d03d5c8dd2cab29b264c8f748bbf49b04ecaf
parentbd2e7ee976b23d35dbbf94d273c9588a51db6427 (diff)
parentc592eacc63220df01fb08228fc5bc78b75dc1dd1 (diff)
downloadrust-8cd9d954c72d71dbca603efccbd70098f8625fd4.tar.gz
rust-8cd9d954c72d71dbca603efccbd70098f8625fd4.zip
Rollup merge of #130479 - onur-ozkan:llvm-bitcode-linker-multiple-candidates, r=Kobzol
skip in-tree compiler build for llvm-bitcode-linker if ci-rustc is on

Similar to https://github.com/rust-lang/rust/issues/108767, resolves the `multiple candidates` problem for ci-rustc.

See https://github.com/rust-lang/rust/pull/122709#issuecomment-2355436227 for more context.

Blocker for #122709.
-rw-r--r--src/bootstrap/src/core/build_steps/tool.rs7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/bootstrap/src/core/build_steps/tool.rs b/src/bootstrap/src/core/build_steps/tool.rs
index 64dfe054d9c..e2fcd13efe3 100644
--- a/src/bootstrap/src/core/build_steps/tool.rs
+++ b/src/bootstrap/src/core/build_steps/tool.rs
@@ -872,8 +872,11 @@ impl Step for LlvmBitcodeLinker {
     fn run(self, builder: &Builder<'_>) -> PathBuf {
         let bin_name = "llvm-bitcode-linker";
 
-        builder.ensure(compile::Std::new(self.compiler, self.compiler.host));
-        builder.ensure(compile::Rustc::new(self.compiler, self.target));
+        // If enabled, use ci-rustc and skip building the in-tree compiler.
+        if !builder.download_rustc() {
+            builder.ensure(compile::Std::new(self.compiler, self.compiler.host));
+            builder.ensure(compile::Rustc::new(self.compiler, self.target));
+        }
 
         let cargo = prepare_tool_cargo(
             builder,