Repository navigation
release.yml: a compile cache for release builds (sccache on R2) - #138
Merged
Merged
Conversation
…ket (raea-build-cache), so a candidate after a small change compiles only what changed instead of three cold hours. GitHub's own cache can't carry it: a tag's run reads only its own tag's caches and the default branch's, so rc3's would never reach rc4, and the repo's 10 GB are CI's. tools/release/compile-cache.sh turns it on when the job has the bucket's key (secrets RELEASE_CACHE_ENDPOINT, RELEASE_CACHE_KEY_ID, RELEASE_CACHE_SECRET), each OS and architecture under its own prefix, C and C++ in build scripts through cc-rs and CMake's launchers; when the bucket can't be reached or written the build runs uncached, as before. Each cargo call's minutes are a notice on the run, and sccache's hits and misses are printed after the build. Linking (thin LTO) and build scripts' runs aren't cached
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
A release candidate's build compiles everything cold, about three hours on the Mac (0.1.2's rc5 took 3h04m), even after a one-line change. This adds a compile cache so a candidate compiles only the crates that changed and the ones above them.
Why R2 and not GitHub's cache. A tag's run can read only its own tag's caches and the default branch's, so rc3's cache would never reach rc4. The repo's 10 GB of Actions cache is also already full with CI's (15.6 GB active).
What it does
Not cached: thin-LTO linking and build scripts' runs. How much of the 3 hours they are is what the first warm run will show.
Set up (11-13): the bucket raea-build-cache (raea's Cloudflare account, a 45-day expiry) and an account token scoped to that bucket only (Workers R2 Storage Bucket Item Read and Write), as the secrets RELEASE_CACHE_ENDPOINT, RELEASE_CACHE_KEY_ID and RELEASE_CACHE_SECRET. Checked from the Mac through sccache 0.19: the server starts on the bucket, a release-profile build writes its entries, no write errors.
Proof after merge: a dry run (workflow_dispatch, dry_run, a tag, no promote) fills the cache; a second one with the cache warm gives the numbers.