Skip to content

Commit 415610c

Browse files
committed
try to make cargo-miri work with bootstrap cargo
1 parent 1f39d1f commit 415610c

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

src/tools/miri/cargo-miri/src/setup.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,10 @@ pub fn setup(
8989
let cargo_cmd = {
9090
let mut command = cargo();
9191
// Allow JSON targets since users do not have a good way to set this flag otherwise.
92-
command.arg("-Zjson-target-spec");
92+
if !env::var("RUSTC_STAGE").is_ok_and(|s| s == "1") {
93+
// ^ is a HACK for bootstrap cargo. FIXME(cfg(bootstrap)) remove the hack.
94+
command.arg("-Zjson-target-spec");
95+
}
9396
// Use Miri as rustc to build a libstd compatible with us (and use the right flags).
9497
// We set ourselves (`cargo-miri`) instead of Miri directly to be able to patch the flags
9598
// for `libpanic_abort` (usually this is done by bootstrap but we have to do it ourselves).

0 commit comments

Comments
 (0)