Problem
The one-step hdiutil create -srcfolder path can create a volume that is too small for a compiled Bun application bundle on the Intel macOS runner. The copy into /Volumes/craft-lifecycle/... fails with No space left on device even after the workflow avoids the unrelated Stacks dependency graph. The same lifecycle passes on macOS arm64.
Observed in stacksjs/stacks PR #2064 desktop run 29888261337 on macOS x64.
Required contract
- Derive image capacity from the complete app bundle size plus explicit filesystem and partition overhead.
- Pass an explicit
hdiutil -sizevalue, which overrides the undersized source-folder default. - Reject invalid capacity inputs before invoking native tools.
- Preserve native tool output in actionable errors.
- Add deterministic sizing and command tests, then pass the native Intel macOS lifecycle.
Implementation
Craft v0.0.46 derives capacity recursively, reserves 25 percent plus 32 MiB of overhead with a 64 MiB floor, and passes that value to hdiutil create -size. This follows the local hdiutil(1) contract directly and avoids a second writable-image lifecycle that would add mount, detach, conversion, and cleanup failure modes.