From b6e6f2bff5d4347444f8e57aae67f5c1b986c94a Mon Sep 17 00:00:00 2001 From: enricobuehler Date: Sun, 28 Jun 2026 21:47:05 +0000 Subject: [PATCH] fix(ci/apple): locate Homebrew explicitly for the cmake install MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The self-hosted macOS runner runs steps with `bash --noprofile --norc`, so Homebrew's bin dir is not on PATH — the previous `brew install cmake` died with `brew: command not found` (exit 127). Find brew at its known prefix, install cmake only if missing, and export the brew bin dir to $GITHUB_PATH so the subsequent xcframework build (audiopus_sys → vendored libopus) actually finds `cmake`. Co-Authored-By: Claude Opus 4.8 --- .gitea/workflows/apple.yml | 20 ++++++++++++++++++-- .gitea/workflows/release.yml | 10 +++++++++- 2 files changed, 27 insertions(+), 3 deletions(-) diff --git a/.gitea/workflows/apple.yml b/.gitea/workflows/apple.yml index abb4f0e..7438c2a 100644 --- a/.gitea/workflows/apple.yml +++ b/.gitea/workflows/apple.yml @@ -37,7 +37,15 @@ jobs: # system Opus — so the xcframework is self-contained (no runtime libopus.dylib on end-user Macs). # CMake must be on PATH; install it self-healing on a fresh runner. - name: CMake (for the vendored libopus audiopus_sys builds) - run: command -v cmake >/dev/null || brew install cmake + run: | + # Runner steps run with `bash --noprofile --norc`, so Homebrew's bin dir isn't on PATH — + # locate brew explicitly, install cmake if missing, and export its bin dir to GITHUB_PATH so + # the xcframework build step (audiopus_sys → vendored libopus) finds `cmake`. + for B in /opt/homebrew/bin/brew /usr/local/bin/brew; do [ -x "$B" ] && BREW="$B" && break; done + if [ -z "$BREW" ]; then echo "::error::Homebrew not found on the runner"; exit 1; fi + BREW_BIN="$(dirname "$BREW")"; export PATH="$BREW_BIN:$PATH" + command -v cmake >/dev/null || "$BREW" install cmake + echo "$BREW_BIN" >> "$GITHUB_PATH" - name: Build PunktfunkCore.xcframework run: bash scripts/build-xcframework.sh @@ -80,7 +88,15 @@ jobs: # See the swift job: audiopus_sys (via the in-core Opus decode) builds vendored libopus with CMake. - name: CMake (for the vendored libopus audiopus_sys builds) - run: command -v cmake >/dev/null || brew install cmake + run: | + # Runner steps run with `bash --noprofile --norc`, so Homebrew's bin dir isn't on PATH — + # locate brew explicitly, install cmake if missing, and export its bin dir to GITHUB_PATH so + # the xcframework build step (audiopus_sys → vendored libopus) finds `cmake`. + for B in /opt/homebrew/bin/brew /usr/local/bin/brew; do [ -x "$B" ] && BREW="$B" && break; done + if [ -z "$BREW" ]; then echo "::error::Homebrew not found on the runner"; exit 1; fi + BREW_BIN="$(dirname "$BREW")"; export PATH="$BREW_BIN:$PATH" + command -v cmake >/dev/null || "$BREW" install cmake + echo "$BREW_BIN" >> "$GITHUB_PATH" - name: Build PunktfunkCore.xcframework (mac + iOS slices) run: BUILD_IOS=1 bash scripts/build-xcframework.sh diff --git a/.gitea/workflows/release.yml b/.gitea/workflows/release.yml index a688c6d..4390cc6 100644 --- a/.gitea/workflows/release.yml +++ b/.gitea/workflows/release.yml @@ -121,7 +121,15 @@ jobs: # The in-core Opus decode (surround) pulls audiopus_sys, which builds a vendored static libopus # via CMake — keep the xcframework self-contained (no runtime libopus.dylib on end-user devices). - name: CMake (for the vendored libopus audiopus_sys builds) - run: command -v cmake >/dev/null || brew install cmake + run: | + # Runner steps run with `bash --noprofile --norc`, so Homebrew's bin dir isn't on PATH — + # locate brew explicitly, install cmake if missing, and export its bin dir to GITHUB_PATH so + # the xcframework build step (audiopus_sys → vendored libopus) finds `cmake`. + for B in /opt/homebrew/bin/brew /usr/local/bin/brew; do [ -x "$B" ] && BREW="$B" && break; done + if [ -z "$BREW" ]; then echo "::error::Homebrew not found on the runner"; exit 1; fi + BREW_BIN="$(dirname "$BREW")"; export PATH="$BREW_BIN:$PATH" + command -v cmake >/dev/null || "$BREW" install cmake + echo "$BREW_BIN" >> "$GITHUB_PATH" - name: Build PunktfunkCore.xcframework (mac + iOS + tvOS) # tvOS is a tier-3 target (nightly -Zbuild-std): slow on the first build, then cached on