The best way to control Claude Code, Codex and more from any computer or phone
fix(desktop): arm64 macOS builds no longer ship x64-only objc-js binary (#31285)
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Josh Rossi committed
Nov 6, 2026 at 01:45 UTC
2756da402b5d795baa05762cba1706a2c0e2fac8
2 files changed
+28
-2
scripts/build-desktop-artifact.test.ts
+25
@@ -38,6 +38,7 @@ import {
38
packWindowsServerAsar,
39
preflightWindowsDesktopBuild,
40
renderMacPasskeyEntitlements,
41
+ resolveMacFileExclusions,
42
resolveMacWebAuthnEntitlements,
43
resolveMacPasskeySigningConfiguration,
44
resolveMergedStageDependencies,
@@ -664,6 +665,30 @@ it.layer(NodeServices.layer)("build-desktop-artifact", (it) => {
665
),
666
);
667
668
+ it("drops the other architecture's Darwin prebuilds from single-architecture Mac builds", () => {
669
+ const excludes = (arch: "arm64" | "x64" | "universal", file: string) =>
670
+ resolveMacFileExclusions(arch).some((glob) => NodePath.matchesGlob(file, glob.slice(1)));
671
+ const x64 = [
672
+ "node_modules/node-pty/prebuilds/darwin-x64/pty.node",
673
+ "node_modules/objc-js/prebuilds/darwin-x64/node.napi.node",
674
+ ];
675
+ const arm64 = [
676
+ "node_modules/node-pty/prebuilds/darwin-arm64/pty.node",
677
+ "node_modules/objc-js/prebuilds/darwin-arm64/node.napi.armv8.node",
678
+ ];
679
+
680
+ for (const file of x64) {
681
+ assert.isTrue(excludes("arm64", file), file);
682
+ assert.isFalse(excludes("x64", file), file);
683
+ assert.isFalse(excludes("universal", file), file);
684
+ }
685
+ for (const file of arm64) {
686
+ assert.isTrue(excludes("x64", file), file);
687
+ assert.isFalse(excludes("arm64", file), file);
688
+ assert.isFalse(excludes("universal", file), file);
689
+ }
690
+ });
691
+
692
it.effect("unpacks target Windows natives while excluding the other architecture", () =>
693
Effect.scoped(
694
Effect.gen(function* () {
scripts/build-desktop-artifact.ts
+3
-2
@@ -1014,14 +1014,15 @@ export const LINUX_FILE_EXCLUSIONS = [
1014
"!**/node_modules/node-pty/prebuilds/darwin-*/**/*",
1015
] as const;
1016
1017
-// node-pty bundles both Darwin architectures; only universal apps need both.
1017
+// Native packages (node-pty, objc-js) ship prebuilds for both Darwin architectures; only universal
1018
+// apps need both. macOS 27 warns that an arm64 app holding x64-only code won't open on macOS 28.
1019
export function resolveMacFileExclusions(arch?: typeof BuildArch.Type) {
1020
if (arch === undefined || arch === "universal") {
1021
return [...MAC_FILE_EXCLUSIONS];
1022
}
1023
1024
const unusedArch = arch === "arm64" ? "x64" : "arm64";
1024
- return [...MAC_FILE_EXCLUSIONS, `!**/node_modules/node-pty/prebuilds/darwin-${unusedArch}/**/*`];
1025
+ return [...MAC_FILE_EXCLUSIONS, `!**/node_modules/**/prebuilds/darwin-${unusedArch}/**/*`];
1026
}
1027
// Large ASAR sidecars avoid NSIS extracting thousands of loose files during installs and updates.
1028
export const WINDOWS_SERVER_ASAR_RESOURCE = "server.asar";