Skip to content

Commit a48cd76

Browse files
committed
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
1 parent afe380d commit a48cd76

File tree

1 file changed

+9
-0
lines changed
  • src/bootstrap/src/utils/tests

1 file changed

+9
-0
lines changed

src/bootstrap/src/utils/tests/mod.rs

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@ pub struct ConfigBuilder {
5050
directory: PathBuf,
5151
override_download_ci_llvm: bool,
5252
dry_run: bool,
53+
explicit_config: bool,
5354
}
5455

5556
impl ConfigBuilder {
@@ -59,6 +60,7 @@ impl ConfigBuilder {
5960
directory,
6061
override_download_ci_llvm: true,
6162
dry_run: true,
63+
explicit_config: true,
6264
}
6365
}
6466

@@ -108,6 +110,7 @@ impl ConfigBuilder {
108110
pub fn with_default_toml_config(mut self, config_toml: &str) -> Self {
109111
let toml_path = self.directory.join("bootstrap.toml");
110112
std::fs::write(&toml_path, config_toml).unwrap();
113+
self.explicit_config = false;
111114
self.args.push("--config".to_string());
112115
self.args.push(toml_path.display().to_string());
113116
self
@@ -139,6 +142,12 @@ impl ConfigBuilder {
139142
self.args.push("llvm.download-ci-llvm=false".to_string());
140143
}
141144

145+
// always use the bootstrap toml created in the
146+
// temporary directory and not from the <src>
147+
if self.explicit_config {
148+
self = self.with_default_toml_config("");
149+
}
150+
142151
// Do not mess with the local rustc checkout build directory
143152
self.args.push("--build-dir".to_string());
144153
self.args.push(self.directory.join("build").display().to_string());

0 commit comments

Comments
 (0)