fix(opencode): ad-hoc re-sign darwin binaries after local compile - #52183
Merged
Merged
Conversation
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.
Contributor
|
The following comment was made by an LLM, it may be inaccurate: |
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.
Issue for this PR
Closes #46313
Type of change
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--forcere-sign still replaces it.How did you verify your code works?
On macOS 27.0.1 (arm64): before,
build.ts --singlefailed the smoke test with exit 137 and the kernel log showedcs_invalid_page ... denying page sending SIGKILL. After, the smoke test passes,codesign --verify --strictpasses, and the binary runs.Screenshots / recordings
Not a UI change.
Checklist