Skip to content

CI: key macOS-metal CMake cache on Homebrew dependency versions#1204

Open
ChinChangYang wants to merge 1 commit into
lightvector:masterfrom
ChinChangYang:ci/macos-metal-cache-key
Open

CI: key macOS-metal CMake cache on Homebrew dependency versions#1204
ChinChangYang wants to merge 1 commit into
lightvector:masterfrom
ChinChangYang:ci/macos-metal-cache-key

Conversation

@ChinChangYang
Copy link
Copy Markdown
Contributor

Summary

Split out from #1202 as a standalone, orthogonal CI fix.

The build-macos-metal job caches CMakeCache.txt/build.ninja keyed only on CMakeLists.txt hashes. Those cached files bake in version-pinned Homebrew Cellar paths emitted by pkg-config at configure time (e.g. -L/opt/homebrew/Cellar/protobuf/<ver>/lib). When Homebrew bumps protobuf/abseil, those paths vanish, and an incremental cmake . does not refresh the cached pkg-config vars — so the re-link fails with ld: library 'protobuf' not found.

Fix

  • Resolve the installed protobuf/abseil versions into a depvers step output.
  • Include those versions in the cache key and scope restore-keys to them, so a dependency bump invalidates the stale configure and forces a fresh pkg-config resolution instead of resurrecting dead Cellar paths.

Touches only .github/workflows/build.yml.

🤖 Generated with Claude Code

The build-macos-metal job cached CMakeCache.txt/build.ninja keyed only on
CMakeLists.txt hashes. Those cached files bake in version-pinned Homebrew
Cellar paths from pkg-config (e.g. -L/opt/homebrew/Cellar/protobuf/<ver>/lib).
When Homebrew bumps protobuf/abseil, those paths vanish; an incremental
`cmake .` does not refresh the cached pkg-config vars, so the re-link fails
with "ld: library 'protobuf' not found".

Include the installed protobuf/abseil versions in the cache key and scope
restore-keys to those versions, so a dependency bump invalidates the stale
configure and forces a fresh pkg-config resolution instead of resurrecting
dead Cellar paths.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@ChinChangYang
Copy link
Copy Markdown
Contributor Author

I reviewed and approved this PR.

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