feat: add size option to DmgOptions for explicit DMG filesystem size#9543
Conversation
Add `size` option to DmgOptions to allow specifying the DMG filesystem size explicitly. This fixes "No space left on device" errors when building DMGs for large applications or applications with sparse files. The size option accepts the same syntax as hdiutil's `-size` argument (e.g., "150m", "4g"). If not specified, the size is calculated automatically (existing behavior). Fixes #8223
🦋 Changeset detectedLatest commit: bbe61d3 The changes in this PR will be included in the next version bump. This PR includes changesets to release 8 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
|
Thanks for opening a PR! Can you please also run |
- Add `shrink` option (defaults to true) to control filesystem shrinking - Test uses `shrink: false` to verify filesystem size retention Depends on: dmgbuild/dmgbuild#280
|
Thanks for the review! I've made the following updates: 1. Added changeset as requested. 2. Added To properly verify that the explicit filesystem size is retained in the final DMG, I needed to add a By default, dmgbuild runs To test that the filesystem actually retains a specific size (e.g., 500MB), we need to disable this shrinking behavior. So I created a follow-up PR to dmgbuild:
The The test now uses Let me know if you'd like any adjustments! |
|
Nicely done! I really like this. Next steps is to open a PR to pull in latest dmgbuild into our portable/closed-loop toolsets is to update the commit hash here to latest electron-builder/packages/dmg-builder/src/dmgUtil.ts Lines 27 to 28 in e394e0c It's a few-but-simple hoops to jump through ever since I recently got that build pipeline set up. :D |
|
Thanks for the feedback! Updated the Also created the PR to update dmgbuild in electron-builder-binaries: Once that's merged and deployed with new binaries, I'll bump the |
|
Boomshakalaka |
|
pewpewpew! Bumped to dmg-builder@1.2.0 with the new checksums. Thank you!! |
Summary
Add
sizeoption toDmgOptionsto allow specifying the DMG filesystem size explicitly. This fixes "No space left on device" errors when building DMGs for large applications (>2GB) or applications with sparse files.The size option accepts the same syntax as hdiutil's
-sizeargument (e.g.,"150m","4g"). If not specified, the size is calculated automatically (existing behavior).Changes
sizeproperty toDmgOptionsinterface inmacOptions.tssizeto JSON schema validation inscheme.jsonsizetoDmgBuildConfiginterface indmg.tssizethrough to dmgbuild settings indmgUtil.tsUsage
Dependency
This PR requires a corresponding change in dmgbuild to read the
sizeoption from JSON configuration files:Once the dmgbuild PR is merged and electron-builder-binaries updates its bundled dmgbuild, this feature will be fully functional.
Fixes #8223