Skip to content

Ship the macOS release as a verified DMG containing only wimsy.app - #4

Merged
dwd merged 2 commits into
dwd:mainfrom
Fishbowler:macos-dmg-packaging
Nov 19, 2026
Merged

dwd merged 2 commits into
dwd:mainfrom
Fishbowler:macos-dmg-packaging

Conversation

@Fishbowler

Copy link
Copy Markdown
Contributor

Problem

The v0.0.6 wimsy-macos.tar.gz is a tarball of the whole build/macos/Build/Products/Release directory. Unpacked it's about 1.3 GB (396 MB compressed). It's mostly .o files, .swiftmodule directories, SwiftPM resource bundles, duplicate copies of the frameworks and about 860 MB of dSYMs. wimsy.app is buried in the middle of all that.

Changes

Package as a DMG (tool/package_macos_dmg.sh, 1197ec9)

  • Copies only wimsy.app, using ditto so framework symlinks, permissions and the code signature survive. It sits next to an Applications symlink so users can drag to install.
  • Builds a compressed UDZO DMG and runs hdiutil verify on it.
  • CI uploads and publishes wimsy-macos.dmg in place of wimsy-macos.tar.gz. dSYMs are no longer shipped.
  • On the v0.0.6 app this gives a 60 MB DMG, compared with the 396 MB tarball.

Verify the DMG in CI (tool/verify_macos_dmg.sh, d217e1d)

A new step runs between packaging and upload. It mounts the DMG read-only and checks that:

  • the image verifies and mounts
  • the volume holds exactly wimsy.app plus the Applications → /Applications symlink
  • codesign --verify --deep --strict passes
  • the executable is universal (x86_64 + arm64)
  • on v* tag builds only, CFBundleShortVersionString matches the tag

The script reports every failure before exiting with an error.

Designed to work with Developer ID signing later

Neither script signs anything, and nothing here would need undoing when signing is added. The app gets signed before packaging, and the DMG gets notarized and stapled after it. The checks above stay valid for a signed build. The signing-specific checks (Developer ID authority, hardened runtime, spctl, stapler) should be added in the same change that adds the signing.

Testing

  • Packaging: I packaged the v0.0.6 wimsy.app and mounted the result. It contains only the app and the Applications symlink, the signature verifies, and all 18 framework symlinks are intact.
  • Verification passes: the v0.0.6 DMG passes, both with and without expected version 0.0.6.
  • Verification fails correctly: each of these exits 1 with a specific FAIL line:
    • a wrong expected version
    • a tampered framework inside the app
    • an extra file on the volume plus an arm64-only app
    • a truncated DMG
    • a missing DMG path
  • Lint and parse: shellcheck reports nothing on both scripts, and the workflow YAML parses.
  • End to end in CI: I couldn't build the app from source locally (see the entitlement note below), so the real end-to-end test was a CI run on my fork: run 44293721200. Every job passed. In build-macos, the packaged wimsy-macos.dmg artifact is 56 MB, and the verify step printed:
    ok:   hdiutil verify
    ok:   volume contains only wimsy.app and Applications
    ok:   Applications is a symlink to /Applications
    ok:   codesign --verify --deep --strict
    ok:   universal executable (x86_64 arm64)
    skip: version check (no expected version given; bundle has 0.0.02171)
    All checks passed
    
    The 0.0.02171 there is a live example of the version mangling described in follow-up 3.
  • App tests: flutter analyze is clean and flutter test / vendor/xmpp_stone dart test pass. This PR doesn't touch the app.

Not fixed here (follow-ups)

  1. The app can't launch even after the quarantine flag is removed. Opening it fails with NSPOSIXErrorDomain Code=163 "Launchd job spawn failed". The cause is the keychain-access-groups entitlement in macos/Runner/Release.entitlements. macOS restricts that entitlement, and the ad-hoc build has no team or provisioning profile to back it. I confirmed this by re-signing the same app without it, after which it launches. The same entitlement makes local flutter build macos --release fail with "Runner" has entitlements that require signing with a development certificate. Developer ID signing with a matching provisioning profile would fix both.
  2. Gatekeeper rejects the app. It's ad-hoc signed, with no hardened runtime and no notarization, and the signed entitlements include get-task-allow. Fixing this needs Developer ID signing and notarization, which needs the repo owner's Apple Developer credentials.
  3. Pre-release versions get mangled on macOS and iOS. Flutter strips every character that isn't a digit or a dot from the build name on Apple platforms. CI's 0.0.6-pre-<sha> therefore becomes something like 0.0.611979 in the bundle. That's why the version check only runs on tag builds. A tag like v1.0.0-rc1 would hit the same mangling, and the check would fail on it.

