Skip to content

fix(ci): ad-hoc codesign macOS release bundles (fix "is damaged")#48

Merged
Cmochance merged 1 commit into
mainfrom
fix/macos-adhoc-codesign
May 29, 2026
Merged

fix(ci): ad-hoc codesign macOS release bundles (fix "is damaged")#48
Cmochance merged 1 commit into
mainfrom
fix/macos-adhoc-codesign

Conversation

@Cmochance
Copy link
Copy Markdown
Owner

@Cmochance Cmochance commented May 29, 2026

Problem

Downloading the macOS app and opening it shows "codex_switch.app is damaged, move to Trash" on macOS Sequoia 15+, with no "Open anyway" option.

Root cause (verified against the CI-built dmg)

--no-sign left only the Rust linker's binary-level ad-hoc signature (flags 0x20002 adhoc,linker-signed) with no full bundle codesign. codesign --verify on the shipped app reports:

code has no resources but signature indicates they must be present

— a mismatched/incomplete signature. Once the download carries a com.apple.quarantine flag, Gatekeeper rejects it outright as "is damaged" (not the softer "unverified developer → Open anyway"). It is not "completely unsigned" (the linker already ad-hoc signs the Mach-O); the gap is the missing bundle-level codesign.

Fix (mirrors codex-app-transfer's release.yml signing path)

  • package.json: drop --no-sign from tauri:build:macos-release.
  • build.yml Build step: export APPLE_SIGNING_IDENTITY — a real Developer ID when the APPLE_SIGNING_IDENTITY secret is set, else ad-hoc - — so Tauri does a complete codesign --sign of the bundle.
  • build.yml: add a codesign --verify --deep --strict gate before upload so an unsigned/mismatched bundle fails the build instead of shipping.

Verification (local ad-hoc release build)

The produced dmg's app now has flags 0x10002 (adhoc,runtime) and a clean codesign --verify ("valid on disk", "satisfies its Designated Requirement"), and the signature survives macos:pkg + finalize inside the dmg.

(Also records #46's recursive-glob fix so Linux .deb/.AppImage attach to releases.)

🤖 Generated with Claude Code


Open in Devin Review

Downloads of the macOS app showed "codex_switch.app is damaged" on
Sequoia 15+ with no "Open anyway" option. Root cause: the `--no-sign`
build left only the Rust linker's binary-level ad-hoc signature
(flags 0x20002 adhoc,linker-signed) with NO full bundle codesign, so
`codesign --verify` reported "code has no resources but signature
indicates they must be present" -- a mismatched signature Gatekeeper
rejects outright once the download is quarantined.

Fix (mirrors codex-app-transfer release.yml signing path):
- package.json: drop `--no-sign` from tauri:build:macos-release.
- build.yml Build step exports APPLE_SIGNING_IDENTITY -- a real Developer
  ID when the APPLE_SIGNING_IDENTITY secret is set, else ad-hoc "-" -- so
  Tauri does a complete `codesign --sign` of the bundle.
- build.yml adds a `codesign --verify --deep --strict` gate so an
  unsigned/mismatched bundle fails the build instead of shipping.

Verified locally: an ad-hoc release build yields flags 0x10002
(adhoc,runtime) with a clean codesign --verify, and the signature
survives macos:pkg + finalize inside the dmg.

Also records #46's recursive-glob fix that attaches Linux assets.
@Cmochance Cmochance merged commit 314bfd8 into main May 29, 2026
3 of 4 checks passed
@Cmochance Cmochance deleted the fix/macos-adhoc-codesign branch May 29, 2026 11:47
Copy link
Copy Markdown

@devin-ai-integration devin-ai-integration Bot left a comment

Choose a reason for hiding this comment

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

✅ Devin Review: No Issues Found

Devin Review analyzed this PR and found no potential bugs to report.

View in Devin Review to see 4 additional findings.

Open in Devin Review

Cmochance added a commit that referenced this pull request May 29, 2026
…pp (#49)

The #48 verify gate failed every macOS build (finalize removes the standalone .app, keeping only dmg/pkg). Verify the codesigned app inside the dmg instead. Locally dry-run verified rc=0.
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.

1 participant