Skip to content

ci(macos): size DMGs explicitly so hdiutil stops failing with 'No space left on device' - #1236

Open
alandebortolo wants to merge 1 commit into
Snapmaker:mainfrom
DesignMaster-Solutions:fix/macos-dmg-size
Open

alandebortolo wants to merge 1 commit into
Snapmaker:mainfrom
DesignMaster-Solutions:fix/macos-dmg-size

Conversation

@alandebortolo

Copy link
Copy Markdown

Problem

The macOS job on main has failed on every run since 2026-11-19 at the DMG step, right after the main DMG is created:

created: .../Snapmaker_Orca_Mac_universal_V2.4.2.dmg
hdiutil: create failed - No space left on device
could not access /Volumes/Snapmaker_Orca Profile Validator/Snapmaker_Orca_profile_validator.app/Contents/MacOS/Snapmaker_Orca_profile_validator - No space left on device

Runs: 44657297727, 44810676578, 44865760084.

It is not the runner disk. In 44865760084 the "Free disk space before DMG packaging" step (#1144) leaves 74 GiB free on /System/Volumes/Data a few seconds before the failure. The volume that runs out is the one inside the image: hdiutil create -srcfolder without -size estimates the image from the blocks the source folder has allocated, and the copy into the mounted image then hits ENOSPC.

Fix

Before each of the 4 hdiutil create calls (notarized and non-notarized steps), compute the size from the apparent byte count and pass it explicitly:

SIZE_MB=$(( $(du -sAk <srcfolder> | cut -f1) / 1024 * 12 / 10 + 64 ))
hdiutil create ... -srcfolder <srcfolder> -size "${SIZE_MB}m" -ov -format UDZO ...

-size only sets the scratch volume; UDZO still compresses the result, so the final DMG size does not grow.

How I checked it

On macOS (Darwin 27.2, hdiutil from the system), with a folder shaped like the validator DMG (V.app/Contents/MacOS/V + Applications -> /Applications) where the binary is an 800 MiB file with holes (du reports 16K):

  • current command: hdiutil: create failed - No space left on device (same message as CI);
  • the patched lines from this PR, run as-is with the path substituted: DMG created, hdiutil verify VALID, mounted and the 838,860,800-byte binary is inside.

Limits

  • I did not confirm that the real validator binary is sparse; the local repro shows the mechanism that produces this exact error, and the explicit size removes the dependency on the estimate either way.
  • I did not run the full macOS job: my fork has no deps cache and its Build Deps currently stops earlier, in brew install zstd (separate issue). The workflow YAML parses.

…h ENOSPC

The profile validator DMG fails on every main run since 2026-11-19 with 'hdiutil: create failed - No space left on device' while the runner still has 74 GiB free. hdiutil -srcfolder sizes the image from allocated blocks; pass -size from du -A plus 20% and 64 MiB.
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