try to make cargo-miri work with bootstrap cargo

This commit is contained in:
Ralf Jung 2026-02-16 11:08:06 +01:00
parent 1f39d1f74f
commit 6a3a3d4f98

View file

@ -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).