File tree 2 files changed +8
-4
lines changed
2 files changed +8
-4
lines changed Original file line number Diff line number Diff line change @@ -445,6 +445,8 @@ binaries, and as such worth documenting:
445
445
crate currently being compiled.
446
446
* `MIRI_VERBOSE` when set to any value tells the various `cargo-miri` phases to
447
447
perform verbose logging.
448
+ * `MIRI_HOST_SYSROOT` is set by bootstrap to tell `cargo-miri` which sysroot to use for *host*
449
+ operations.
448
450
449
451
[testing-miri] : CONTRIBUTING.md#testing-the-miri-driver
450
452
Original file line number Diff line number Diff line change @@ -721,7 +721,9 @@ fn phase_cargo_miri(mut args: impl Iterator<Item = String>) {
721
721
// hope that all they do is ask for the version number -- things could quickly go downhill from here.
722
722
// In `main`, we need the value of `RUSTC` to distinguish RUSTC_WRAPPER invocations from rustdoc
723
723
// or TARGET_RUNNER invocations, so we canonicalize it here to make it exceedingly unlikely that
724
- // there would be a collision.
724
+ // there would be a collision with other invocations of cargo-miri (as rustdoc or as runner).
725
+ // We explicitly do this even if RUSTC_STAGE is set, since for these builds we do *not* want the
726
+ // bootstrap `rustc` thing in our way! Instead, we have MIRI_HOST_SYSROOT to use for host builds.
725
727
cmd. env ( "RUSTC" , & fs:: canonicalize ( find_miri ( ) ) . unwrap ( ) ) ;
726
728
727
729
let runner_env_name =
@@ -929,9 +931,9 @@ fn phase_rustc(mut args: impl Iterator<Item = String>, phase: RustcPhase) {
929
931
} else {
930
932
// For host crates (but not when we are printing), we might still have to set the sysroot.
931
933
if !print {
932
- // When we're running `cargo-miri` from `x.py` we need to pass the sysroot explicitly as rustc
933
- // can't figure out the sysroot on its own unless it's from rustup .
934
- if let Some ( sysroot) = std:: env:: var_os ( "SYSROOT " ) {
934
+ // When we're running `cargo-miri` from `x.py` we need to pass the sysroot explicitly
935
+ // due to bootstrap complications .
936
+ if let Some ( sysroot) = std:: env:: var_os ( "MIRI_HOST_SYSROOT " ) {
935
937
cmd. arg ( "--sysroot" ) . arg ( sysroot) ;
936
938
}
937
939
}
You can’t perform that action at this time.
0 commit comments