fix(release): adhoc re-sign darwin binaries to prevent AMFI SIGKILL on macOS 26.4#453
Merged
Merged
Conversation
There was a problem hiding this comment.
Pull request overview
Adds an ad-hoc re-sign step to the GoReleaser pipeline intended to ensure released macOS (darwin) binaries are signed in a way that avoids AMFI SIGKILL on macOS 26.4.
Changes:
- Adds a GoReleaser build
posthook that runscodesign --force --sign -for darwin targets whencodesignis available.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
+23
to
+25
| hooks: | ||
| post: | ||
| - cmd: sh -c 'if [ "{{ .Os }}" = "darwin" ] && command -v codesign >/dev/null 2>&1; then codesign --force --sign - "{{ .Path }}"; fi' |
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.
Summary
Closes #402 — the released
darwin_arm64binary got SIGKILL (exit 137) on macOS 26.4 because it carried only a Go-linker adhoc signature (flags=0x20002 adhoc,linker-signed), which AMFI on recent macOS rejects.Change
.goreleaser.yaml: add a post-build hook that adhoc-re-signs darwin binaries withcodesign --force --sign -(producesflags=0x2 adhoc, which AMFI accepts). Free — no Apple Developer certificate required.Note: goreleaser v2 has no
filter: goosfield, so the hook uses a shell conditional gated on{{ .Os }}pluscommand -v codesign, which no-ops safely on Linux CI runners.Test plan
goreleaser checkpasses. Cannot exercise macOS signing in CI; manual verification on a macOS 26.4 arm64 host:codesign -dvv ./engrammust NOT showlinker-signed, and./engram --versionmust exit 0 (not 137).Notes
Passed adversarial review —
{{ .Os }}and{{ .Path }}verified against goreleaser v2 source; hook fires per-binary for both darwin archs; fails safe on Linux.