Skip to content

Commit

Permalink
Use download-rustc = "if-unchanged" in PR CI
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 Jun 7, 2023
1 parent 64698bf commit 7113e5e
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 0 deletions.
1 change: 1 addition & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ jobs:
actions: write
name: "PR - ${{ matrix.name }}"
env:
DOWNLOAD_RUSTC: 1
CI_JOB_NAME: "${{ matrix.name }}"
CARGO_REGISTRIES_CRATES_IO_PROTOCOL: sparse
SCCACHE_BUCKET: rust-lang-ci-sccache2
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 TF_BUILD \
--env BUILD_SOURCEBRANCHNAME \
--env GITHUB_ACTIONS \
Expand Down
1 change: 1 addition & 0 deletions src/ci/github-actions/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -296,6 +296,7 @@ jobs:
<<: *base-ci-job
name: PR - ${{ matrix.name }}
env:
DOWNLOAD_RUSTC: 1
<<: [*shared-ci-variables, *public-variables]
if: github.event_name == 'pull_request'
continue-on-error: ${{ matrix.name == 'mingw-check-tidy' }}
Expand Down
4 changes: 4 additions & 0 deletions src/ci/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,10 @@ if [ "$DIST_SRC" = "" ]; then
RUST_CONFIGURE_ARGS="$RUST_CONFIGURE_ARGS --disable-dist-src"
fi

if [ "$DOWNLOAD_RUSTC" = 1 ]; then
RUST_CONFIGURE_ARGS="$RUST_CONFIGURE_ARGS --set rust.download-rustc=if-unchanged"
fi

# Always set the release channel for bootstrap; this is normally not important (i.e., only dist
# builds would seem to matter) but in practice bootstrap wants to know whether we're targeting
# master, beta, or stable with a build to determine whether to run some checks (notably toolstate).
Expand Down

0 comments on commit 7113e5e

Please sign in to comment.