🤖 Generated with Claude Code

Fishbowler and others added 2 commits November 18, 2026 10:57
The macOS release asset was a tarball of the entire Xcode
build/macos/Build/Products/Release directory: ~1.3 GB unpacked
(396 MB compressed) of .o files, .swiftmodule directories, SwiftPM
resource bundles, duplicate frameworks and ~860 MB of dSYMs, with
wimsy.app buried inside.

Add tool/package_macos_dmg.sh, which stages only the app bundle
(copied with ditto to preserve framework symlinks, permissions and
the code signature) alongside an /Applications symlink for
drag-to-install, builds a compressed UDZO DMG, and runs
hdiutil verify on it. CI now runs this script and uploads/publishes
wimsy-macos.dmg instead of wimsy-macos.tar.gz.

The script deliberately does no signing: once Developer ID signing
is added, the app is signed before this step and the DMG is
notarized/stapled after it, with no change needed here.

dSYMs are no longer shipped to users.

Testing:
- Ran the script against the v0.0.6 release wimsy.app: produced a
  60 MB DMG (vs the 396 MB tarball) that passes hdiutil verify;
  mounted, it contains only wimsy.app and the Applications symlink;
  codesign --verify --deep --strict passes on the app inside and all
  18 framework symlinks are intact.
- Script exits 1 with a clear error when the app bundle is missing.
- A local `flutter build macos --release` could not be used for an
  end-to-end check: Xcode refuses to build the Runner target because
  its keychain-access-groups entitlement requires a development
  certificate. That is a separate, pre-existing issue.
- flutter analyze: no issues. flutter test: all 1044 passed.
  vendor/xmpp_stone dart test: all 190 passed.
- Maestro flows not run: no Android emulator available, and this
  change touches only CI packaging, not the app.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Add tool/verify_macos_dmg.sh and run it in the build-macos job
between packaging and upload. It mounts the DMG read-only at a
private mount point (always detached on exit) and checks that:

- the image passes hdiutil verify and mounts;
- the volume contains exactly wimsy.app and an Applications symlink
  pointing at /Applications;
- wimsy.app passes codesign --verify --deep --strict;
- the main executable is universal (x86_64 and arm64);
- CFBundleShortVersionString equals the expected version, when one
  is given.

All failures are reported before exiting non-zero.

CI passes the expected version only for v* tag builds. Flutter strips
every non-digit/non-dot character from the build name on Apple
platforms, so a pre-release version such as 0.0.6-pre-1197ec9
becomes 0.0.611979 in the bundle and cannot be compared.

These checks pass for the current ad-hoc signed build and remain
valid once Developer ID signing is added. Checks specific to that
signing (authority, hardened runtime, spctl, stapler) are left for
the change that introduces it.

Testing:
- Against the DMG built from the v0.0.6 wimsy.app: passes with no
  expected version and with 0.0.6.
- Negative cases, each exits 1 with a specific FAIL line: expected
  version 0.0.7; a tampered App.framework inside the app (codesign
  failure); an extra file on the volume plus an arm64-only app (both
  reported); a truncated DMG (verify and mount failures, remaining
  checks skipped); a missing DMG path.
- No images left mounted after any case.
- shellcheck clean on both tool/*.sh scripts; workflow YAML parses
  with the new step between "Package macOS" and "Upload macOS
  artifact".
- flutter analyze: no issues. flutter test: all 1044 passed.
  vendor/xmpp_stone dart test: all 190 passed.
- Maestro flows not run: no Android emulator available, and this
  change touches only CI packaging, not the app.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@dwd
dwd merged commit add00d0 into dwd:main Nov 19, 2026
7 of 14 checks passed
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