Skip to content

Commit

Permalink
Use download-rustc = "if-unchanged" in PR CI and x86_64-gnu
Browse files Browse the repository at this point in the history
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
   rust-lang/compiler-team#619 land, this will also be faster for changes to
   library/, and only changes to compiler/ will have to rebuild.
  • Loading branch information
jyn514 committed Jul 9, 2023
1 parent b80c2f8 commit a6dcffa
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 1 deletion.
4 changes: 3 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions src/ci/docker/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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 \
Expand Down
3 changes: 3 additions & 0 deletions src/ci/github-actions/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down Expand Up @@ -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
Expand Down
4 changes: 4 additions & 0 deletions src/ci/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit a6dcffa

Please sign in to comment.