From ec0df9128303900116028024aed52b1e11df777a Mon Sep 17 00:00:00 2001 From: pasta Date: Sun, 1 Nov 2026 03:35:40 +0000 Subject: [PATCH] ci: cap ccache at 300M and evict entries unused for a day Each develop push saved ~4.5 GB of ccache (10 targets at up to the 600M cap), most of it objects from older commits that no build hits anymore. Overlapping develop runs pushed the repository past GitHub's 10 GB cache limit, and LRU eviction then dropped fresh depends entries that PR runs had already been told were present. One build's working set is 0.1-0.25 GB per target (cold v24.0.x builds and freshly reset develop entries), so 300M still holds it. Hits refresh mtime, so evicting anything older than a day keeps exactly what recent builds used. The thrash that motivated the 600M bump (#7059) predates the remote ccache, which now serves objects evicted mid-build. Co-Authored-By: Claude Opus 5.5 --- .github/workflows/build-src.yml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build-src.yml b/.github/workflows/build-src.yml index bea05051f72a..2e72d4043bbd 100644 --- a/.github/workflows/build-src.yml +++ b/.github/workflows/build-src.yml @@ -171,13 +171,16 @@ jobs: # tests run code built from cached objects; drop the credential even # if the compile fails. trap 'rm -f "${RUNNER_TEMP}/ccache-netrc"' EXIT - CCACHE_MAXSIZE="600M" + CCACHE_MAXSIZE="300M" CACHE_DIR="/cache" mkdir /output BASE_OUTDIR="/output" source ./ci/dash/matrix.sh ./ci/dash/build_src.sh { echo "### ccache: ${BUILD_TARGET}"; echo '```'; ccache --show-stats; echo '```'; } >> "${GITHUB_STEP_SUMMARY}" + # Hits refresh mtime, so this keeps only what recent builds used + # and the saved cache stays near one build's working set. + ccache --evict-older-than 1d ccache -c du -hd0 "${BASE_OUTDIR}" rm -rf "${BASE_OUTDIR}"