Skip to content

Commit

Permalink
Auto merge of #130261 - onur-ozkan:#130242, r=<try>
Browse files Browse the repository at this point in the history
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

try-job: dist-x86_64-linux
  • Loading branch information
bors committed Sep 12, 2024
2 parents 394c406 + 98e3406 commit f9a4006
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 9 deletions.
3 changes: 2 additions & 1 deletion src/bootstrap/src/core/sanity.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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();

Expand Down
2 changes: 1 addition & 1 deletion src/ci/github-actions/jobs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
9 changes: 2 additions & 7 deletions src/tools/opt-dist/src/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ change-id = 115898
[build]
rustc = "{rustc}"
cargo = "{cargo}"
local-rebuild = true
[target.{host_triple}]
llvm-config = "{llvm_config}"
Expand Down Expand Up @@ -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).
Expand Down

0 comments on commit f9a4006

Please sign in to comment.