about summary refs log tree commit diff
path: root/src/bootstrap
diff options
context:
space:
mode:
authorbit-aloo <sshourya17@gmail.com>2025-09-21 20:03:15 +0530
committerbit-aloo <sshourya17@gmail.com>2025-09-21 20:58:17 +0530
commita48cd767f634ec7461b8367e5d301a2985cfce7d (patch)
tree0475fd51bbcbb4b2176be8a7d87dadcdb161a783 /src/bootstrap
parentafe380dd58170b55b100a659f05017b1149d0ec9 (diff)
downloadrust-a48cd767f634ec7461b8367e5d301a2985cfce7d.tar.gz
rust-a48cd767f634ec7461b8367e5d301a2985cfce7d.zip
add explicit config assignment when running the test, as the src is assigned to CARGO_MANIFEST_DIR, so the config actually use the <src>/bootstrap.toml and the /tmp/bootstrap.toml
Diffstat (limited to 'src/bootstrap')
-rw-r--r--src/bootstrap/src/utils/tests/mod.rs9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/bootstrap/src/utils/tests/mod.rs b/src/bootstrap/src/utils/tests/mod.rs
index dc905969dca..764b89086cf 100644
--- a/src/bootstrap/src/utils/tests/mod.rs
+++ b/src/bootstrap/src/utils/tests/mod.rs
@@ -50,6 +50,7 @@ pub struct ConfigBuilder {
     directory: PathBuf,
     override_download_ci_llvm: bool,
     dry_run: bool,
+    explicit_config: bool,
 }
 
 impl ConfigBuilder {
@@ -59,6 +60,7 @@ impl ConfigBuilder {
             directory,
             override_download_ci_llvm: true,
             dry_run: true,
+            explicit_config: true,
         }
     }
 
@@ -108,6 +110,7 @@ impl ConfigBuilder {
     pub fn with_default_toml_config(mut self, config_toml: &str) -> Self {
         let toml_path = self.directory.join("bootstrap.toml");
         std::fs::write(&toml_path, config_toml).unwrap();
+        self.explicit_config = false;
         self.args.push("--config".to_string());
         self.args.push(toml_path.display().to_string());
         self
@@ -139,6 +142,12 @@ impl ConfigBuilder {
             self.args.push("llvm.download-ci-llvm=false".to_string());
         }
 
+        // always use the bootstrap toml created in the
+        // temporary directory and not from the <src>
+        if self.explicit_config {
+            self = self.with_default_toml_config("");
+        }
+
         // Do not mess with the local rustc checkout build directory
         self.args.push("--build-dir".to_string());
         self.args.push(self.directory.join("build").display().to_string());