From a6dcffa220035bb2d368db657891cea55898f3f6 Mon Sep 17 00:00:00 2001 From: jyn Date: Wed, 31 May 2023 10:51:22 -0500 Subject: [PATCH] Use `download-rustc = "if-unchanged"` in PR CI and `x86_64-gnu` This has two main benefits: 1. It tests that download-rustc doesn't regress. This doesn't reduce our test coverage, since we still never use `download-rustc` in a full bors merge, but it should make it a lot less likely that this breaks by accident. 2. It greatly speeds up CI when compiler/ and library/ haven't been modified. Once the changes in https://github.com/rust-lang/compiler-team/issues/619 land, this will also be faster for changes to library/, and only changes to compiler/ will have to rebuild. --- .github/workflows/ci.yml | 4 +++- src/ci/docker/run.sh | 1 + src/ci/github-actions/ci.yml | 3 +++ src/ci/run.sh | 4 ++++ 4 files changed, 11 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 6b5d3dabef743..cd255e237adb1 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -37,6 +37,7 @@ jobs: pr: name: "PR - ${{ matrix.name }}" env: + DOWNLOAD_RUSTC: 1 PR_CI_JOB: 1 CI_JOB_NAME: "${{ matrix.name }}" CARGO_REGISTRIES_CRATES_IO_PROTOCOL: sparse @@ -268,8 +269,9 @@ jobs: os: ubuntu-20.04-8core-32gb env: {} - name: x86_64-gnu + env: + DOWNLOAD_RUSTC: 1 os: ubuntu-20.04-4core-16gb - env: {} - name: x86_64-gnu-stable env: IMAGE: x86_64-gnu diff --git a/src/ci/docker/run.sh b/src/ci/docker/run.sh index 4b218d5772769..f67e4fe57508e 100755 --- a/src/ci/docker/run.sh +++ b/src/ci/docker/run.sh @@ -254,6 +254,7 @@ docker \ --env DEPLOY \ --env DEPLOY_ALT \ --env CI \ + --env DOWNLOAD_RUSTC \ --env GITHUB_ACTIONS \ --env GITHUB_REF \ --env TOOLSTATE_REPO_ACCESS_TOKEN \ diff --git a/src/ci/github-actions/ci.yml b/src/ci/github-actions/ci.yml index f87e2f3745841..362a9ae89ed67 100644 --- a/src/ci/github-actions/ci.yml +++ b/src/ci/github-actions/ci.yml @@ -310,6 +310,7 @@ jobs: <<: *base-ci-job name: PR - ${{ matrix.name }} env: + DOWNLOAD_RUSTC: 1 <<: [*shared-ci-variables, *public-variables] PR_CI_JOB: 1 if: github.event_name == 'pull_request' @@ -433,6 +434,8 @@ jobs: <<: *job-linux-8c - name: x86_64-gnu + env: + DOWNLOAD_RUSTC: 1 <<: *job-linux-4c # This job ensures commits landing on nightly still pass the full diff --git a/src/ci/run.sh b/src/ci/run.sh index 48fb40d6a6dd8..803e13bd9817e 100755 --- a/src/ci/run.sh +++ b/src/ci/run.sh @@ -121,6 +121,10 @@ else RUST_CONFIGURE_ARGS="$RUST_CONFIGURE_ARGS --enable-llvm-assertions" fi + if [ "$DOWNLOAD_RUSTC" = 1 ]; then + RUST_CONFIGURE_ARGS="$RUST_CONFIGURE_ARGS --set rust.download-rustc=if-unchanged" + fi + RUST_CONFIGURE_ARGS="$RUST_CONFIGURE_ARGS --set rust.verify-llvm-ir" # We enable this for non-dist builders, since those aren't trying to produce