ihaveamac / ninfs

FUSE filesystem Python scripts for Nintendo console files
MIT License
436 stars 18 forks source link

Apple Silicon / M1 Mac issues #73

Closed mbirth closed 3 years ago

mbirth commented 3 years ago

I'm trying to get ninfs to work on a Late-2020 MacBook Pro with Apple's new M1 chip. I've got an ARM-native Python 3.9.1 installed via homebrew, pulled in the requirements via pip3, created a wheel from latest ninfs source and installed that wheel - but running mount_nandhac crashes:

mbirth ~/D/ninfs> mount_nandhac --keys prod.keys -o allow_other /dev/disk4 fuse
WARNING: /opt/homebrew/Cellar/python@3.9/3.9.1/Frameworks/Python.framework/Versions/3.9/Resources/Python.app/Contents/MacOS/Python is loading libcrypto in an unsafe way
fish: “mount_nandhac --keys prod_Thia.…” terminated by signal SIGABRT (Abort)

Don't know if the SIGABRT is a result of the libcrypto not loading "safely", or if those problems are unrelated and it crashes because of something else.

ihaveamac commented 3 years ago

I'm guessing that this is due to haccrypto including a copy of libcrypto for macOS which only supports Intel. Until it's updated, you can try replacing it with one with an arm64 slice. Copy the file from /opt/homebrew/Cellar/python@3.9/3.9.1/Library/Frameworks/Python.framework/Versions/3.9/lib/libcrypto.1.1.dylib (if it's there, not sure as I don't use python from homebrew) and put it to where haccrypto was installed:

After that try again. If it doesn't work, try another mount type (e.g. mount_3dsx with FBI.3dsx)

mbirth commented 3 years ago

Thanks for the hint! With openssl installed via brew, the file was in /opt/homebrew/Cellar/openssl@1.1/1.1.1i/lib/libcrypto.1.1.dylib. After copying it over the one in the haccrypto folder, mount_nandhac started to work fine.

Just had to allow the macFUSE kernel extension and reboot, but now it's mounting fine. Thanks a lot! :)