Skip to content

Commit 35023f5

Browse files
committedJun 22, 2022
Auto merge of #2259 - RalfJung:cargo-rustc, r=RalfJung
avoid setting both RUSTC and RUSTC_WRAPPER Fixes #2238
2 parents f8a222a + 0eb8e60 commit 35023f5

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed
 

‎cargo-miri/bin.rs

+8
Original file line numberDiff line numberDiff line change
@@ -638,6 +638,14 @@ fn phase_cargo_miri(mut args: env::Args) {
638638
);
639639
}
640640
cmd.env("RUSTC_WRAPPER", &cargo_miri_path);
641+
// Having both `RUSTC_WRAPPER` and `RUSTC` set does some odd things, so let's avoid that.
642+
// See <https://github.com/rust-lang/miri/issues/2238>.
643+
if env::var_os("RUSTC").is_some() && env::var_os("MIRI").is_none() {
644+
println!(
645+
"WARNING: Ignoring `RUSTC` environment variable; set `MIRI` if you want to control the binary used as the driver."
646+
);
647+
}
648+
cmd.env_remove("RUSTC");
641649

642650
let runner_env_name =
643651
|triple: &str| format!("CARGO_TARGET_{}_RUNNER", triple.to_uppercase().replace('-', "_"));

0 commit comments

Comments
 (0)
Please sign in to comment.