From 6a3a3d4f98da0f9f6cba62735ced5ea69505e3a4 Mon Sep 17 00:00:00 2001 From: Ralf Jung Date: Mon, 16 Feb 2026 11:08:06 +0100 Subject: [PATCH] try to make cargo-miri work with bootstrap cargo --- src/tools/miri/cargo-miri/src/setup.rs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/tools/miri/cargo-miri/src/setup.rs b/src/tools/miri/cargo-miri/src/setup.rs index 47c99f939254..76e9e62f5200 100644 --- a/src/tools/miri/cargo-miri/src/setup.rs +++ b/src/tools/miri/cargo-miri/src/setup.rs @@ -89,7 +89,10 @@ pub fn setup( let cargo_cmd = { let mut command = cargo(); // Allow JSON targets since users do not have a good way to set this flag otherwise. - command.arg("-Zjson-target-spec"); + if env::var("RUSTC_STAGE").is_err() { + // ^ is a HACK for bootstrap cargo. FIXME(cfg(bootstrap)) remove the hack. + command.arg("-Zjson-target-spec"); + } // Use Miri as rustc to build a libstd compatible with us (and use the right flags). // We set ourselves (`cargo-miri`) instead of Miri directly to be able to patch the flags // for `libpanic_abort` (usually this is done by bootstrap but we have to do it ourselves).