fix(release): build macOS binaries on a native runner so they load on macOS 15+ - #178
Merged
Conversation
… macOS 15+ The 0.52.2 cask aborted at load on macOS Sequoia/Tahoe with "__DATA_CONST segment missing SG_READ_ONLY flag" (#176). darwin was cross-compiled inside goreleaser-cross, whose osxcross ld64 omits the SG_READ_ONLY flag on the __DATA_CONST segment that the macOS 15+ dyld now enforces. Apple's ld sets it, so locally built binaries always worked and the bug only surfaced in the released artifact. Build darwin on a native macos-15 runner instead: - new build-darwin job links arm64 natively + amd64 via `clang -arch x86_64`, codesigns with rcodesign, smoke-tests the segment flag, and runs `gortex version` on the enforcing dyld before handing off archives. - the release job now builds linux only, merges the darwin tarballs, notarizes, appends them to checksums.txt, signs, and uploads. goreleaser's prebuilt builder is Pro-only, so the homebrew cask (which references all four os/arch tarballs) is assembled and pushed to the tap from the release job once every platform's hash exists, instead of by goreleaser. Completions are still generated at brew-install time. scripts/verify-macho-readonly.sh is the guard: it fails the release if a darwin binary ships without SG_READ_ONLY, so this can never regress.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
The
0.52.2Homebrew cask aborts at load on macOS Sequoia / Tahoe (fixes #176):macOS 15+ dyld now enforces the
SG_READ_ONLY(0x10) flag on the__DATA_CONSTsegment. darwin was cross-compiled insidegoreleaser-cross, whose osxcrossld64omits that flag. Apple'sldsets it — so locally built binaries (make build) always worked and the bug only ever surfaced in the released artifact (which is why it couldn't be reproduced locally).Fix
Build darwin on a native
macos-15runner where Apple'sldsets the flag:build-darwinjob: links arm64 natively + amd64 viaclang -arch x86_64, codesigns withrcodesign, smoke-tests the segment flag, and runsgortex versionon the enforcing dyld (the exact 0.52.2 brew cask binary broken for macos #176 repro) before handing off the tar.gz archives.releasejob now builds linux only, merges the darwin tarballs, notarizes, appends them tochecksums.txt, cosign-signs, uploads, and feeds SLSA.goreleaser's
prebuiltbuilder is Pro-only, so the homebrew cask (which references all four os/arch tarballs) is assembled and pushed tozzet/homebrew-tapfrom the release job once every platform's hash exists, instead of by goreleaser.generate_completions_from_executablestill runs at brew-install time, so nothing needs to execute at release time.Smoke test
scripts/verify-macho-readonly.shasserts__DATA_CONSTcarriesSG_READ_ONLYand fails the release if a darwin binary ships without it — so this can't regress. Thebuild-darwinjob also actually loads + runs the arm64 binary on the Sequoia runner.Validation
goreleaser check✓, YAML parse ✓,actionlint✓ (only pre-existing SC2035 infos)ruby -cOK); packaging + checksum-append logic testedNotes for reviewers
MACOS_CERTIFICATE_P12/_PASSWORDare now also consumed by thebuild-darwinjob (signing moved there); thereleasejob keeps only the notary key.macos-15specifically so the execution smoke test runs under the enforcing dyld. Onmacos-14(Sonoma) only theotoolcheck would guard the flag.