Skip to content
Merged
Show file tree
Hide file tree
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
79 changes: 79 additions & 0 deletions .github/workflows/patched-build-macos.yml
Original file line number Diff line number Diff line change
@@ -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
6 changes: 1 addition & 5 deletions .github/workflows/patched-release-darwin.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
8 changes: 2 additions & 6 deletions .github/workflows/patched-release.yml
Original file line number Diff line number Diff line change
@@ -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.
#
Expand Down Expand Up @@ -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.
Expand Down