Skip to content

fix(opencode): ad-hoc re-sign darwin binaries after local compile - #52183

Merged
rekram1-node merged 1 commit into
anomalyco:devfrom
gignit:fix/darwin-codesign
Sep 30, 2026
Merged

rekram1-node merged 1 commit into
anomalyco:devfrom
gignit:fix/darwin-codesign

Conversation

@ryangamerdev

@ryangamerdev ryangamerdev commented Sep 29, 2026 •

Copy link
Copy Markdown
Contributor

Issue for this PR

Closes #46313

Type of change

  • Bug fix
  • New feature
  • Refactor / code improvement
  • Documentation

What does this PR do?

Bun's compile writes the bundle into the executable after the linker ad-hoc signs it, so the signature no longer matches. Release CI re-signs in sign-cli-macos, but local builds (build.ts --single, as in CONTRIBUTING) don't. On macOS 27 the kernel rejects the invalid pages and SIGKILLs the binary, so the build's own smoke test fails with exit 137 and the binary can't run.

This re-signs darwin outputs ad-hoc (codesign --force --sign -) right after compile, only when building on macOS. Linux CI builds are unaffected, and the release job's Developer ID --force re-sign still replaces it.

How did you verify your code works?

On macOS 27.0.1 (arm64): before, build.ts --single failed the smoke test with exit 137 and the kernel log showed cs_invalid_page ... denying page sending SIGKILL. After, the smoke test passes, codesign --verify --strict passes, and the binary runs.

Screenshots / recordings

Not a UI change.

Checklist

  • I have tested my changes locally
  • I have not included unrelated changes in this PR

Bun's compile embeds the bundle after the linker has ad-hoc signed the
executable, leaving the signature invalid. macOS 27 enforces code page
validation and SIGKILLs the binary on launch (exit 137), so local builds
(build.ts --single) fail the smoke test and cannot run.

Re-sign darwin outputs with an ad-hoc identity when building on macOS.
Release CI builds on Linux and re-signs with Developer ID in
sign-cli-macos, so published binaries are unaffected.
@github-actions

Copy link
Copy Markdown
Contributor

The following comment was made by an LLM, it may be inaccurate:

@rekram1-node
rekram1-node merged commit 9b4882d into anomalyco:dev Sep 30, 2026
12 checks passed
@ryangamerdev
ryangamerdev deleted the fix/darwin-codesign branch October 2, 2026 03:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[BUG]: macOS release binaries fail codesign verification

2 participants