fix(release): rebuild DMG from scratch via bundle_dmg.sh (supersedes #952/#955)#957
Conversation
…zation Replaces the round-trip-then-modify approach in repackage-dmg.sh, which fails consistently on macOS 26.x runners with `hdiutil: convert failed - internal error` when re-compressing a UDZO→UDRW→modified→UDZO image. Earlier attempts (retry loop, temp output path, hdiutil compact) did not help — the failure is structural in current hdiutil. Tauri's own bundle_dmg.sh builds a fresh UDRW from a source folder via `hdiutil create -srcfolder` and then converts to UDZO; that path works. - Reuse `<bundle_dir>/dmg/bundle_dmg.sh` (left on disk by tauri-build) with the same volname / icon positions / window size / background defaults Tauri uses, packaging the now-notarized .app from `<bundle_dir>/macos/`. - Stage a non-local .app into MACOS_DIR (handles the case where the caller passes the .app from somewhere else than the bundle layout). - Resolve every bundle path absolute so the cd-then-invoke flow doesn't break. Pre-clean any leftover `rw.*.dmg` scratch files. - Notarization, log-fetch-on-failure, stapling, and final mount/layout verification logic preserved. Verified locally end-to-end against `OpenHuman.app` from the debug bundle: bundle_dmg.sh produced a 176M UDZO DMG, Apple notary returned status: Accepted, issues: null, stapler succeeded, mount verification confirmed OpenHuman.app + Applications symlink present. Reference failing CI run that motivated this rewrite: https://github.com/tinyhumansai/openhuman/actions/runs/24970255766/job/73111881422
|
Caution Review failedThe pull request is closed. ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughThe DMG re-packaging flow transitions from modifying an existing Tauri-built UDZO image in-place to rebuilding the DMG from scratch using Tauri's vendored Changes
Estimated code review effort🎯 4 (Complex) | ⏱️ ~45 minutes Possibly related PRs
Poem
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
Summary
Stops trying to mount-and-modify the Tauri-built DMG after notarization, and instead rebuilds it from scratch using the same
bundle_dmg.shTauri itself uses. The mount-and-modify approach (and every variant we tried — retry loop, temp output path,hdiutil compact) fails consistently on macOS 26.x runners with:after
UDZO → UDRW → modify → UDZO. The failure is structural in current hdiutil — modifying a converted UDRW and re-compressing it to UDZO is broken. Tauri's ownbundle_dmg.shbuilds a fresh UDRW from a source folder viahdiutil create -srcfolderand then converts to UDZO, which works fine.Approach
<bundle_dir>/dmg/bundle_dmg.shand<bundle_dir>/share/create-dmg/support/on disk after the original bundle pass. Reuse them.bundle_dmg.shagainst the (now-notarized)<bundle_dir>/macos/OpenHuman.appwith the same defaults Tauri passes (--volname OpenHuman,--icon OpenHuman.app 180 170,--app-drop-link 480 170,--window-size 660 400,--background images/background-dmg.png,--skip-jenkins).<bundle_dir>/dmg/<NAME>.dmg.MACOS_DIRif the caller passed it from elsewhere, so the source folder always contains the right (notarized) bundle.rw.*.dmgscratch files; resolve every path absolute so the cd-then-invoke flow doesn't break.Test plan
OpenHuman.appfrom the debug bundle:bundle_dmg.shproduced a 176M UDZO DMG, Apple notary returnedstatus: Accepted, issues: null,xcrun stapler staplesucceeded, mount verification confirmedOpenHuman.app+Applicationssymlink present.Re-package DMG after notarizationsucceeds and the resulting DMG has the expected layout.Supersedes
Reference failing run: https://github.com/tinyhumansai/openhuman/actions/runs/24970255766/job/73111881422
Summary by CodeRabbit