From 9a9593c5ccb373f1a8971afc9eee1d7845c88941 Mon Sep 17 00:00:00 2001 From: Jonathan Mohrbacher Date: Fri, 20 Nov 2026 11:30:28 -0500 Subject: [PATCH] [NO-JIRA] Build the darwin CLI without Homebrew OpenSSL The first darwin backfill failed: on the macos-26 runner image, llama.cpp's vendored cpp-httplib found Homebrew's OpenSSL, which no longer compiles there (const X509_NAME) and would have made the binary depend on Homebrew's libssl. Upstream's darwin binaries link no OpenSSL. patched-build-macos.yml is upstream's bundle-macos.yml CLI build with CMAKE_DISABLE_FIND_PACKAGE_OpenSSL=ON (llama-cpp-sys-2 forwards CMAKE_* env to CMake) and a check that the binary links only system libraries. Both release workflows use it. --- .github/workflows/patched-build-macos.yml | 79 ++++++++++++++++++++ .github/workflows/patched-release-darwin.yml | 6 +- .github/workflows/patched-release.yml | 8 +- 3 files changed, 82 insertions(+), 11 deletions(-) create mode 100644 .github/workflows/patched-build-macos.yml diff --git a/.github/workflows/patched-build-macos.yml b/.github/workflows/patched-build-macos.yml new file mode 100644 index 000000000000..888c4aee8ff0 --- /dev/null +++ b/.github/workflows/patched-build-macos.yml @@ -0,0 +1,79 @@ +# The aarch64-apple-darwin CLI for this fork's releases (patched-release.yml and +# patched-release-darwin.yml). It is upstream's bundle-macos.yml build-goose + +# package-cli steps (same toolchain via hermit, default features, unsigned, +# same tarball layout), with two differences: +# +# 1. CMAKE_DISABLE_FIND_PACKAGE_OpenSSL=ON. llama-cpp-sys-2 passes CMAKE_* env +# through to llama.cpp's CMake, whose vendored cpp-httplib otherwise links any +# OpenSSL it finds. On current macOS runner images that is Homebrew's, which +# (a) no longer compiles there (const X509_NAME) and (b) would make the binary +# need Homebrew's libssl at runtime. Upstream's own darwin binaries link no +# OpenSSL, so this keeps the same shape. +# 2. A portability check: the binary may link only system libraries. +on: + workflow_call: + inputs: + ref: + description: "Commit to build" + required: true + type: string + +name: "Patched build (macOS CLI)" + +permissions: + contents: read + +jobs: + build: + name: Build goose (aarch64-apple-darwin) + runs-on: macos-latest + env: + MACOSX_DEPLOYMENT_TARGET: "12.0" + CMAKE_DISABLE_FIND_PACKAGE_OpenSSL: "ON" + TARGET: aarch64-apple-darwin + steps: + - name: Checkout code + uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 + with: + ref: ${{ inputs.ref }} + + - name: Cache Rust dependencies + uses: Swatinem/rust-cache@6323deb102c322ba6fcbdcafc7e3dddab59af2b6 # v2.9.2 + with: + key: patched-macos-deployment-target-12 + + - name: Build goose + run: | + source ./bin/activate-hermit + rustup target add "$TARGET" + cargo build --release -p goose-cli --bin goose --target "$TARGET" + + - name: Links only system libraries + run: | + bin="target/${TARGET}/release/goose" + otool -L "$bin" + bad="$(otool -L "$bin" | tail -n +2 | awk '{print $1}' | grep -Ev '^(/usr/lib/|/System/Library/)' || true)" + if [ -n "$bad" ]; then + echo "goose links non-system libraries:" >&2 + echo "$bad" >&2 + exit 1 + fi + "$bin" --version + + - name: Package CLI + run: | + mkdir -p package dist + cp "target/${TARGET}/release/goose" package/goose + chmod +x package/goose + tar -cjf "dist/goose-${TARGET}.tar.bz2" -C package . + tar -czf "dist/goose-${TARGET}.tar.gz" -C package . + + - name: Upload CLI artifact + uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 + with: + name: goose-aarch64-apple-darwin + path: | + dist/goose-aarch64-apple-darwin.tar.bz2 + dist/goose-aarch64-apple-darwin.tar.gz + if-no-files-found: error + overwrite: true diff --git a/.github/workflows/patched-release-darwin.yml b/.github/workflows/patched-release-darwin.yml index 7f2bfcb9f240..85254eeb86b5 100644 --- a/.github/workflows/patched-release-darwin.yml +++ b/.github/workflows/patched-release-darwin.yml @@ -47,14 +47,10 @@ jobs: build-macos: needs: check - uses: ./.github/workflows/bundle-macos.yml + uses: ./.github/workflows/patched-build-macos.yml permissions: contents: read with: - target: aarch64-apple-darwin - package_cli: true - package_desktop: false - signing: false ref: ${{ needs.check.outputs.sha }} upload: diff --git a/.github/workflows/patched-release.yml b/.github/workflows/patched-release.yml index fa35df16ea3a..c552b1b17e42 100644 --- a/.github/workflows/patched-release.yml +++ b/.github/workflows/patched-release.yml @@ -1,6 +1,6 @@ # Modified by Jonathan Mohrbacher, 2026: test-patches runs subdirectory hints tests; test-patches runs message id / truncate_from_message tests; the release also carries the aarch64-apple-darwin CLI. # Builds this branch (an upstream release tag plus a few local patches) with upstream's own -# Linux CLI build workflow and upstream's macOS bundle workflow (CLI only, unsigned), so the result +# Linux CLI build workflow and patched-build-macos.yml (upstream's macOS CLI build, unsigned), so the result # differs from the upstream release only by the patches, and publishes the gnu tarballs and the # aarch64-apple-darwin tarballs as a release of this fork. # @@ -31,14 +31,10 @@ jobs: # Unsigned: the Nix fetch never sets a quarantine attribute, and the linker's ad-hoc # signature is all Apple Silicon needs to exec a binary. build-macos: - uses: ./.github/workflows/bundle-macos.yml + uses: ./.github/workflows/patched-build-macos.yml permissions: contents: read with: - target: aarch64-apple-darwin - package_cli: true - package_desktop: false - signing: false ref: ${{ github.sha }} # Unit tests for the patched code paths (including the vendored acp-http crate), on the same toolchain.