From 52910e314ce165e45a59401fc099ad67be9dfb1d Mon Sep 17 00:00:00 2001 From: nelsoduarte Date: Thu, 30 Apr 2026 11:14:27 +0100 Subject: [PATCH 1/4] ci(build): fix macOS DMG creation running out of disk space MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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) --- .github/workflows/build.yml | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 4b06ea1..e308844 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -76,13 +76,27 @@ jobs: path: dist/PDFApps-Linux.tar.gz # ── macOS ─────────────────────────────────────────────────── + - name: Free macOS disk space + if: runner.os == 'macOS' + # Default macos-latest image ships with Xcode + CommandLineTools + # (~25 GB combined). Our build is pure Python wheels — neither + # is used. Without this, hdiutil runs out of scratch space + # while building the DMG. + run: | + sudo rm -rf /Applications/Xcode*.app + sudo rm -rf /Library/Developer/CommandLineTools + df -h / + - name: Build (macOS) if: runner.os == 'macOS' run: | python -m PyInstaller --noconfirm pdfapps.spec - # Create DMG with the .app bundle and an Applications shortcut + # Create DMG with the .app bundle and an Applications + # shortcut. `mv` (not cp -R) — we don't need to keep the + # source .app after the DMG is built, and avoiding the + # duplicate keeps the runner well below its disk quota. mkdir -p dist/dmg - cp -R dist/PDFApps.app dist/dmg/ + mv dist/PDFApps.app dist/dmg/ ln -s /Applications dist/dmg/Applications hdiutil create -volname "PDFApps" \ -srcfolder dist/dmg \ From bd346893f53993e0eb0df7ba84bcc47299f8eeb6 Mon Sep 17 00:00:00 2001 From: nelsoduarte Date: Thu, 30 Apr 2026 11:24:56 +0100 Subject: [PATCH 2/4] ci(build): keep CommandLineTools when freeing macOS disk space MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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) --- .github/workflows/build.yml | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index e308844..10e8a80 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -78,13 +78,18 @@ jobs: # ── macOS ─────────────────────────────────────────────────── - name: Free macOS disk space if: runner.os == 'macOS' - # Default macos-latest image ships with Xcode + CommandLineTools - # (~25 GB combined). Our build is pure Python wheels — neither - # is used. Without this, hdiutil runs out of scratch space - # while building the DMG. + # macos-latest ships with Xcode (~16 GB) which our pure-Python + # build doesn't use. Removing it frees enough disk for hdiutil + # to create the DMG. We keep CommandLineTools because + # PyInstaller calls lipo / codesign / otool to slice and re- + # sign Mach-O binaries — without those, the build dies with + # "lipo command ... failed with error code 1". run: | sudo rm -rf /Applications/Xcode*.app - sudo rm -rf /Library/Developer/CommandLineTools + # The default xcode-select path points at the (now gone) + # Xcode bundle; redirect to CommandLineTools so /usr/bin/lipo + # and friends resolve. + sudo xcode-select -s /Library/Developer/CommandLineTools || true df -h / - name: Build (macOS) From fd6a9983e1a9b922c5b2140560fa1da2b15fc3f3 Mon Sep 17 00:00:00 2001 From: nelsoduarte Date: Thu, 30 Apr 2026 14:28:09 +0100 Subject: [PATCH 3/4] ci(build): clean PyInstaller intermediates before hdiutil on macOS MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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) --- .github/workflows/build.yml | 39 +++++++++++++++++++++++++++++-------- 1 file changed, 31 insertions(+), 8 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 10e8a80..0399e77 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -79,23 +79,44 @@ jobs: - name: Free macOS disk space if: runner.os == 'macOS' # macos-latest ships with Xcode (~16 GB) which our pure-Python - # build doesn't use. Removing it frees enough disk for hdiutil - # to create the DMG. We keep CommandLineTools because - # PyInstaller calls lipo / codesign / otool to slice and re- - # sign Mach-O binaries — without those, the build dies with - # "lipo command ... failed with error code 1". + # build doesn't use. Removing it plus dropping APFS local + # snapshots frees enough disk for hdiutil to create the DMG. + # We keep CommandLineTools because PyInstaller calls + # lipo / codesign / otool to slice and re-sign Mach-O binaries + # — without those, the build dies with "lipo command ... + # failed with error code 1". run: | + echo "── before cleanup ──" + df -h / sudo rm -rf /Applications/Xcode*.app - # The default xcode-select path points at the (now gone) - # Xcode bundle; redirect to CommandLineTools so /usr/bin/lipo - # and friends resolve. + # Default xcode-select path points at the (now gone) Xcode + # bundle; redirect to CommandLineTools so /usr/bin/lipo and + # friends keep resolving. sudo xcode-select -s /Library/Developer/CommandLineTools || true + # Without this, the bytes freed by `rm -rf Xcode` are still + # reserved by Time Machine local snapshots and df doesn't + # actually drop. + sudo tmutil deletelocalsnapshots / || true + echo "── after cleanup ──" df -h / - name: Build (macOS) if: runner.os == 'macOS' run: | + echo "── before PyInstaller ──" + df -h / python -m PyInstaller --noconfirm pdfapps.spec + echo "── after PyInstaller ──" + df -h / + # PyInstaller intermediates (~3-7 GB in build/ + the + # bootloader cache) and the loose Unix exe under dist/ are + # not needed for the DMG — only dist/PDFApps.app is. Clear + # them so hdiutil has scratch space to build the disk image. + rm -rf build/ + rm -rf "$HOME/Library/Application Support/pyinstaller" + rm -f dist/PDFApps + echo "── after intermediates cleanup ──" + df -h / # Create DMG with the .app bundle and an Applications # shortcut. `mv` (not cp -R) — we don't need to keep the # source .app after the DMG is built, and avoiding the @@ -107,6 +128,8 @@ jobs: -srcfolder dist/dmg \ -ov -format UDZO \ dist/PDFApps-macOS.dmg + echo "── after DMG ──" + df -h / - name: Upload (macOS) if: runner.os == 'macOS' From e06302563c5e9680f871ccfba560118095c6ba54 Mon Sep 17 00:00:00 2001 From: nelsoduarte Date: Thu, 30 Apr 2026 15:15:55 +0100 Subject: [PATCH 4/4] ci(build): force hdiutil sparse image to 1 GB to fix DMG creation MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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) --- .github/workflows/build.yml | 27 ++++++++++++++++++--------- 1 file changed, 18 insertions(+), 9 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 0399e77..c86ed05 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -104,32 +104,41 @@ jobs: if: runner.os == 'macOS' run: | echo "── before PyInstaller ──" - df -h / + df -h python -m PyInstaller --noconfirm pdfapps.spec echo "── after PyInstaller ──" - df -h / + df -h + du -sh dist/PDFApps.app # PyInstaller intermediates (~3-7 GB in build/ + the # bootloader cache) and the loose Unix exe under dist/ are - # not needed for the DMG — only dist/PDFApps.app is. Clear - # them so hdiutil has scratch space to build the disk image. + # not needed for the DMG — only dist/PDFApps.app is. rm -rf build/ rm -rf "$HOME/Library/Application Support/pyinstaller" rm -f dist/PDFApps - echo "── after intermediates cleanup ──" - df -h / # Create DMG with the .app bundle and an Applications # shortcut. `mv` (not cp -R) — we don't need to keep the - # source .app after the DMG is built, and avoiding the - # duplicate keeps the runner well below its disk quota. + # source .app after the DMG is built. mkdir -p dist/dmg mv dist/PDFApps.app dist/dmg/ ln -s /Applications dist/dmg/Applications + du -sh dist/dmg + # The previous `hdiutil create -srcfolder` (no -size) + # auto-estimated the intermediate sparse image too tight and + # died with "No space left on device" while *copying into + # the new DMG* — i.e. the runner had 83 GB free, but the + # mounted image at /Volumes/PDFApps/ ran out of bytes mid- + # copy. The .app has thousands of tiny files (Qt + # frameworks, qtawesome fonts, etc.) so HFS+ slack space + # blows past the auto-estimate. Force the intermediate to + # 1 GB; UDZO compression makes the final .dmg much smaller. hdiutil create -volname "PDFApps" \ -srcfolder dist/dmg \ -ov -format UDZO \ + -size 1g \ dist/PDFApps-macOS.dmg echo "── after DMG ──" - df -h / + df -h + ls -lh dist/PDFApps-macOS.dmg - name: Upload (macOS) if: runner.os == 'macOS'