From 89b1874b568f85a20276b24ae1f7c21c05d9d8e0 Mon Sep 17 00:00:00 2001 From: Luca Critelli Date: Mon, 21 Sep 2026 12:23:11 -0400 Subject: [PATCH] fix(build): build the macOS computer-use helper as one multi-arch binary SwiftPM no longer writes per-triple output to .build//release, so the two --triple builds left lipo with no inputs and the build failed on Swift 6.4. Repeated --arch produces a universal binary at the bin path directly. --- config/scripts/build-computer-macos.mjs | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) diff --git a/config/scripts/build-computer-macos.mjs b/config/scripts/build-computer-macos.mjs index 1730cfc77c45..e46c83e356a5 100644 --- a/config/scripts/build-computer-macos.mjs +++ b/config/scripts/build-computer-macos.mjs @@ -17,7 +17,6 @@ const entitlementsPath = path.join( const bundleId = process.env.ORCA_COMPUTER_MACOS_BUNDLE_ID ?? 'com.stablyai.orca.computer-use' const displayName = 'Orca Computer Use' const signingIdentity = resolveSigningIdentity() -const universalTriples = ['arm64-apple-macosx', 'x86_64-apple-macosx'] if (process.platform !== 'darwin') { process.exit(0) @@ -27,13 +26,20 @@ buildUniversalBinary() chmodSync(binaryPath, 0o755) createHelperApp() +// Repeated --arch yields one universal binary at --show-bin-path (.build/release); +// per-triple builds land outside that path under SwiftPM's current build system. function buildUniversalBinary() { - const builtBinaries = universalTriples.map((triple) => { - run('swift', ['build', '-c', 'release', '--package-path', packagePath, '--triple', triple]) - return path.join(packagePath, '.build', triple, 'release', 'orca-computer-use-macos') - }) - mkdirSync(path.dirname(binaryPath), { recursive: true }) - run('lipo', ['-create', ...builtBinaries, '-output', binaryPath]) + run('swift', [ + 'build', + '-c', + 'release', + '--package-path', + packagePath, + '--arch', + 'arm64', + '--arch', + 'x86_64' + ]) } function createHelperApp() {