From 3f6e493439469f7b505bdc308bd33dca9b951ec4 Mon Sep 17 00:00:00 2001 From: Ettore Di Giacinto Date: Sun, 10 May 2026 17:08:52 +0000 Subject: [PATCH] ci(darwin): install ccache's runtime dylib deps (blake3, hiredis, xxhash, zstd) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Symptom (run 25634195866, job 75244019809): the Configure ccache step on the Darwin llama-cpp build aborted with: dyld[5647]: Library not loaded: /opt/homebrew/opt/blake3/lib/libblake3.0.dylib Referenced from: /opt/homebrew/Cellar/ccache/4.13.5/bin/ccache Abort trap: 6 The previous Darwin fix (acc5588d) addressed missing /opt/homebrew/bin symlinks after a brew cache restore by force-linking. This is a different layer: ccache's Cellar dir IS restored from cache and IS linked, but ccache 4.13 dynamically links against blake3 / hiredis / xxhash / zstd at runtime, and those dependencies are NOT in the restored Cellar paths. brew install ccache sees the ccache Cellar present and skips the install — including skipping installation of those transitive deps. Two-part fix: - Add /opt/homebrew/Cellar/{blake3,hiredis,xxhash,zstd} to the brew cache restore/save paths so future cache-hit runs restore them. - Explicitly install + link them in the Dependencies step so even a fresh runner (cache miss on a new key) gets them, and brew has them on hand for ccache to dlopen. Caught by run 25634195866. Pre-existing condition on Darwin runners; surfaced because Darwin builds run more often after the llama-cpp- darwin consolidation in #9731. Assisted-by: Claude:claude-opus-4-7 Signed-off-by: Ettore Di Giacinto --- .github/workflows/backend_build_darwin.yml | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/.github/workflows/backend_build_darwin.yml b/.github/workflows/backend_build_darwin.yml index 29ea88b8e..217e82903 100644 --- a/.github/workflows/backend_build_darwin.yml +++ b/.github/workflows/backend_build_darwin.yml @@ -93,6 +93,10 @@ jobs: /opt/homebrew/Cellar/libomp /opt/homebrew/Cellar/llvm /opt/homebrew/Cellar/ccache + /opt/homebrew/Cellar/blake3 + /opt/homebrew/Cellar/hiredis + /opt/homebrew/Cellar/xxhash + /opt/homebrew/Cellar/zstd key: brew-${{ runner.os }}-${{ runner.arch }}-v1-${{ hashFiles('.github/workflows/backend_build_darwin.yml') }} - name: Dependencies @@ -100,13 +104,18 @@ jobs: # ccache is always installed (used by the llama-cpp variant build) so # the brew cache content stays stable across every backend in the # matrix — they all share one cache key. - brew install protobuf grpc make protoc-gen-go protoc-gen-go-grpc libomp llvm ccache + # blake3, hiredis, xxhash, zstd are ccache's runtime dylib deps. + # Without explicitly installing them, a brew cache-hit run restores + # ccache's Cellar dir but skips installing those transitive deps, + # and ccache fails at runtime with `dyld: Library not loaded: + # libblake3.0.dylib`. + brew install protobuf grpc make protoc-gen-go protoc-gen-go-grpc libomp llvm ccache blake3 hiredis xxhash zstd # The brew cache restores the Cellar dirs but NOT the bin symlinks # at /opt/homebrew/bin/*. brew install above sees the Cellar present # and decides "already installed" without re-linking, so on a cache- # hit run the formulas aren't on PATH. Force-link them; --overwrite # tolerates pre-existing symlinks from earlier installs. - brew link --overwrite protobuf grpc make protoc-gen-go protoc-gen-go-grpc libomp llvm ccache 2>/dev/null || true + brew link --overwrite protobuf grpc make protoc-gen-go protoc-gen-go-grpc libomp llvm ccache blake3 hiredis xxhash zstd 2>/dev/null || true - name: Save Homebrew cache if: github.event_name != 'pull_request' && steps.brew-cache.outputs.cache-hit != 'true' @@ -121,6 +130,10 @@ jobs: /opt/homebrew/Cellar/libomp /opt/homebrew/Cellar/llvm /opt/homebrew/Cellar/ccache + /opt/homebrew/Cellar/blake3 + /opt/homebrew/Cellar/hiredis + /opt/homebrew/Cellar/xxhash + /opt/homebrew/Cellar/zstd key: brew-${{ runner.os }}-${{ runner.arch }}-v1-${{ hashFiles('.github/workflows/backend_build_darwin.yml') }} # ---- ccache for llama.cpp CMake builds ----