Skip to content

Commit abb1eba

Browse files
Revert "opt-dist: dont overrwite config.toml when verifying"
This reverts commit c81a40b.
1 parent 649d99b commit abb1eba

File tree

1 file changed

+17
-14
lines changed

1 file changed

+17
-14
lines changed

src/tools/opt-dist/src/tests.rs

+17-14
Original file line numberDiff line numberDiff line change
@@ -59,17 +59,26 @@ pub fn run_tests(env: &Environment) -> anyhow::Result<()> {
5959
.join(format!("llvm-config{}", executable_extension()));
6060
assert!(llvm_config.is_file());
6161

62-
let rustc = format!("build.rustc={}", rustc_path.to_string().replace('\\', "/"));
63-
let cargo = format!("build.cargo={}", cargo_path.to_string().replace('\\', "/"));
64-
let llvm_config =
65-
format!("target.{host_triple}.llvm-config={}", llvm_config.to_string().replace('\\', "/"));
62+
let config_content = format!(
63+
r#"profile = "user"
64+
change-id = 115898
6665
67-
log::info!("Set the following configurations for running tests:");
68-
log::info!("\t{rustc}");
69-
log::info!("\t{cargo}");
70-
log::info!("\t{llvm_config}");
66+
[build]
67+
rustc = "{rustc}"
68+
cargo = "{cargo}"
69+
70+
[target.{host_triple}]
71+
llvm-config = "{llvm_config}"
72+
"#,
73+
rustc = rustc_path.to_string().replace('\\', "/"),
74+
cargo = cargo_path.to_string().replace('\\', "/"),
75+
llvm_config = llvm_config.to_string().replace('\\', "/")
76+
);
77+
log::info!("Using following `config.toml` for running tests:\n{config_content}");
7178

7279
// Simulate a stage 0 compiler with the extracted optimized dist artifacts.
80+
std::fs::write("config.toml", config_content)?;
81+
7382
let x_py = env.checkout_path().join("x.py");
7483
let mut args = vec![
7584
env.python_binary(),
@@ -88,12 +97,6 @@ pub fn run_tests(env: &Environment) -> anyhow::Result<()> {
8897
"tests/run-pass-valgrind",
8998
"tests/ui",
9099
"tests/crashes",
91-
"--set",
92-
&rustc,
93-
"--set",
94-
&cargo,
95-
"--set",
96-
&llvm_config,
97100
];
98101
for test_path in env.skipped_tests() {
99102
args.extend(["--skip", test_path]);

0 commit comments

Comments
 (0)