ReviewOS

craft-native/craft

fix(packaging): size macOS disk images for compiled binaries

#13
Closed chris opened this 22 days ago · 2 comments
22 days ago

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 -size value, 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.

22 days ago

Implemented at the core in 5c72c4a and released as Craft v0.0.46 at 83cd027. Focused sizing tests, the full 450-test Craft suite, typecheck, build, and a local end-to-end DMG/PKG lifecycle all pass. Stacks PR #2064 pins this exact release and is now running the native Intel macOS lifecycle.

Sign in to comment on this issue.