Repository navigation
fix(desktop): ad-hoc sign the macOS bundle - #300
Merged
Merged
Conversation
Addresses the launch failure in #272, where the aarch64 build reports "rustfava is damaged and can't be opened". That wording is Gatekeeper's, and it is misleading: the bundle is not corrupt, it is unsigned. On Apple Silicon this is fatal rather than advisory — arm64 macOS requires every executable to carry at least an ad-hoc signature, so an unsigned arm64 app cannot launch from a downloaded .dmg at all. Nothing in the release path signed it. Grepping .github/workflows/, desktop/src-tauri/tauri.conf.json and desktop/ for notariz, codesign, APPLE_ID, signingIdentity, hardenedRuntime and entitlements returned no matches anywhere. `signingIdentity: "-"` is passed straight through to `codesign --force -s -` (tauri-macos-sign's keychain.rs builds `vec!["--force", "-s", &identity]`), which is the ad-hoc invocation. No certificate, no Apple account, no secrets. Three things checked before choosing this over a CI environment variable: - `APPLE_SIGNING_IDENTITY` overwrites the config value, per tauri-cli's ENVIRONMENT_VARIABLES.md, so adding a real Developer ID later needs no change here — it just overrides. - Setting an identity does not trigger a notarization attempt. tauri-bundler only notarizes when `notarize_auth()` finds credentials; with none set it logs "skipping app notarization" and continues. The one case that hard-fails is a missing team ID *alongside* an Apple ID, which does not apply. - The config still validates against schema.tauri.app/config/2, checked against the fetched schema rather than assumed. This does not make the app notarized. A first launch will still warn, and the proper fix is a Developer ID certificate plus notarytool, which needs a paid account and four secrets — a maintainer decision. But it turns "damaged, cannot open" into "unidentified developer, open anyway", which is the difference between unusable and usable.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Addresses the launch failure in #272 — the aarch64 build reports "rustfava is damaged and can't be opened".
That wording is Gatekeeper's and it's misleading: the bundle isn't corrupt, it's unsigned. On Apple Silicon this is fatal rather than advisory — arm64 macOS requires every executable to carry at least an ad-hoc signature, so an unsigned arm64 app cannot launch from a downloaded
.dmgat all.Nothing in the release path signed it. Grepping
.github/workflows/,desktop/src-tauri/tauri.conf.jsonanddesktop/fornotariz,codesign,APPLE_ID,signingIdentity,hardenedRuntime,entitlementsreturned no matches anywhere.The change
"-"is passed straight through tocodesign --force -s -— tauri-macos-sign'skeychain.rsbuildsvec!["--force", "-s", &identity]— which is the ad-hoc invocation. No certificate, no Apple account, no secrets.Checked before choosing this over a CI env var
APPLE_SIGNING_IDENTITYoverwritesbundle > macOS > signingIdentityper tauri-cli'sENVIRONMENT_VARIABLES.md, so adding a Developer ID later needs no change here.tauri-bundleronly notarizes whennotarize_auth()finds credentials; with none set it logsskipping app notarizationand continues. The one hard-fail case is a missing team ID alongside an Apple ID, which doesn't apply.schema.tauri.app/config/2— checked against the fetched schema, and I confirmedsigningIdentityis declared onMacConfigrather than assuming it.What this does and doesn't do
It does not make the app notarized. First launch still shows the unidentified-developer prompt. Proper notarization needs a Developer ID certificate plus
notarytool— a paid Apple account and four secrets, so a maintainer decision rather than something to land unilaterally.What it changes is the failure mode: from "damaged, cannot open" (no way through without
xattr) to "unidentified developer, open anyway" (right-click → Open). That's the difference between unusable and usable.I can't build or verify a macOS bundle from here, so the real proof is the next desktop release artifact launching on Apple Silicon.