Context : I'm developing a python app with Tkinter GUI on a 2020 M1 Macbook Air.
I have already built, signed, and notarized the app successfully on the native arm64 architecture - so far so good.
Now I am trying to do the same for x86_64, on the same machine. I've built a conda environment for x86_64, built the app with pyinstaller, and verified that it runs when I double-click on AppName.app. So far so good.
The problem happens when I sign it. After signing with the same command I used for the arm64 version:
codesign -s "Developer ID Application: MY_CERTIFICATE_NAME" -v --deep --timestamp --entitlements entitlements.plist -o runtime "dist/MyAppName.app" --force
Entitlements file just sets com.apple.security.cs.allow-unsigned-executable-memory
to true - apparently necessary for python programs.
The app now crashes when I double-click. The crash-log contains the line:
Termination Reason: Namespace ROSETTA, Code 0
rosetta error: unable to mmap __TEXT: 1
/var/db/*/libffi.8.dylib.aot
When I try to run from command line with
./projects/eagle_eyes_video_scanner/dist/EagleEyesScan.app/Contents/MacOS/main
I get another error:
rosetta error: unable to mmap __TEXT: 1
/var/db/oah/ffdfb26a8f1f835406614fae08b99665733faafa40599b6bc0aace0981564015/4893345e2743c970aa1c71f137e03f8e791c82b6b7354da038bebfac5673be73/libffi.8.dylib.aotzsh: abort ./projects/eagle_eyes_video_scanner/dist/EagleEyesScan.app/Contents/MacOS/mai
I don't know if this libffi
is central to the problem or just the first thing to fail.
So, how can I sign my app without breaking it?