Skip to content

Commit 2a67b0f

Browse files
authored
Merge pull request #3 from flexion/fix/bun-build-issue-on-macos-darwin25
fix: re-sign macOS binaries after Bun compile to fix Darwin 25+ SIGKILL
2 parents 9129fd7 + cd21796 commit 2a67b0f

2 files changed

Lines changed: 9 additions & 0 deletions

File tree

LOCAL_AWS_SETUP.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -172,6 +172,7 @@ See [flexion/opencode#2](https://github.com/flexion/opencode/pull/2) for the ful
172172
|--------|---------|-------------|
173173
| Hide skill prompt text from chat UI | `packages/opencode/src/session/prompt.ts` | Marks skill template as `synthetic` so the full prompt is sent to the model but hidden from the user |
174174
| Respect `tool_call: false` at runtime | `packages/opencode/src/session/llm.ts` | Gates tool resolution behind `capabilities.toolcall` — fixes failures on Bedrock models that don't support streaming + tool use |
175+
| Re-sign macOS binaries after build | `packages/opencode/script/build.ts` | Strips Bun's embedded signature and applies a fresh ad-hoc one — fixes SIGKILL (exit 137) on Darwin 25+ where Bun's signature format is rejected |
175176
| Local build & AWS Bedrock setup docs | `LOCAL_AWS_SETUP.md` | This file |
176177

177178
Full details and upstream tracking: [flexion/opencode#2](https://github.com/flexion/opencode/pull/2)

packages/opencode/script/build.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -232,6 +232,14 @@ for (const item of targets) {
232232
},
233233
})
234234

235+
// On macOS, Bun's embedded code signature is rejected by Darwin 25+.
236+
// Strip it and apply a fresh ad-hoc signature so the binary can run.
237+
if (item.os === "darwin") {
238+
const binaryPath = `dist/${name}/bin/opencode`
239+
await $`codesign --remove-signature ${binaryPath}`.quiet()
240+
await $`codesign --sign - --force ${binaryPath}`.quiet()
241+
}
242+
235243
// Smoke test: only run if binary is for current platform
236244
if (item.os === process.platform && item.arch === process.arch && !item.abi) {
237245
const binaryPath = `dist/${name}/bin/opencode`

0 commit comments

Comments
 (0)