From d995bd9eeb95e95425ea7c2f45e2f5288250dcfd Mon Sep 17 00:00:00 2001 From: Giovanni Ferri Date: Sun, 2 Aug 2026 18:09:47 +0100 Subject: [PATCH] Fix bpm-tray .app: pin MACOSX_DEPLOYMENT_TARGET, or it won't launch Real bug found live: without MACOSX_DEPLOYMENT_TARGET set, the macos-latest CI runner's cgo linker embedded whatever its own SDK defaults to (observed: minos 26.0) into bpm-tray's LC_BUILD_VERSION load command. The binary itself still ran fine from a terminal (a direct exec doesn't check this), but open/LaunchServices enforces it against the running OS, so the packaged .app silently refused to launch on any real Mac not yet on that OS version - exactly the Finder/Spotlight/Launchpad path this whole feature exists for. Pinned to 11.0, matching Info.plist.template's LSMinimumSystemVersion. Verified locally: rebuilt with the pin, otool -l now shows minos 11.0, and a freshly assembled .app opens correctly via `open`. --- .github/workflows/release.yml | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 01011c9..80522a2 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -47,10 +47,20 @@ jobs: # .tar.gz filename is versioned) so the Homebrew formula's # `bin.install "bpm-tray"` finds it - matches how goreleaser's own # archives contain a plain "bpm", not "bpm_vX_os_arch". + # + # MACOSX_DEPLOYMENT_TARGET matters here: real bug found live - left + # unset, the macos-latest runner's cgo linker embeds whatever its + # own SDK defaults to (observed: minos 26.0) into the binary's + # LC_BUILD_VERSION load command. `open`/LaunchServices enforces + # that against the *running* OS - unlike a direct exec, which + # ignores it - so the resulting .app failed to launch via Finder/ + # Spotlight on any real Mac not yet running that OS version, while + # still running fine from a terminal. Pinned to 11.0 to match + # Info.plist.template's LSMinimumSystemVersion. for arch in arm64 amd64; do dir="dist-tray/darwin_${arch}" mkdir -p "$dir" - CGO_ENABLED=1 GOARCH=$arch go build -o "$dir/bpm-tray" ./cmd/bpm-tray + MACOSX_DEPLOYMENT_TARGET=11.0 CGO_ENABLED=1 GOARCH=$arch go build -o "$dir/bpm-tray" ./cmd/bpm-tray tar -C "$dir" -czf "dist-tray/bpm-tray_${{ github.ref_name }}_darwin_${arch}.tar.gz" bpm-tray done - name: Build AppIcon.icns from the embedded logo