ci: add runs-on to vcpkg cache key to prevent macOS version cache thrashing#7604
Merged
Merged
Conversation
…ashing macos-15 and macos-26 jobs share the same runner.os/runner.arch/triplet combination, causing cache-key collisions. The first to finish populates the cache with SDK-specific binaries that the other rejects, forcing a full vcpkg rebuild from source on every run. Include matrix.runs-on in the key so macos-15-x64, macos-26-x64 (and the arm64 equivalents) each get their own bincache.
Contributor
There was a problem hiding this comment.
Pull request overview
This PR fixes GitHub Actions vcpkg binary cache collisions between different macOS runner images (e.g., macos-15 vs macos-26) by adding the workflow’s matrix.runs-on value to the vcpkg cache key. This prevents incompatible SDK-built binaries from overwriting each other and triggering repeated full rebuilds.
Changes:
- Include
${{ matrix.runs-on }}in the vcpkg cachekeyto differentiate caches per runner image. - Include
${{ matrix.runs-on }}inrestore-keysto avoid restoring an incompatible cache from a different macOS runner image.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #7604 +/- ##
=======================================
Coverage 94.12% 94.12%
=======================================
Files 482 482
Lines 37420 37420
=======================================
+ Hits 35221 35223 +2
+ Misses 2199 2197 -2 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
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.
macos-15 and macos-26 jobs share the same runner.os/runner.arch/triplet combination, causing cache-key collisions. The first to finish populates the cache with SDK-specific binaries that the other rejects, forcing a full vcpkg rebuild from source on every run. Include matrix.runs-on in the key so macos-15-x64, macos-26-x64 (and the arm64 equivalents) each get their own bincache.