From 0eb8e60ed0f4a83f955a0a2433aafd7b1b07b54c Mon Sep 17 00:00:00 2001 From: Ralf Jung Date: Wed, 22 Jun 2022 10:02:33 -0700 Subject: [PATCH] avoid setting both RUSTC and RUSTC_WRAPPER --- cargo-miri/bin.rs | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/cargo-miri/bin.rs b/cargo-miri/bin.rs index 6a5e5dc3913..a7be5843d4e 100644 --- a/cargo-miri/bin.rs +++ b/cargo-miri/bin.rs @@ -638,6 +638,14 @@ fn phase_cargo_miri(mut args: env::Args) { ); } cmd.env("RUSTC_WRAPPER", &cargo_miri_path); + // Having both `RUSTC_WRAPPER` and `RUSTC` set does some odd things, so let's avoid that. + // See . + if env::var_os("RUSTC").is_some() && env::var_os("MIRI").is_none() { + println!( + "WARNING: Ignoring `RUSTC` environment variable; set `MIRI` if you want to control the binary used as the driver." + ); + } + cmd.env_remove("RUSTC"); let runner_env_name = |triple: &str| format!("CARGO_TARGET_{}_RUNNER", triple.to_uppercase().replace('-', "_"));