From a48cd767f634ec7461b8367e5d301a2985cfce7d Mon Sep 17 00:00:00 2001 From: bit-aloo Date: Sun, 21 Sep 2025 20:03:15 +0530 Subject: [PATCH] add explicit config assignment when running the test, as the src is assigned to CARGO_MANIFEST_DIR, so the config actually use the /bootstrap.toml and the /tmp/bootstrap.toml --- src/bootstrap/src/utils/tests/mod.rs | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/bootstrap/src/utils/tests/mod.rs b/src/bootstrap/src/utils/tests/mod.rs index dc905969dcac..764b89086cf2 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 + 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());