Skip to content

Make the CI caches smaller - #427

Merged
mattt merged 3 commits into
mainfrom
mattt/shrink-ci-caches
Nov 18, 2026
Merged

mattt merged 3 commits into
mainfrom
mattt/shrink-ci-caches

Conversation

@mattt

@mattt mattt commented Nov 18, 2026

Copy link
Copy Markdown
Collaborator

This PR cuts a full set of CI caches from 9.9 GB to about 6 GB, projected from local measurements. One set almost filled the repository's 10 GB limit, so when Package.swift or Package.resolved changed, the old set and the new set competed for the space, and jobs missed the cache until main had saved the new set. About 40 percent of a set was data that a cached build doesn't read: the 835 MB Metal toolchain download, SwiftPM's shared cache on Linux (which repeats .build/repositories), and, on macOS, the Git repositories in .build/repositories and the index store.

The Swift 6.4 jobs now download the Metal toolchain in each run; in recent runs that took 5 to 7 seconds, against 13 to 23 seconds to restore it from the cache. All SwiftPM caches now hold only .build, the macOS caches also leave out .build/repositories, and the macOS jobs build and test with --disable-index-store. The Linux jobs keep their repositories and index store, because SwiftPM fetches the repositories again on Linux when they're missing and test discovery on Linux reads the index store. The cache keys change from -spm- to -build-, so the first push to main after this saves a new set, and the old entries are no longer read and are evicted.

@mattt
mattt merged commit 8d8d59d into main Nov 18, 2026
14 checks passed
@mattt
mattt deleted the mattt/shrink-ci-caches branch November 18, 2026 12:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant