Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 16 additions & 2 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,18 @@ jobs:
run: |
brew install ninja zlib libzip protobuf abseil

# The cached CMakeCache.txt/build.ninja bake in version-pinned Homebrew
# Cellar paths (e.g. -L/opt/homebrew/Cellar/protobuf/<ver>/lib) that
# pkg-config emits at configure time. 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 "library 'protobuf'
# not found". Key the cache on the installed dep versions so a bump
# invalidates the stale configure instead of resurrecting dead paths.
- name: Resolve dependency versions for cache key
id: depvers
run: |
echo "vers=$(brew list --versions protobuf abseil | tr ' ' '-' | paste -sd '_' -)" >> "$GITHUB_OUTPUT"

- name: Cache CMake build
uses: actions/cache@v4
with:
Expand All @@ -119,9 +131,11 @@ jobs:
cpp/build.ninja
cpp/.ninja_deps
cpp/.ninja_log
key: ${{ runner.os }}-cmake-metal-${{ hashFiles('**/CMakeLists.txt') }}
key: ${{ runner.os }}-cmake-metal-${{ steps.depvers.outputs.vers }}-${{ hashFiles('**/CMakeLists.txt') }}
# Scoped to the same dep versions: never restore a cache built against
# a different protobuf/abseil (its baked-in Cellar paths would be stale).
restore-keys: |
${{ runner.os }}-cmake-metal-
${{ runner.os }}-cmake-metal-${{ steps.depvers.outputs.vers }}-

- name: Configure CMake
working-directory: cpp
Expand Down
Loading