Repository navigation
fix: key melange cache by cargo profile - #68
Merged
falcorocks merged 1 commit intoOct 9, 2026
Merged
Conversation
The melange cache key hashed only the lockfiles, so caches saved by default-branch maxperf builds were restored by fast-build PR builds as an exact hit. Nothing in a maxperf target/ is reusable under fast-build, so PRs paid the multi-GB restore and then recompiled every crate (2002 crates on optimism's op-stack-rust leg). Include the cargo profile in both the key and the restore-keys prefix, terminated with '.' so one profile's prefix never matches another's. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
falcorocks
approved these changes
Oct 9, 2026
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.
Problem
melange-build.yamlkeys the GHA cache onmelange-v2-<stack>-<arch>-<lockfile hash>. The cargo profile isn't part of the key. Inoptimism, theop-stack-rustleg buildsmaxperfon develop/tags (the only runs that save) andfast-buildon PRs (restore-only). So every internal PR restores the multi-GBmaxperfcache as an exact hit (cache-hit=true) and then reuses nothing:Change
restore-keysprefix:melange-v2-<stack>-<arch>-<profile>.<lockfile hash>. Callers with no profile getnone..rather than-..can't appear in a cargo profile name, so…-release.never prefix-matches…-release-perf.….Effect / caveats
optimismbuildsfast-buildtoday, so nothing writes afast-buildcache. That needs a consumer-side change: a default-branch leg that builds the PR profile. It's tracked separately because it costs runner time and Actions cache space (the repo already holds ~9 GB of melange cache).melange-v2-*entries age out unused.Testing
maxperf,fast-build,release,release-perfand empty: distinct keys, no cross-profile prefix match.🤖 Generated with Claude Code