From 9b4882db54627f2656a6990daafa412f9f3c7c82 Mon Sep 17 00:00:00 2001 From: Ryan Date: Wed, 30 Sep 2026 10:53:09 -0700 Subject: [PATCH] fix(opencode): ad-hoc re-sign darwin binaries after local compile (#52183) Co-authored-by: Ryan Wyler --- packages/opencode/script/build.ts | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/packages/opencode/script/build.ts b/packages/opencode/script/build.ts index ce45f770f04..b71391103c6 100755 --- a/packages/opencode/script/build.ts +++ b/packages/opencode/script/build.ts @@ -201,6 +201,12 @@ for (const item of targets) { }, }) + // Embedding the bundle invalidates the linker's ad-hoc signature, and macOS 27+ + // SIGKILLs binaries with invalid pages. Re-sign ad-hoc; release CI re-signs with Developer ID. + if (item.os === "darwin" && process.platform === "darwin") { + await $`codesign --force --sign - dist/${name}/bin/opencode` + } + // 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`