Skip to content

Check whether the DMG is still mounted instead of trusting detach - #23

Merged
afrojun merged 1 commit into
mainfrom
fix/dmg-detach-mounted
Nov 5, 2026
Merged

afrojun merged 1 commit into
mainfrom
fix/dmg-detach-mounted

Conversation

@afrojun

@afrojun afrojun commented Nov 5, 2026

Copy link
Copy Markdown
Owner

Summary

 package-dmg.sh  (after Finder lays out the DMG window)
-  retry: if hdiutil detach succeeds, stop
-  else force
+  retry: hdiutil detach, then stop once hdiutil info no longer lists the mount point
+  force only if it is still mounted
+  a failed hdiutil info stops the script

Follow-up to #20. A detach that reports "Resource busy" can still unmount a moment later, after which every retry fails with "No such file or directory" and the forced detach failed the build.

Evidence

  • Before: Halve the Chrome Web Store description #22's validate failed with hdiutil: detach failed - No such file or directory after ten silent retries.
    After: stub probes finish with the volume detached when it detaches at once, reports busy and then unmounts, or stays busy (forced). When hdiutil info fails, the script exits 1.
  • Pre-push review round 1 found that hdiutil info | grep -q under pipefail could misreport a mounted volume via SIGPIPE. Fixed by capturing the output first. Round 2 found nothing.

Merge Danger

Door: two-way

Blast Radius: packaging

CI and the release workflow both run package-dmg.sh.

🤖 Generated with Claude Code

A detach that reports "Resource busy" can still unmount the volume a moment
later. Every retry after that failed with "No such file or directory", so
the loop gave up and the forced detach failed the build, as it did on #22.
Each retry now checks hdiutil info for the mount point and stops once it is
gone, and the forced detach runs only if the volume is still mounted. The
check captures hdiutil info before searching it, so pipefail cannot misread
an early grep exit, and a failed query stops the script.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@afrojun
afrojun merged commit 0ea22d5 into main Nov 5, 2026
2 checks passed
@afrojun
afrojun deleted the fix/dmg-detach-mounted branch November 5, 2026 03:19
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