Claude/fix dmg creation error wd ckg#15
Open
baoxingjie wants to merge 5 commits intoUnicomAI:mainfrom
Open
Conversation
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
Collaborator
|
Rebase to latest main branch and ask @xuelin-cell to approve the PR |
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.
Problem
bash scripts/build-all.sh mac-arm64fails 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-dmgestimatesthe .app size via
du, which counts hardlinked inodes only once. Buthdiutilcopies 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, breakinghardlinks so
du's size estimate matches the actual bytes written.ditto(macOS-native) instead ofrsync --no-hard-links, because macOSships 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
hexagentLima VM instance.