Skip to content

Commit

Permalink
Auto merge of rust-lang#137023 - Kobzol:bump-sccache, r=marcoieni
Browse files Browse the repository at this point in the history
Bump sccache in CI to 0.9.1

We haven't updated the used sccache version for years, it has accrued a bunch of fixes and features in the meantime. It now supports the `--show-adv-stats` flag, which gives a more detailed summary of the results of caching. And it can also cache Rust code, which could be useful in the future (rust-lang#136942 - although now there are no large wins).

It also supports caching PGO now, but since the PGO profiles are always different, it won't make any real difference.

rust-lang#133076 previously tried to update the version to 0.3 (CC `@klensy)`

r? `@marcoieni`
  • Loading branch information
bors committed Feb 20, 2025
2 parents 6d3c050 + 0d0a2a3 commit eeb9035
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 5 deletions.
1 change: 1 addition & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ jobs:
HEAD_SHA: ${{ github.event.pull_request.head.sha || github.sha }}
DOCKER_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SCCACHE_BUCKET: rust-lang-ci-sccache2
SCCACHE_REGION: us-west-1
CACHE_DOMAIN: ci-caches.rust-lang.org
continue-on-error: ${{ matrix.continue_on_error || false }}
strategy:
Expand Down
10 changes: 8 additions & 2 deletions src/ci/docker/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -236,9 +236,15 @@ args=
if [ "$SCCACHE_BUCKET" != "" ]; then
args="$args --env SCCACHE_BUCKET"
args="$args --env SCCACHE_REGION"
args="$args --env AWS_ACCESS_KEY_ID"
args="$args --env AWS_SECRET_ACCESS_KEY"
args="$args --env AWS_REGION"

# Disable S3 authentication for PR builds, because the access keys are missing
if [ "$PR_CI_JOB" != "" ]; then
args="$args --env SCCACHE_S3_NO_CREDENTIALS=1"
else
args="$args --env AWS_ACCESS_KEY_ID"
args="$args --env AWS_SECRET_ACCESS_KEY"
fi
else
mkdir -p $HOME/.cache/sccache
args="$args --env SCCACHE_DIR=/sccache --volume $HOME/.cache/sccache:/sccache"
Expand Down
4 changes: 2 additions & 2 deletions src/ci/docker/scripts/sccache.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@ set -ex

case "$(uname -m)" in
x86_64)
url="https://ci-mirrors.rust-lang.org/rustc/2021-08-24-sccache-v0.2.15-x86_64-unknown-linux-musl"
url="https://ci-mirrors.rust-lang.org/rustc/2025-01-07-sccache-v0.9.1-x86_64-unknown-linux-musl"
;;
aarch64)
url="https://ci-mirrors.rust-lang.org/rustc/2021-08-25-sccache-v0.2.15-aarch64-unknown-linux-musl"
url="https://ci-mirrors.rust-lang.org/rustc/2025-01-07-sccache-v0.9.1-aarch64-unknown-linux-musl"
;;
*)
echo "unsupported architecture: $(uname -m)"
Expand Down
2 changes: 1 addition & 1 deletion src/ci/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -279,5 +279,5 @@ if [ "$RUN_CHECK_WITH_PARALLEL_QUERIES" != "" ]; then
fi

echo "::group::sccache stats"
sccache --show-stats || true
sccache --show-adv-stats || true
echo "::endgroup::"

0 comments on commit eeb9035

Please sign in to comment.