ci(build): fix macOS DMG step running out of disk space#30
Merged
Conversation
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
hdiutilhas scratch space to create the DMG..appcopy fromcp -Rtomvto avoid a redundant ~400 MB duplicate of the bundle.xcode-selectatCommandLineTools(still installed) so/usr/bin/lipokeeps resolving — PyInstaller callslipo -thin arm64while assembling the EXE and dies without it.Why this PR exists separately
These two commits were originally pushed to
mainand tagged asv1.13.4without local validation. The first attempt failed (hdiutil: No space left on device); the second attempt removedCommandLineToolsand brokelipo; the third attempt was deleted before completing. The unverified state has been reverted frommainand isolated here for proper validation viaworkflow_dispatchbefore merge.Validation plan
workflow_dispatchagainst this branch — full matrix (Windows / Linux / macOS) must pass on a non-tag run.No space left on device).Build (macOS)step completes withoutlipoerrors.After all four are green, merge to
mainand 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