Skip to content

app: run lipo and codesign in build-appstore.sh - #66

Merged
setoelkahfi merged 1 commit into
developmentfrom
fix/appstore-build-signing
Nov 25, 2026
Merged

setoelkahfi merged 1 commit into
developmentfrom
fix/appstore-build-signing

Conversation

@setoelkahfi

Copy link
Copy Markdown
Collaborator

build-appstore.sh build now produces a signed universal .app from 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:

  • tauri-cli 2.12.5 failed to spawn lipo for the universal merge ("Bad file descriptor"). The script compiles each architecture with tauri build --no-bundle, runs lipo from bash, then calls tauri bundle --target universal-apple-darwin, which picks up the merged binary as is. Compiling through tauri build instead of cargo matters, because it passes the merged config to the compile and the binary ends up with com.ondeinference.desktop instead of the debug identifier.
  • codesign rejected the bundle because Contents/MacOS/mlx.metallib had no signature. The bundle step now runs with --no-sign, and the new codesign_app signs the metallib, the executable and the app (the last two with Entitlements-appstore.plist), then runs codesign --verify --deep --strict. The identity comes from signingIdentity in the App Store config, or from MAS_SIGNING_IDENTITY if it is set, and the script fails with a message when the identity isn't in the keychain.
  • The first Rust compile failed when dist/ did not exist. build_frontend runs pnpm install --frozen-lockfile && pnpm build before anything else, and the per-arch builds skip beforeBuildCommand so the frontend is built once.

build-direct.sh calls build_frontend as 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/null from a fresh worktree with no dist/ and no target/:

  • it exits 0 after the profile, entitlements and codesign checks
  • lipo -archs on the bundled binary prints x86_64 arm64
  • codesign -dv on mlx.metallib shows team 2TQF86ZACD
  • build-appstore.sh sign writes the .pkg
  • pnpm test passes

I did not run asc apps validate or upload anything. pnpm check:config fails on the 0.6.0 vs 0.6.1 version mismatch, which is already on development and fixed in #64.

`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>

@sigit-code-review sigit-code-review Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Comment thread packaging/app/scripts/build-direct.sh Resolved

@sigit-code-review sigit-code-review Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me, thanks for working through the comments.

@setoelkahfi setoelkahfi self-assigned this Nov 25, 2026
@setoelkahfi
setoelkahfi merged commit 052001f into development Nov 25, 2026
7 checks passed
@setoelkahfi
setoelkahfi deleted the fix/appstore-build-signing branch November 25, 2026 23:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants