-
Notifications
You must be signed in to change notification settings - Fork 3
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
Unpack DMG in pure mode #2
Comments
I started with undmg, but it doesn't work with APFS images. I tried 7zip but it doesn't work either. :( |
From what I see, the only other thing that possibly could work is And I don't know whether it would work in a sandbox either... |
No, I wouldn’t expect anything that mints something to work in sandbox. I guess the only way is to implement this in undmg or find a similar tool that supports APFS already. I don’t think there’s much can be done here, in this repo. Maybe try undmg and fallback to hdiutil if not in sandbox?.. |
I noticed that the Nixpkgs (p)7zip version is very outdated, current version seems to work with APFS images. It has some problems with symlinks though, so a little patching might be needed, but I hope I can manage it. |
How does this compare against how Homebrew itself handles |
Homebrew uses hdiutil, but they do not use sandbox or have a pure mode, so it's not an issue for them. |
Oh well, 7zip just won't compile with the Libsystem version available from Nixpkgs (the problem is with So it seems that at least until another tool that could unpack APFS .dmg is found, or Libsystem in Nixpkgs updated |
This seems like a bug to me. Maybe the fix needs to be upstreamed to nixpkgs? |
Not sure that’s feasible, at least not fully (for now?):
|
It looks like they need simply update, the Nixpkgs version is taken from I'll try to notify the Nixpkgs' Libsystem maintainers, but not before Monday. |
Yeah I think it’s a good idea to open an issue and @ the maintainers, whenever you have the time for it. |
After some more investigation I was able to use 7zip and it seems that it is able to unpack EDIT: also, now it's x86 only, I can probably add nix code for arm64, but I don't have an arm64 mac, so I will be unable to test either... EDIT2: reverted this, now dmg unpacking with 7zip is available on the EDIT3: now 7zip should support also arm64. |
@jacekszymanski Thanks! It doesn't seem to work on arm though:
|
I had a similar error on x86 and was too lazy to go through their makefiles, so I only patched that single semicolon 🤷 and hoped it will be enough for arm as well. Now I added a flag to make, so it should ignore this specific error (a warning indeed, but they have |
I have pushed the updated feature branch, now it should work for all DMGs using 7zip. At least it works for those some-teen which I checked. But all the checking was on an Intel mac. |
I'm testing on an arm mac and I could get some applications, like |
Hi, this issue is only about DMG unpacking. Docker will not work now on arm (and older x86 macos versions) as it uses variant binaries which is not yet supported. |
Thanks for responding. I'm specifically talking about the DMG for Docker—7zip will not unpack it. |
OK, I see. Indeed 7zip won't unpack Docker's dmg and neither will undmg (which is unsuitable anyway).
Now I think I'll post an issue to 7zip about this, but until they fix it not much can be done here. I'll write a fallback, so if 7zip fails, hdiutil will be used. Obviously applications which need this hack won't build in the sandbox. |
It would be great if you could mark such derivations with |
I'm working (not on this branch, and I haven't pushed it yet) on an overrides mechanism, so it will be possible to apply specific attributes to individual derivations. |
FWIW, I posted a bug on 7zip: https://sourceforge.net/p/sevenzip/bugs/2411/ |
It's strange, but hdiutil wouldn't attach the Docker dmg when called from nix, I don't know why. So for now, if an image fails to test with 7zip, I'm converting it to UDBZ (bzip2 compressed) and unpacking with 7zip, it seems to work this way, also it doesn't require mounting anything (but it still breaks the sandbox, as hdiutil is needed to convert the image). |
The next version of 7zip will support ULMO images, such as the Docker one. As for this branch, I think I'll merge it and move on; when the next 7zip is released, I will remove the hdiutil hack. |
The branch has been merged, I'm closing this issue. The next 7zip release is probably several months away. |
Current
unpackdmg.sh
is impure and will not work with sandbox. Consider usingundmg
that installs unpack hook.The text was updated successfully, but these errors were encountered: