Closed Bug 2057039 Opened 4 months ago Closed 14 days ago

[macOS 27] Replace use of the deprecated hdiutil command in the tree

Categories

(Core :: Widget: Cocoa, defect)

defect

Tracking

()

RESOLVED FIXED
163 Branch
Tracking Status
firefox163 --- fixed

People

(Reporter: haik, Assigned: mferreiro, Mentored)

References

(Blocks 1 open bug)

Details

(Whiteboard: [FIDE-engagement])

Attachments

(7 external files)

The macOS hdiutil command is now deprecated. We should replace the use of it with the diskutil command.

This is documented in the hdiutil(1) man page on macOS 27:

     macOS 27.0:

           •   hdiutil is deprecated. Use diskutil image instead for all disk
               image operations.

           •   ASIF (Apple Sparse Image Format) images are not supported by
               hdiutil.  Use diskutil image to create and manipulate ASIF
               images.
See Also: → 2057036
Severity: -- → S4
Summary: Replace use of the deprecated hdiutil command in the tree → [macOS 27] Replace use of the deprecated hdiutil command in the tree

Mauro, thank you for your help. Would you be able to take a look at this? The complexity here will be to check if older versions of macOS and/or CI workers still need hdiutil and whether or not we need a fallback in those cases. Please don't hesitate to reach out with any questions.

Assignee: nobody → mferreiro
Mentor: spohl.mozilla.bugs
Status: NEW → ASSIGNED
Whiteboard: [FIDE-engagement]

Hi team!
I have one doubt about the file tools/update-verify/release/common/installdmg.ex. It still calls hdiutil attach, but as far as I can tell nothing uses it, so I'd rather remove it than port it to diskutil.

  • It came in with the rest of update-verify when it was imported from build-tools in bug 1509962, and nothing in the tree has referenced it since: not the update-verify scripts (verify.sh, unpack.sh, check_updates.sh), not the taskcluster transforms, not mozharness. On macOS, unpack.sh mounts DMGs with unpack-diskimage.sh instead.
  • The update-verify Docker image copies tools/update-verify as a whole rather than listing files, so removing it only changes the image contents.
  • It is an expect script that accepts the license agreement hdiutil used to show for older Firefox DMGs. Porting it isn't a drop-in change: diskutil has no equivalent of -mountroot, and I don't know how diskutil image attach handles a DMG with a license agreement. With no caller, there is nothing to test a port against.

Does anyone know of a use outside mozilla-central, e.g. a release or local workflow that runs it by path?
Claude recommends removing it, but I rather ask before doing it, just in case.

hdiutil is deprecated as of macOS 27. The image keeps an Apple partition map and
uses zlib (UDZO) so that libdmg-hfsplus can still read it.

diskutil doesn't exit with EBUSY when the volume is busy, so retry when it
reports an unmount dissent instead. Also drop the unreachable forced detach,
and keep stderr out of the plist output of diskutil image attach.

This also mounts the latest Nightly with -nobrowse, like extract_from_dmg does.

Hello team!

I have submitted all the patchs on Phabricator and the review is ready.
If we decide to remove the installdmg.ex file, I can add an extra patch.

I don´t have permissions on Lando, so I couldn´t do a ./mach try to test all the CI builds. I would appreciate if you can do it for me. It is important to check that CI still works with all these changes.

I kept the hdiutil fallbacks for some reasons:

  • hdiutil is only deprecated as of macOS 27. It works without warnings on earlier versions, so there was no reason to change anything there. That's why every check uses >= 27.

  • Lower risk. On macOS 26 and earlier, the behavior stays the same as before, which is already tested. The differences in the diskutil path only affect macOS 27 and later: zlib (UDZO) instead of bzip2 (UDBZ), which gives somewhat larger DMGs, and no Finder window opening when the volume is mounted.

The fallbacks can be removed once Firefox drops support for those older macOS versions and CI moves to newer workers.

Pushed by spohl@mozilla.com: https://github.com/mozilla-firefox/firefox/commit/4b5d2cd1d58a https://hg.mozilla.org/integration/autoland/rev/3ea4202304e5 Use diskutil instead of hdiutil to create DMGs in mozpack on macOS 27+. r=spohl,browser-installer-reviewers
Status: ASSIGNED → RESOLVED
Closed: 14 days ago
Resolution: --- → FIXED
Target Milestone: --- → 163 Branch
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: