-
Notifications
You must be signed in to change notification settings - Fork 135
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
DMG creation fails on macOS Big Sur 11.0.1 on M1 hardware (aarch64) #184
Comments
I will make a merge request so you can see my suggestion to fix this issue on macOS aarch64 |
Hi @AstroPixelProcessor! |
Hi @fvarrui , my proposal will not work on quite a bit older MacOS versions, I think older than 10.13. Therefore I think it is safe to only do this on aarch64 architecture where macOS that old does not exist. I will make a push request ;-) |
Having issues to push somehow, this is how it will work @fvarrui 👍 |
// creates image
|
Ah, ok, great!! nice solution!!! ... so, it depends on the architecture instead on the OS version. Thanks! I think this will keep backward compatibility |
Yes it should ;-) |
Don't worry about where you push your PR ... I can rebase it, sorry for being so picky 😅 |
@fvarrui Pull Request is created :-) |
Branch |
JavaPackager v1.6.7 released to Maven Central. See changes here. |
I'm submitting a…
Short description of the issue/suggestion:
DMG creation is not possible on aarch64 hardware. It fails on the line
execute("hdiutil", "create", "-srcfolder", appFolder, "-volname", volumeName, "-ov", "-fs", "HFS+", "-format", "UDRW", tempDmgFile);
in GenerateDMG.java.
I have confirmed that this does work on x86_64 hardware Big Sur 11.0.1, so it seems it is really specific to the aarch64 version of hdiutil.
The error message is :
[INFO] Executing command: /bin/sh -c cd '/Users/mabula/IdeaProjects/astropixelprocessor-jdk17/.' && 'hdiutil' create -srcfolder /Users/mabula/IdeaProjects/astropixelprocessor-jdk17/target/astropixelprocessor -volname astropixelprocessor-1.1.0 -ov -fs HFS+ -format UDRW /Users/mabula/IdeaProjects/astropixelprocessor-jdk17/target/assets/astropixelprocessor_1.1.0.dmg
[INFO] could not access /Volumes/astropixelprocessor-1.1.0/astropixelprocessor.app/Contents/PlugIns/jre/Contents/Home/.BC.T_xQRv4X - Operation not permitted
[ERROR] hdiutil: create failed - Operation not permitted
[ERROR] DMG image generation failed due to: Command execution failed: hdiutil create -srcfolder /Users/mabula/IdeaProjects/astropixelprocessor-jdk17/target/astropixelprocessor -volname astropixelprocessor-1.1.0 -ov -fs HFS+ -format UDRW /Users/mabula/IdeaProjects/astropixelprocessor-jdk17/target/assets/astropixelprocessor_1.1.0.dmg
[ERROR]
org.codehaus.plexus.util.cli.CommandLineException: Command execution failed: hdiutil create -srcfolder /Users/mabula/IdeaProjects/astropixelprocessor-jdk17/target/astropixelprocessor -volname astropixelprocessor-1.1.0 -ov -fs HFS+ -format UDRW /Users/mabula/IdeaProjects/astropixelprocessor-jdk17/target/assets/astropixelprocessor_1.1.0.dmg
at io.github.fvarrui.javapackager.utils.CommandUtils.execute (CommandUtils.java:19)
at io.github.fvarrui.javapackager.utils.CommandUtils.execute (CommandUtils.java:29)
at io.github.fvarrui.javapackager.packagers.GenerateDmg.doApply (GenerateDmg.java:88)
at io.github.fvarrui.javapackager.packagers.GenerateDmg.doApply (GenerateDmg.java:22)
What is the expected behavior?
DMG should be created
What is the current behavior?
DMG creation fails
Suggestion with tested solution:
Do a check on the hardware architecture and if aarch64/arm then build the DMG with the newer APFS filesystem.
execute("hdiutil", "create", "-srcfolder", appFolder, "-volname", volumeName, "-ov", "-fs", "APFS", "-format", "UDRW", tempDmgFile);
The bless command fails then, but you can simply disable the bless command, since the DMG is properly created with APFS filesystem in that case.
// no longer needed
//Logger.info("Blessing ...");
//execute("bless", "--folder", mountFolder, "--openfolder", mountFolder);
Google searches seem to indicate that hdiutil on aarch64 actually is broken for HFS+ somehow... or perhaps Apple is forcing us to no longer use it since APFS is better ? I have no clue at the moment what is happening, I only know that hdiutil with HFS+ is a problem right now on aarch64, many problems are encountered with google search on this.)
Please tell us about your environment:
The text was updated successfully, but these errors were encountered: