From 29474acf2ea6ea038df9dd35e627bcd5b2ff3df6 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 2d7e03d1f007d..e2d94b0256157 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -38,6 +38,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 @@ -277,8 +278,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 cedbc0390f8ff..8d1198614aa40 100755 --- a/src/ci/docker/run.sh +++ b/src/ci/docker/run.sh @@ -290,6 +290,7 @@ docker \ --env DEPLOY \ --env DEPLOY_ALT \ --env CI \ + --env DOWNLOAD_RUSTC \ --env GITHUB_ACTIONS \ --env GITHUB_REF \ --env GITHUB_STEP_SUMMARY="/checkout/obj/${SUMMARY_FILE}" \ diff --git a/src/ci/github-actions/ci.yml b/src/ci/github-actions/ci.yml index 2c21fa5493533..141d1bcd2e9f3 100644 --- a/src/ci/github-actions/ci.yml +++ b/src/ci/github-actions/ci.yml @@ -321,6 +321,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' @@ -450,6 +451,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 ce0dd6018af82..dcfea67569ee4 100755 --- a/src/ci/run.sh +++ b/src/ci/run.sh @@ -124,6 +124,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" # When running gcc backend tests, we need to install `libgccjit` and to not run llvm codegen