Skip to content

Commit 34d6bf3

Browse files
authored
[NO-JIRA] Build the darwin CLI without Homebrew OpenSSL (#16)
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.
1 parent c658412 commit 34d6bf3

3 files changed

Lines changed: 82 additions & 11 deletions

File tree

Lines changed: 79 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,79 @@
1+
# The aarch64-apple-darwin CLI for this fork's releases (patched-release.yml and
2+
# patched-release-darwin.yml). It is upstream's bundle-macos.yml build-goose +
3+
# package-cli steps (same toolchain via hermit, default features, unsigned,
4+
# same tarball layout), with two differences:
5+
#
6+
# 1. CMAKE_DISABLE_FIND_PACKAGE_OpenSSL=ON. llama-cpp-sys-2 passes CMAKE_* env
7+
# through to llama.cpp's CMake, whose vendored cpp-httplib otherwise links any
8+
# OpenSSL it finds. On current macOS runner images that is Homebrew's, which
9+
# (a) no longer compiles there (const X509_NAME) and (b) would make the binary
10+
# need Homebrew's libssl at runtime. Upstream's own darwin binaries link no
11+
# OpenSSL, so this keeps the same shape.
12+
# 2. A portability check: the binary may link only system libraries.
13+
on:
14+
workflow_call:
15+
inputs:
16+
ref:
17+
description: "Commit to build"
18+
required: true
19+
type: string
20+
21+
name: "Patched build (macOS CLI)"
22+
23+
permissions:
24+
contents: read
25+
26+
jobs:
27+
build:
28+
name: Build goose (aarch64-apple-darwin)
29+
runs-on: macos-latest
30+
env:
31+
MACOSX_DEPLOYMENT_TARGET: "12.0"
32+
CMAKE_DISABLE_FIND_PACKAGE_OpenSSL: "ON"
33+
TARGET: aarch64-apple-darwin
34+
steps:
35+
- name: Checkout code
36+
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
37+
with:
38+
ref: ${{ inputs.ref }}
39+
40+
- name: Cache Rust dependencies
41+
uses: Swatinem/rust-cache@6323deb102c322ba6fcbdcafc7e3dddab59af2b6 # v2.9.2
42+
with:
43+
key: patched-macos-deployment-target-12
44+
45+
- name: Build goose
46+
run: |
47+
source ./bin/activate-hermit
48+
rustup target add "$TARGET"
49+
cargo build --release -p goose-cli --bin goose --target "$TARGET"
50+
51+
- name: Links only system libraries
52+
run: |
53+
bin="target/${TARGET}/release/goose"
54+
otool -L "$bin"
55+
bad="$(otool -L "$bin" | tail -n +2 | awk '{print $1}' | grep -Ev '^(/usr/lib/|/System/Library/)' || true)"
56+
if [ -n "$bad" ]; then
57+
echo "goose links non-system libraries:" >&2
58+
echo "$bad" >&2
59+
exit 1
60+
fi
61+
"$bin" --version
62+
63+
- name: Package CLI
64+
run: |
65+
mkdir -p package dist
66+
cp "target/${TARGET}/release/goose" package/goose
67+
chmod +x package/goose
68+
tar -cjf "dist/goose-${TARGET}.tar.bz2" -C package .
69+
tar -czf "dist/goose-${TARGET}.tar.gz" -C package .
70+
71+
- name: Upload CLI artifact
72+
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
73+
with:
74+
name: goose-aarch64-apple-darwin
75+
path: |
76+
dist/goose-aarch64-apple-darwin.tar.bz2
77+
dist/goose-aarch64-apple-darwin.tar.gz
78+
if-no-files-found: error
79+
overwrite: true

‎.github/workflows/patched-release-darwin.yml‎

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -47,14 +47,10 @@ jobs:
4747
4848
build-macos:
4949
needs: check
50-
uses: ./.github/workflows/bundle-macos.yml
50+
uses: ./.github/workflows/patched-build-macos.yml
5151
permissions:
5252
contents: read
5353
with:
54-
target: aarch64-apple-darwin
55-
package_cli: true
56-
package_desktop: false
57-
signing: false
5854
ref: ${{ needs.check.outputs.sha }}
5955

6056
upload:

‎.github/workflows/patched-release.yml‎

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# 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.
22
# Builds this branch (an upstream release tag plus a few local patches) with upstream's own
3-
# Linux CLI build workflow and upstream's macOS bundle workflow (CLI only, unsigned), so the result
3+
# Linux CLI build workflow and patched-build-macos.yml (upstream's macOS CLI build, unsigned), so the result
44
# differs from the upstream release only by the patches, and publishes the gnu tarballs and the
55
# aarch64-apple-darwin tarballs as a release of this fork.
66
#
@@ -31,14 +31,10 @@ jobs:
3131
# Unsigned: the Nix fetch never sets a quarantine attribute, and the linker's ad-hoc
3232
# signature is all Apple Silicon needs to exec a binary.
3333
build-macos:
34-
uses: ./.github/workflows/bundle-macos.yml
34+
uses: ./.github/workflows/patched-build-macos.yml
3535
permissions:
3636
contents: read
3737
with:
38-
target: aarch64-apple-darwin
39-
package_cli: true
40-
package_desktop: false
41-
signing: false
4238
ref: ${{ github.sha }}
4339

4440
# Unit tests for the patched code paths (including the vendored acp-http crate), on the same toolchain.

0 commit comments

Comments
 (0)