Skip to content

Commit c7b2a41

Browse files
arul28claude
andcommitted
fix(release): per-arch OpenCode validator check (require only target arch)
The deep-smoke validator required BOTH opencode-darwin-arm64 AND opencode-darwin-x64 (written for the universal build), but a per-arch app bundles only its own arch's OpenCode binary — so the arm64 app validation failed on missing opencode-darwin-x64. Require only the matching arch's OpenCode (threaded expectedArch through). This was the last validator check after the now-fully-working signing chain (both dmgs Accepted + stapled, apps stapled). Verified locally: arm64 app has opencode-darwin-arm64 + arm64 sidecar + node-pty arm64 prebuild + ade-cli + 11 agent-skills + smoke script — all present. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
1 parent 3a41468 commit c7b2a41

1 file changed

Lines changed: 9 additions & 10 deletions

File tree

apps/desktop/scripts/validate-mac-artifacts.mjs

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -233,15 +233,14 @@ async function assertRemoteRuntimeBundle(resourcesPath, description, expectedArc
233233
}
234234
}
235235

236-
async function assertBundledOpenCodeRuntime(nodeModulesPath, description) {
237-
const requiredBinaries = [
238-
path.join(nodeModulesPath, "opencode-darwin-arm64", "bin", "opencode"),
239-
path.join(nodeModulesPath, "opencode-darwin-x64", "bin", "opencode"),
240-
];
241-
for (const binaryPath of requiredBinaries) {
242-
await assertPathExists(binaryPath, `bundled OpenCode runtime binary for ${description}`);
243-
await assertExecutable(binaryPath, `bundled OpenCode runtime binary for ${description}`);
244-
}
236+
async function assertBundledOpenCodeRuntime(nodeModulesPath, description, expectedArch) {
237+
// Per-arch builds bundle ONLY their own arch's OpenCode binary (electron-builder
238+
// excludes the non-target arch's optional native dep). Require just that one;
239+
// we don't assert the other arch is absent (a harmless extra copy must not fail
240+
// the release).
241+
const binaryPath = path.join(nodeModulesPath, `opencode-darwin-${expectedArch}`, "bin", "opencode");
242+
await assertPathExists(binaryPath, `bundled OpenCode runtime binary for ${description}`);
243+
await assertExecutable(binaryPath, `bundled OpenCode runtime binary for ${description}`);
245244
}
246245

247246
function assertAppAsarContains(appAsarPath, relativePaths, description) {
@@ -435,7 +434,7 @@ async function validatePackagedRuntime(appPath, description, expectedArch, optio
435434
await assertExecutable(adeCliInstallerPath, "bundled ADE CLI PATH installer");
436435
await assertPathExists(nodePtyModulePath, "unpacked node-pty module");
437436
await assertPathExists(smokeScriptPath, "unpacked packaged runtime smoke script");
438-
await assertBundledOpenCodeRuntime(nodeModulesPath, description);
437+
await assertBundledOpenCodeRuntime(nodeModulesPath, description, expectedArch);
439438
const adeCliTuiContents = await fs.readFile(adeCliTuiPath, "utf8");
440439
for (const token of ["__dirname", "__filename"]) {
441440
if (adeCliTuiContents.includes(token) && !adeCliTuiContents.includes(`const ${token} =`)) {

0 commit comments

Comments
 (0)