Repository navigation
app: run lipo and codesign in build-appstore.sh - #66
Conversation
`build-appstore.sh build` could not produce a signed .app from a shell
without a terminal. tauri-cli 2.12.5 failed to spawn lipo ("Bad file
descriptor"), and when Tauri did get as far as signing, codesign
rejected the bundle because Contents/MacOS/mlx.metallib was unsigned.
The script now builds the frontend first, then compiles each
architecture with `tauri build --no-bundle`. It merges the two with lipo
from bash, runs `tauri bundle --no-sign`, and signs the metallib, the
executable and the app itself. Compiling through tauri build rather
than cargo keeps the release identifier in the binary.
build-direct.sh also builds the frontend first now, so a fresh checkout
compiles. Its signing path is unchanged.
Fixes #61
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: siGit Code v1.7.10 <noreply@sigit.si>
Co-Authored-By: OndeCode v1.1.2 <noreply@ondeinference.com>
Co-Authored-By: siGit Code <297239231+sigitc@users.noreply.github.com>
There was a problem hiding this comment.
This change updates the App Store build pipeline to work from a non-interactive shell by running lipo and codesign directly in build-appstore.sh, instead of relying on tauri-cli, which fails in this context. The script now builds the frontend first, compiles each architecture separately, merges them with lipo, bundles without signing, and then signs the metallib, binary, and app bundle in the correct order. It also adds frontend building to build-direct.sh and introduces new helper functions in release-lib.sh for these steps. The changes address the three main issues from #61 and have been tested locally as described in the PR description.
Automated review by siGit Code Review · commit b88ccde · see the review dashboard
build-appstore.sh buildnow produces a signed universal.appfrom a shell without a terminal, which it could not do in the 0.6.0 release.Fixes #61
The three problems from the issue, and what the script does now:
lipofor the universal merge ("Bad file descriptor"). The script compiles each architecture withtauri build --no-bundle, runslipofrom bash, then callstauri bundle --target universal-apple-darwin, which picks up the merged binary as is. Compiling throughtauri buildinstead of cargo matters, because it passes the merged config to the compile and the binary ends up withcom.ondeinference.desktopinstead of the debug identifier.Contents/MacOS/mlx.metallibhad no signature. The bundle step now runs with--no-sign, and the newcodesign_appsigns the metallib, the executable and the app (the last two withEntitlements-appstore.plist), then runscodesign --verify --deep --strict. The identity comes fromsigningIdentityin the App Store config, or fromMAS_SIGNING_IDENTITYif it is set, and the script fails with a message when the identity isn't in the keychain.dist/did not exist.build_frontendrunspnpm install --frozen-lockfile && pnpm buildbefore anything else, and the per-arch builds skipbeforeBuildCommandso the frontend is built once.build-direct.shcallsbuild_frontendas well. Its signing and notarization still go through Tauri, so it probably has the same lipo and metallib problems. I left that for a separate change instead of touching notarization untested.Tested locally on macOS 27.0 with Xcode 27.2, running
build-appstore.sh build </dev/nullfrom a fresh worktree with nodist/and notarget/:lipo -archson the bundled binary printsx86_64 arm64codesign -dvonmlx.metallibshows team2TQF86ZACDbuild-appstore.sh signwrites the.pkgpnpm testpassesI did not run
asc apps validateor upload anything.pnpm check:configfails on the 0.6.0 vs 0.6.1 version mismatch, which is already ondevelopmentand fixed in #64.