Unset test env vars before setting new ones.

If you want to override an env var, don't unset it, just set it
This commit is contained in:
Oli Scherer
2024-04-09 10:07:11 +00:00
parent 63f70b3d10
commit fe18afe48c
+2 -2
View File
@@ -2173,8 +2173,8 @@ fn compose_and_run_compiler(&self, mut rustc: Command, input: Option<String>) ->
let aux_dir = self.aux_output_dir();
self.build_all_auxiliary(&self.testpaths, &aux_dir, &mut rustc);
self.props.unset_rustc_env.iter().fold(&mut rustc, Command::env_remove);
rustc.envs(self.props.rustc_env.clone());
self.props.unset_rustc_env.iter().fold(&mut rustc, Command::env_remove);
self.compose_and_run(
rustc,
self.config.compile_lib_path.to_str().unwrap(),
@@ -2220,10 +2220,10 @@ fn build_auxiliary(
);
aux_cx.build_all_auxiliary(of, &aux_dir, &mut aux_rustc);
aux_rustc.envs(aux_props.rustc_env.clone());
for key in &aux_props.unset_rustc_env {
aux_rustc.env_remove(key);
}
aux_rustc.envs(aux_props.rustc_env.clone());
let (aux_type, crate_type) = if is_bin {
(AuxType::Bin, Some("bin"))