From acc5588d2cc912b9bc5348ab7bb1c60afad38c4c Mon Sep 17 00:00:00 2001 From: Ettore Di Giacinto Date: Sat, 9 May 2026 20:41:03 +0000 Subject: [PATCH] ci(darwin): force-link brew formulas after cache restore MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Symptom: `ccache: command not found` in the Configure ccache step on runs that hit the brew cache. Root cause: actions/cache restores /opt/homebrew/Cellar/ but NOT the bin symlinks at /opt/homebrew/bin/*. The subsequent `brew install` sees the Cellar entries present and decides "already installed" — without re-running the link step. So on cache-hit runs none of the cached formulas are actually on PATH. Fix: explicit `brew link --overwrite` for every formula we install, right after `brew install`. --overwrite tolerates leftover symlinks from a partial earlier install. The 2>/dev/null + || true keeps the step from failing if a formula is already correctly linked. Pre-existing flake; surfaces more often as Darwin matrix coverage grows 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 | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/.github/workflows/backend_build_darwin.yml b/.github/workflows/backend_build_darwin.yml index 5a2fe32fd..29ea88b8e 100644 --- a/.github/workflows/backend_build_darwin.yml +++ b/.github/workflows/backend_build_darwin.yml @@ -101,6 +101,12 @@ jobs: # 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 + # 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 - name: Save Homebrew cache if: github.event_name != 'pull_request' && steps.brew-cache.outputs.cache-hit != 'true'