Skip to content

ci(build): fix macOS DMG step running out of disk space#30

Merged
nelsonduarte merged 4 commits into
mainfrom
ci/macos-build-fix
Apr 30, 2026
Merged

ci(build): fix macOS DMG step running out of disk space#30
nelsonduarte merged 4 commits into
mainfrom
ci/macos-build-fix

Conversation

@nelsonduarte
Copy link
Copy Markdown
Owner

Summary

  • Drops Xcode (~16 GB) before the macOS PyInstaller build so hdiutil has scratch space to create the DMG.
  • Switches the .app copy from cp -R to mv to avoid a redundant ~400 MB duplicate of the bundle.
  • Re-points xcode-select at CommandLineTools (still installed) so /usr/bin/lipo keeps resolving — PyInstaller calls lipo -thin arm64 while assembling the EXE and dies without it.

Why this PR exists separately

These two commits were originally pushed to main and tagged as v1.13.4 without local validation. The first attempt failed (hdiutil: No space left on device); the second attempt removed CommandLineTools and broke lipo; the third attempt was deleted before completing. The unverified state has been reverted from main and isolated here for proper validation via workflow_dispatch before merge.

Validation plan

  • workflow_dispatch against this branch — full matrix (Windows / Linux / macOS) must pass on a non-tag run.
  • DMG artifact is uploadable (no No space left on device).
  • Build (macOS) step completes without lipo errors.
  • Linux + Windows still pass (sanity — no behaviour change for them).

After all four are green, merge to main and create the next release tag.

Risk

Touches only .github/workflows/build.yml, only the macOS branch (if: runner.os == 'macOS'). Linux and Windows steps are untouched.

🤖 Generated with Claude Code

nelsonduarte and others added 4 commits April 30, 2026 11:46
The macos-latest runner ships with Xcode + CommandLineTools (~25 GB)
which neither the PyInstaller build nor hdiutil need. Combined with
the previous `cp -R dist/PDFApps.app dist/dmg/` (which duplicated
the ~400 MB bundle), hdiutil ran out of scratch space when building
the DMG.

  - Drop Xcode and CommandLineTools before the build.
  - Switch the .app copy to a move — we don't need to keep the
    source after the DMG is sealed.

Fixes the v1.13.4 release run (job 73745882318) where PyInstaller
finished but the DMG step failed with "No space left on device".

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
The previous "Free macOS disk space" step removed both Xcode and
CommandLineTools (~25 GB). That freed enough disk, but PyInstaller
needs lipo / codesign / otool from CommandLineTools to slice fat
Mach-O binaries to arm64 — without them the build dies with:

  SystemError: lipo command (['lipo', '-thin', 'arm64', ...])
  failed with error code 1!

Keep CommandLineTools. Removing Xcode alone (~16 GB) is enough for
the DMG step. After the removal xcode-select still points at the
deleted Xcode bundle, so explicitly point it at CommandLineTools so
/usr/bin/lipo and friends resolve.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
PR #30's previous attempt freed Xcode (~16 GB) but hdiutil still hit
"No space left on device" because the PyInstaller build/ tree
(~3-7 GB) and APFS local snapshots were still on disk when the DMG
step ran.

- Drop APFS local snapshots after removing Xcode so reclaimed bytes
  actually leave the volume.
- Remove build/, the PyInstaller bootloader cache, and the loose
  dist/PDFApps exe right after PyInstaller finishes — none are
  needed for the DMG, only dist/PDFApps.app is.
- Add df -h checkpoints around every cleanup so the next failure
  log tells us where the disk actually went.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
The previous attempt's df -h showed 83 GB free when hdiutil failed
with "No space left on device" — disk wasn't the bottleneck. The
real failure was inside the mounted /Volumes/PDFApps/ image: the
PDFApps.app has thousands of small Qt files and HFS+ slack space
overran hdiutil's auto-estimated sparse-image size while it was
copying contents in.

Pass -size 1g explicitly so the intermediate has plenty of room.
UDZO compression keeps the final .dmg much smaller than 1 GB.

Also widen df -h to all volumes and add du -sh / ls -lh so the next
log shows the real .app and .dmg sizes if anything still misbehaves.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@nelsonduarte nelsonduarte merged commit 82a8277 into main Apr 30, 2026
8 checks passed
@nelsonduarte nelsonduarte deleted the ci/macos-build-fix branch May 4, 2026 15:32
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.

1 participant