JonathonReinhart / staticx

Create static executable from dynamic executable
https://staticx.readthedocs.io/
Other
324 stars 34 forks source link

Rosetta error running staticx+pyinstaller built in docker, in same docker, on Apple Silicon #261

Open brettdh opened 1 year ago

brettdh commented 1 year ago

I'm attempting to build a bundle, in Docker, using staticx+pyinstaller. The target is amd64 Linux; the host machine is an M2 Macbook Pro. In Gitlab CI, this builds and runs fine. In Docker for Mac (with Rosetta emulation enabled), this builds fine, but shows this error at run time:

rosetta error: failed to open elf at
bundle: Child exited for unknown reason! (wstatus == 5)

Minimal repro project here: https://github.com/brettdh/staticx-pyinstaller-rosetta-error-repro

Manual for now, but if I have time soon, I will set up Github Actions for Linux and Mac.

JonathonReinhart commented 8 months ago

Hi Brett, sorry I failed to reply here. I don't have a Macbook so I can't really help here. The best I can do is point you at the troubleshooting guide and see if that helps you to gather any more information.

rosetta error: failed to open elf at

The fact that this line is truncated leaves me thinking that this is some deep incompatibility with Rosetta and the tricks that StaticX has to play. This is probably going to take some thorough investigation to understand what Rosetta is doing.