From bc715cb6469015012a3d77dbd84a648c9380873e Mon Sep 17 00:00:00 2001 From: Ralf Jung Date: Sun, 22 Dec 2019 18:13:13 +0100 Subject: [PATCH] disable sysroot checks for distributed binaries --- src/bin/cargo-miri.rs | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/bin/cargo-miri.rs b/src/bin/cargo-miri.rs index f4fb13518e30..e5c722860091 100644 --- a/src/bin/cargo-miri.rs +++ b/src/bin/cargo-miri.rs @@ -148,10 +148,11 @@ fn test_sysroot_consistency() { .unwrap_or_else(|_| panic!("Failed to canonicalize sysroot: {}", stdout)) } - // We let the user skip this check if they really want to. - // (`bootstrap` needs this because Miri gets built by the stage1 compiler - // but run with the stage2 sysroot.) - if std::env::var("MIRI_SKIP_SYSROOT_CHECK").is_ok() { + // Do not check sysroots if we got built as part of a Rust distribution. + // During `bootstrap`, the sysroot does not match anyway, and then some distros + // play symlink tricks so the sysroots may be different even for the final stage + // (see ). + if option_env!("RUSTC_STAGE").is_some() { return; }