Rollup merge of #126238 - Nilstrieb:run,miri,run, r=RalfJung

Fix Miri sysroot for `x run`

Miri no longer (after https://github.com/rust-lang/miri/pull/3411) respects `MIRI_SYSROOT` and wants to be treated like a REAL rustc, with `--sysroot`. \*pats Miri\* sure Miri, just for you :3.

fixes #126233

r? RalfJung (or whoever else feels like it)
This commit is contained in:
Matthias Krüger 2024-06-13 22:55:45 +02:00 committed by GitHub
commit 24c94f0e4f
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -149,12 +149,14 @@ impl Step for Miri {
&[],
);
miri.add_rustc_lib_path(builder);
// Forward arguments.
miri.arg("--").arg("--target").arg(target.rustc_target_arg());
miri.args(builder.config.args());
// miri tests need to know about the stage sysroot
miri.env("MIRI_SYSROOT", &miri_sysroot);
miri.arg("--sysroot").arg(miri_sysroot);
// Forward arguments. This may contain further arguments to the program
// after another --, so this must be at the end.
miri.args(builder.config.args());
let mut miri = Command::from(miri);
builder.run(&mut miri);