Skip to content

Commit

Permalink
Rollup merge of rust-lang#128382 - RalfJung:cargo-miri-assert, r=oli-obk
Browse files Browse the repository at this point in the history
cargo-miri: better error when we seem to run inside bootstrap but something is wrong

Cc rust-lang/miri#3775
  • Loading branch information
matthiaskrgr authored Jul 30, 2024
2 parents d21d3d6 + cc7e7bc commit ec36902
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/tools/miri/cargo-miri/src/setup.rs
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,10 @@ pub fn setup(
// for target crates.
let cargo_miri_path = std::env::current_exe().expect("current executable path invalid");
if env::var_os("RUSTC_STAGE").is_some() {
assert!(env::var_os("RUSTC").is_some());
assert!(
env::var_os("RUSTC").is_some() && env::var_os("RUSTC_WRAPPER").is_some(),
"cargo-miri setup is running inside rustc bootstrap but RUSTC or RUST_WRAPPER is not set"
);
command.env("RUSTC_REAL", &cargo_miri_path);
} else {
command.env("RUSTC", &cargo_miri_path);
Expand Down

0 comments on commit ec36902

Please sign in to comment.