Skip to content

Claude/fix dmg creation error wd ckg#15

Open
baoxingjie wants to merge 5 commits intoUnicomAI:mainfrom
baoxingjie:claude/fix-dmg-creation-error-WdCKG
Open

Claude/fix dmg creation error wd ckg#15
baoxingjie wants to merge 5 commits intoUnicomAI:mainfrom
baoxingjie:claude/fix-dmg-creation-error-WdCKG

Conversation

@baoxingjie
Copy link
Copy Markdown
Collaborator

Problem

bash scripts/build-all.sh mac-arm64 fails at the [4/4] DMG creation step with
"hdiutil: create failed - 资源忙", which is actually ENOSPC (no space left on device)
misreported by create-dmg.

Root cause: Electron Framework uses hardlinks extensively. create-dmg estimates
the .app size via du, which counts hardlinked inodes only once. But hdiutil
copies each hardlinked file as an independent file, consuming more space than the
DMG was allocated, causing the copy to fail.

Fix

Stage the .app to a temp directory before passing it to create-dmg, breaking
hardlinks so du's size estimate matches the actual bytes written.

  • Use ditto (macOS-native) instead of rsync --no-hard-links, because macOS
    ships with BSD rsync 2.6.9 which does not support --no-hard-links.

Also added

  • scripts/uninstall-mac.sh: one-click uninstall script that removes the app,
    all data/caches/prefs, and the hexagent Lima VM instance.

claude added 4 commits March 26, 2026 08:40
create-dmg uses `du` to estimate app size, but Electron Framework's
hardlinks cause `du` to undercount. hdiutil copies each hardlinked file
independently, exhausting DMG space and failing with ENOSPC (misreported
as "resource busy"). Fix by staging the app with rsync --no-hard-links
to break hardlinks before passing to create-dmg.

https://claude.ai/code/session_01S1crsR6m3fZEHYGpCuDiEJ
macOS ships with BSD rsync 2.6.9 which does not support --no-hard-links.
Switch to `ditto`, a macOS-native tool that copies .app bundles correctly
(preserving xattrs, symlinks, resource forks) without preserving hardlinks,
ensuring create-dmg gets an accurate size estimate.

https://claude.ai/code/session_01S1crsR6m3fZEHYGpCuDiEJ
Removes HexAgent.app, all app data/caches/prefs, and the hexagent
Lima VM instance (stops if running, then deletes via limactl).
Supports --force flag to skip the confirmation prompt.

https://claude.ai/code/session_01S1crsR6m3fZEHYGpCuDiEJ
@an7tang
Copy link
Copy Markdown
Collaborator

an7tang commented Mar 27, 2026

Rebase to latest main branch and ask @xuelin-cell to approve the PR

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.

4 participants