about summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
authorStuart Cook <Zalathar@users.noreply.github.com>2024-09-13 19:38:00 +1000
committerGitHub <noreply@github.com>2024-09-13 19:38:00 +1000
commit26bda05938cddffb3bff8dba9ceb4b0192b37982 (patch)
tree8393c77db1a21a1a51f331b8903ae3470363c22e /src
parent368718961c2826a36828153662d6e64f8d7bc931 (diff)
parent654513e202dcea87724c89507ecb1b47547d4cb2 (diff)
downloadrust-26bda05938cddffb3bff8dba9ceb4b0192b37982.tar.gz
rust-26bda05938cddffb3bff8dba9ceb4b0192b37982.zip
Rollup merge of #130261 - onur-ozkan:#130242, r=Kobzol
skip target sanity check when it's a `local-rebuild`

Running the stage0 target sanity check on the newly built compiler can result in errors and incorrect assumptions.

Resolves #130242
Diffstat (limited to 'src')
-rw-r--r--src/bootstrap/src/core/sanity.rs3
-rw-r--r--src/tools/opt-dist/src/tests.rs9
2 files changed, 4 insertions, 8 deletions
diff --git a/src/bootstrap/src/core/sanity.rs b/src/bootstrap/src/core/sanity.rs
index dbc712adadf..bd21fafc999 100644
--- a/src/bootstrap/src/core/sanity.rs
+++ b/src/bootstrap/src/core/sanity.rs
@@ -233,7 +233,8 @@ than building it.
         }
 
         // Ignore fake targets that are only used for unit tests in bootstrap.
-        if cfg!(not(feature = "bootstrap-self-test")) && !skip_target_sanity {
+        if cfg!(not(feature = "bootstrap-self-test")) && !skip_target_sanity && !build.local_rebuild
+        {
             let mut has_target = false;
             let target_str = target.to_string();
 
diff --git a/src/tools/opt-dist/src/tests.rs b/src/tools/opt-dist/src/tests.rs
index 9dbba7a0500..e7a3ed787ed 100644
--- a/src/tools/opt-dist/src/tests.rs
+++ b/src/tools/opt-dist/src/tests.rs
@@ -67,6 +67,7 @@ change-id = 115898
 [build]
 rustc = "{rustc}"
 cargo = "{cargo}"
+local-rebuild = true
 
 [target.{host_triple}]
 llvm-config = "{llvm_config}"
@@ -102,13 +103,7 @@ llvm-config = "{llvm_config}"
     for test_path in env.skipped_tests() {
         args.extend(["--skip", test_path]);
     }
-    cmd(&args)
-        .env("COMPILETEST_FORCE_STAGE0", "1")
-        // Above we override the stage 0 compiler with previously compiled compiler,
-        // which can cause confusion in bootstrap's target sanity checks.
-        .env("BOOTSTRAP_SKIP_TARGET_SANITY", "1")
-        .run()
-        .context("Cannot execute tests")
+    cmd(&args).env("COMPILETEST_FORCE_STAGE0", "1").run().context("Cannot execute tests")
 }
 
 /// Tries to find the version of the dist artifacts (either nightly, beta, or 1.XY.Z).