From 041b59eb626661d39984bc3c25a148793147fef6 Mon Sep 17 00:00:00 2001 From: onur-ozkan Date: Thu, 12 Sep 2024 08:31:19 +0300 Subject: [PATCH 1/3] 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. Signed-off-by: onur-ozkan --- src/bootstrap/src/core/sanity.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/bootstrap/src/core/sanity.rs b/src/bootstrap/src/core/sanity.rs index dbc712adadf3e..bd21fafc999be 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(); From 654513e202dcea87724c89507ecb1b47547d4cb2 Mon Sep 17 00:00:00 2001 From: onur-ozkan Date: Thu, 12 Sep 2024 08:38:26 +0300 Subject: [PATCH 2/3] use `local-rebuild` instead of `BOOTSTRAP_SKIP_TARGET_SANITY` workaround Signed-off-by: onur-ozkan --- src/tools/opt-dist/src/tests.rs | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/src/tools/opt-dist/src/tests.rs b/src/tools/opt-dist/src/tests.rs index 9dbba7a05001d..e7a3ed787ed7c 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). From 98e34066a60d0e87f637af412da0260585fb4c40 Mon Sep 17 00:00:00 2001 From: onur-ozkan Date: Thu, 12 Sep 2024 20:05:33 +0300 Subject: [PATCH 3/3] test Signed-off-by: onur-ozkan --- src/ci/github-actions/jobs.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/ci/github-actions/jobs.yml b/src/ci/github-actions/jobs.yml index 41d3b311749d3..1d44a5ee28256 100644 --- a/src/ci/github-actions/jobs.yml +++ b/src/ci/github-actions/jobs.yml @@ -68,7 +68,7 @@ envs: # - not running `opt-dist`'s post-optimization smoke tests on the resulting toolchain # # If you *want* these to happen however, temporarily uncomment it before triggering a try build. - DIST_TRY_BUILD: 1 + # DIST_TRY_BUILD: 1 auto: <<: *production