Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use APFS filesystem in DMGs? #253

Open
apjanke opened this issue Feb 1, 2024 · 3 comments
Open

Use APFS filesystem in DMGs? #253

apjanke opened this issue Feb 1, 2024 · 3 comments
Assignees
Labels
app-bundler The octave-app-bundler tool enhancement New feature or request macOS 11+ Support for macOS 11 through 14
Milestone

Comments

@apjanke
Copy link
Contributor

apjanke commented Feb 1, 2024

APFS (Apple File System) is the default filesystem on recent Macs, and has been for a while now. My build boxes for Octave.app use APFS, and I expect most current Octave.app users do too. Should we switch the DMGs to use APFS instead of HFS+?

Sub-tasks

  • Get create-dmg working with APFS volumes.
@apjanke apjanke self-assigned this Feb 1, 2024
@apjanke apjanke added enhancement New feature or request macOS 11+ Support for macOS 11 through 14 labels Feb 1, 2024
@apjanke apjanke added this to the 8.4.0 milestone Feb 1, 2024
@apjanke
Copy link
Contributor Author

apjanke commented Feb 1, 2024

Tried doing this, just switching from the default HFS+ filesystem to APFS by adding --filesystem APFS to the create-dmg call in octave_app_bundler. Didn't work; create-dmg errors out partway through, failing to detect where the "interstitial" disk image was mounted.

created: /Users/janke/repos/octave-app-bundler/build/cdmg_temp.rw.2070.Octave-8.4.0_beta1.dmg
running: hdiutil resize -size 3773m /Users/janke/repos/octave-app-bundler/build/cdmg_temp.rw.2070.Octave-8.4.0_beta1.dmg
Mounting disk image...
Device name:     /dev/disk4
Searching for mounted interstitial disk image for device /dev/disk4...
create-dmg: ERROR: Unable to proceed with final disk image creation because the interstitial disk image was not found.
The interstitial disk image will likely be mounted and will need to be cleaned up manually.
Expected device name: /dev/disk4
janke@scone:~/repos/octave-app-bundler $

I think this is because its find_mount_dir assumes there is only one "disk" inside the disk image. But the DMG I created looks like it has two "disks", and the volume is on the second disk. (Maybe this has something to do with APFS's virtual volume or whatever layer.) See how it's only looking under "disk4" above?

janke@scone:~/repos/octave-app-bundler $ sudo hdiutil attach -mountrandom /Volumes -readwrite -noverify -noautoopen -nobrowse ./build/cdmg_temp.rw.2070.Octave-8.4.0_beta1.dmg
/dev/disk4          	GUID_partition_scheme
/dev/disk4s1        	EFI
/dev/disk4s2        	Apple_APFS
/dev/disk5          	EF57347C-0000-11AA-AA11-0030654
/dev/disk5s1        	41504653-0000-11AA-AA11-0030654	/Volumes/dmg.0OE7RX
janke@scone:~/repos/octave-app-bundler $

The fix might be to change around the whole way that create-dmg is detecting the mount location by picking the first diskN and then looking "under" it for a partition. Maybe it should first grep the hdiutil attach output for "/Volumes" (or wherever the mountrandom path was), and search within that only when disambiguation of multiple volumes is needed.

@apjanke
Copy link
Contributor Author

apjanke commented Feb 1, 2024

Had to fix up create-dmg a bit to work with APFS filesystems. It wasn't detecting the mount path for the interstitial DMG mounted with hdiutil mountrandom, I think because APFS DMGs can have multiple "disks", not just multiple volumes on a single disk.

Fix on my fork of create-dmg is at apjanke/create-dmg@e5b38cf.

With that in place, I built an APFS DMG for beta1 on scone (AS), and it seemed to work. Trying on Intel next.

@apjanke apjanke added the app-bundler The octave-app-bundler tool label Feb 10, 2024
@apjanke
Copy link
Contributor Author

apjanke commented May 6, 2024

Changing the milestone for this from 8.4.0 to The Future, since there's no immediate need for it, just seems like a nice thing to do to "stay up to date" and experiment with.

@apjanke apjanke modified the milestones: 8.4.0, The Future May 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
app-bundler The octave-app-bundler tool enhancement New feature or request macOS 11+ Support for macOS 11 through 14
Projects
None yet
Development

No branches or pull requests

1 participant