]> git.lizzy.rs Git - rust.git/commitdiff
disable sysroot checks for distributed binaries
authorRalf Jung <post@ralfj.de>
Sun, 22 Dec 2019 17:13:13 +0000 (18:13 +0100)
committerRalf Jung <post@ralfj.de>
Sun, 22 Dec 2019 17:13:13 +0000 (18:13 +0100)
src/bin/cargo-miri.rs

index f4fb13518e3053aa3ea498833074d2ced0fdaaca..e5c7228600914b059e0383ec59865095bd6dce19 100644 (file)
@@ -148,10 +148,11 @@ fn get_sysroot(mut cmd: Command) -> PathBuf {
             .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 <https://github.com/mozilla/nixpkgs-mozilla/issues/198>).
+    if option_env!("RUSTC_STAGE").is_some() {
         return;
     }