diff --git a/LOCAL_AWS_SETUP.md b/LOCAL_AWS_SETUP.md index 2fc338ffed2a..65b6226c36ef 100644 --- a/LOCAL_AWS_SETUP.md +++ b/LOCAL_AWS_SETUP.md @@ -172,6 +172,7 @@ See [flexion/opencode#2](https://github.com/flexion/opencode/pull/2) for the ful |--------|---------|-------------| | 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 | | 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 | +| 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 | | Local build & AWS Bedrock setup docs | `LOCAL_AWS_SETUP.md` | This file | Full details and upstream tracking: [flexion/opencode#2](https://github.com/flexion/opencode/pull/2) diff --git a/packages/opencode/script/build.ts b/packages/opencode/script/build.ts index 6d1087f2873e..bc23c940847d 100755 --- a/packages/opencode/script/build.ts +++ b/packages/opencode/script/build.ts @@ -232,6 +232,14 @@ for (const item of targets) { }, }) + // On macOS, Bun's embedded code signature is rejected by Darwin 25+. + // Strip it and apply a fresh ad-hoc signature so the binary can run. + if (item.os === "darwin") { + const binaryPath = `dist/${name}/bin/opencode` + await $`codesign --remove-signature ${binaryPath}`.quiet() + await $`codesign --sign - --force ${binaryPath}`.quiet() + } + // Smoke test: only run if binary is for current platform if (item.os === process.platform && item.arch === process.arch && !item.abi) { const binaryPath = `dist/${name}/bin/opencode`