Skip to content

Commit 7113e5e

Browse files
committed
Use download-rustc = "if-unchanged" in PR CI
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.
1 parent 64698bf commit 7113e5e

File tree

4 files changed

+7
-0
lines changed

4 files changed

+7
-0
lines changed

.github/workflows/ci.yml

+1
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ jobs:
3636
actions: write
3737
name: "PR - ${{ matrix.name }}"
3838
env:
39+
DOWNLOAD_RUSTC: 1
3940
CI_JOB_NAME: "${{ matrix.name }}"
4041
CARGO_REGISTRIES_CRATES_IO_PROTOCOL: sparse
4142
SCCACHE_BUCKET: rust-lang-ci-sccache2

src/ci/docker/run.sh

+1
Original file line numberDiff line numberDiff line change
@@ -254,6 +254,7 @@ docker \
254254
--env DEPLOY \
255255
--env DEPLOY_ALT \
256256
--env CI \
257+
--env DOWNLOAD_RUSTC \
257258
--env TF_BUILD \
258259
--env BUILD_SOURCEBRANCHNAME \
259260
--env GITHUB_ACTIONS \

src/ci/github-actions/ci.yml

+1
Original file line numberDiff line numberDiff line change
@@ -296,6 +296,7 @@ jobs:
296296
<<: *base-ci-job
297297
name: PR - ${{ matrix.name }}
298298
env:
299+
DOWNLOAD_RUSTC: 1
299300
<<: [*shared-ci-variables, *public-variables]
300301
if: github.event_name == 'pull_request'
301302
continue-on-error: ${{ matrix.name == 'mingw-check-tidy' }}

src/ci/run.sh

+4
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,10 @@ if [ "$DIST_SRC" = "" ]; then
8383
RUST_CONFIGURE_ARGS="$RUST_CONFIGURE_ARGS --disable-dist-src"
8484
fi
8585

86+
if [ "$DOWNLOAD_RUSTC" = 1 ]; then
87+
RUST_CONFIGURE_ARGS="$RUST_CONFIGURE_ARGS --set rust.download-rustc=if-unchanged"
88+
fi
89+
8690
# Always set the release channel for bootstrap; this is normally not important (i.e., only dist
8791
# builds would seem to matter) but in practice bootstrap wants to know whether we're targeting
8892
# master, beta, or stable with a build to determine whether to run some checks (notably toolstate).

0 commit comments

Comments
 (0)