Repository navigation
fix(bootstrap): skip volume metadata when extracting DMGs - #13378
Conversation
Mounted DMGs carry volume metadata at their root, and some of it is unreadable: mysql-workbench-community-8.0.47 ships `.Trashes` with mode 0333, which made the copy out of the mount fail with EACCES. Skip Homebrew's DMG_METADATA names at the volume root, as `brew` does. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository YAML (base), Central YAML (inherited), Organization UI (inherited) Review profile: CHILL Plan: Advanced Run ID: 📒 Files selected for processing (1)
Included review availability: Your plan provides up to 10 included reviews per hour; 6 remain after this review. 📝 WalkthroughWalkthroughChangesDMG metadata filtering
Priority: ⬇️ Low Estimated code review effort: 2 (Simple) | ~10 minutes Change: Bug fix Suggested reviewers: 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
Instruction countsThe comparison never ran — an earlier step failed.
|
https://entire.io/gh/jdx/mise/trails/31
Installing a cask whose DMG has unreadable volume metadata at its root failed partway through extraction.
mysqlworkbenchis one example: its image ships.Trasheswith mode0333(no read bit for anyone), so:un_dmgmounted the image and copied the entire volume. Metadata such as.Trashes,.fseventsd,.DS_Storeand.backgroundwas included, and the copy failed on the first entry it couldn't read. DMG extraction now skips these entries at the volume root and copies everything else as before. The skip list is Homebrew'sDMG_METADATAlist, the same onebrew install --caskuses, so the cask installs.The same extraction code is used for aqua tools distributed as DMGs and for DMGs nested inside other cask archives, so both get the fix. Entries with these names deeper in the image, such as inside an
.appbundle, are still copied.Reported in #13361.
Validation
0333.Trashesand other metadata, and checks that the copy succeeds and that only root-level metadata is dropped. With the skip list removed, the test fails with the reporter'sPermission denied (os error 13).cargo test --bin mise file::tests(187 passed), clippy with-D warnings, andmise run lintpass.hdiutilisn't available in this Linux environment.AI-assisted — Tool: Claude Code; model: anthropic/claude-opus-5; version: 2.1.275.
🤖 Generated with Claude Code
Note
Low Risk
Targeted change to DMG copy behavior on macOS; aligns with Homebrew cask handling and only omits known root-level metadata, with a regression test for the permission-denied case.
Overview
DMG extraction no longer fails when macOS volume metadata at the image root is unreadable (e.g.
.Trasheswith mode0333onmysqlworkbench).un_dmgnow copies the mounted volume throughcopy_dmg_volume, which skips only top-level names from Homebrew’sDMG_METADATAlist (.Trashes,.DS_Store,.fseventsd, etc.) instead of walking the entire volume. Symlink-preserving directory copy gained an internalcopy_dir_all_preserve_symlinks_skippinghelper that usesWalkDir::filter_entryso those roots are never descended into; normalcopy_dir_all_preserve_symlinksbehavior is unchanged (empty skip list).Same-named paths inside app bundles or other subtrees are still copied. A unix unit test simulates mode-
0333.Trashesand asserts metadata is omitted while real payload (including nested.Trashes) remains.Reviewed by Cursor Bugbot for commit 4f47dba. Bugbot is set up for automated code reviews on this repo. Configure here.
Summary by CodeRabbit