Auto merge of #2415 - RalfJung:cargo-miri, r=oli-obk
support MIRI_HOST_SYSROOT env var for stage 0 builds Together with a [patch on the rustc side](https://github.com/rust-lang/rust/pull/99599), this makes `./x.py test src/tools/miri --stage 0` work again. :) r? `@oli-obk`
This commit is contained in:
commit
cc6439df69
2 changed files with 8 additions and 4 deletions
|
|
@ -445,6 +445,8 @@ binaries, and as such worth documenting:
|
|||
crate currently being compiled.
|
||||
* `MIRI_VERBOSE` when set to any value tells the various `cargo-miri` phases to
|
||||
perform verbose logging.
|
||||
* `MIRI_HOST_SYSROOT` is set by bootstrap to tell `cargo-miri` which sysroot to use for *host*
|
||||
operations.
|
||||
|
||||
[testing-miri]: CONTRIBUTING.md#testing-the-miri-driver
|
||||
|
||||
|
|
|
|||
|
|
@ -721,7 +721,9 @@ fn phase_cargo_miri(mut args: impl Iterator<Item = String>) {
|
|||
// hope that all they do is ask for the version number -- things could quickly go downhill from here.
|
||||
// In `main`, we need the value of `RUSTC` to distinguish RUSTC_WRAPPER invocations from rustdoc
|
||||
// or TARGET_RUNNER invocations, so we canonicalize it here to make it exceedingly unlikely that
|
||||
// there would be a collision.
|
||||
// there would be a collision with other invocations of cargo-miri (as rustdoc or as runner).
|
||||
// We explicitly do this even if RUSTC_STAGE is set, since for these builds we do *not* want the
|
||||
// bootstrap `rustc` thing in our way! Instead, we have MIRI_HOST_SYSROOT to use for host builds.
|
||||
cmd.env("RUSTC", &fs::canonicalize(find_miri()).unwrap());
|
||||
|
||||
let runner_env_name =
|
||||
|
|
@ -929,9 +931,9 @@ fn phase_rustc(mut args: impl Iterator<Item = String>, phase: RustcPhase) {
|
|||
} else {
|
||||
// For host crates (but not when we are printing), we might still have to set the sysroot.
|
||||
if !print {
|
||||
// When we're running `cargo-miri` from `x.py` we need to pass the sysroot explicitly as rustc
|
||||
// can't figure out the sysroot on its own unless it's from rustup.
|
||||
if let Some(sysroot) = std::env::var_os("SYSROOT") {
|
||||
// When we're running `cargo-miri` from `x.py` we need to pass the sysroot explicitly
|
||||
// due to bootstrap complications.
|
||||
if let Some(sysroot) = std::env::var_os("MIRI_HOST_SYSROOT") {
|
||||
cmd.arg("--sysroot").arg(sysroot);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue