Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions .github/workflows/nightly.yml
Original file line number Diff line number Diff line change
Expand Up @@ -447,13 +447,17 @@ jobs:

- name: Restore test compilation cache
id: compilation-cache-restore
# Exact key only, so the seed is always one clean build. Restoring the
# last seed by prefix stacked another build's objects onto the CAS every
# run: the primary generation and the upstream it faults from grew 3.5 ->
# 5.0 GiB over eight runs, crossed the bound below, and then no run could
# save again. A cold build covers all of main, and measured smaller and
# faster than a stacked one. Only a re-run of the same revision hits here.
uses: ./.github/actions/cache-restore
with:
backend: ${{ inputs.cache_backend != 'default' && inputs.cache_backend || vars.CI_CACHE_BACKEND || 'r2' }}
path: ${{ env.CMUX_COMPILE_ADMISSION_CAS }}
key: xcode-compilation-test-${{ runner.os }}-${{ runner.arch }}-${{ steps.compilation-cache-key.outputs.fingerprint }}-${{ needs.decide.outputs.head_sha }}
restore-keys: |
xcode-compilation-test-${{ runner.os }}-${{ runner.arch }}-${{ steps.compilation-cache-key.outputs.fingerprint }}-

- name: Install compilation dependencies
if: steps.compilation-cache-restore.outputs.cache-hit != 'true'
Expand Down
32 changes: 32 additions & 0 deletions tests/test_ci_test_compilation_cache_seed.sh
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,38 @@ if ! awk '
fi
echo "PASS: the seeder rolls the cache forward by main revision and bounds what it saves"

# The seed must come from one clean build. The seeder used to restore its own
# last seed by prefix, so each run stacked another build's objects onto the
# CAS; Xcode keeps the primary generation and the upstream it faults from, and
# that pair crossed the 5 GiB save bound on 2026-09-22 after climbing 3.5 -> 5.0
# GiB in eight runs. Past the bound nothing is saved, so the next run restores
# the same older entry and lands past it again and the seed freezes for good.
# A cold build covers all of main anyway, and it measured smaller (3.5 GiB) and
# faster (18 min, against 19-25 warm) than a stacked one.
if awk '
/^ - name: / { step = $0 }
step ~ /Restore test compilation cache/ && /^[[:space:]]+restore-keys:/ { found = 1 }
END { exit !found }
' <<<"$SEEDER"; then
echo "FAIL: refresh-test-compilation-cache must not restore an earlier seed by prefix:"
echo " stacking builds onto one CAS grows it past the save bound, and then the seed freezes."
exit 1
fi
echo "PASS: the seeder seeds from one clean build"

# Admission is the opposite case and must keep its fallback: its exact key
# names a base revision no seeder run built, so the prefix is the only way a
# pull request ever finds the seed.
if ! awk '
/^ - name: / { step = $0 }
step ~ /Restore test compilation cache/ && /^[[:space:]]+restore-keys:/ { found = 1 }
END { exit !found }
' <<<"$ADMISSION"; then
echo "FAIL: macos-compile-admission must restore the seed by prefix, or it can never find one"
exit 1
fi
echo "PASS: pull requests find the seed by prefix"

if ! grep -Eq "if: github\.event_name == 'schedule'" <<<"$SEEDER"; then
echo "FAIL: refresh-test-compilation-cache must stay on the cache-warming schedule so it does not take a macOS slot per merge"
exit 1
Expand Down
Loading