AppImageCrafters / appimage-builder

GNU/Linux packaging solution using the AppImage format
MIT License
316 stars 58 forks source link

appimage-builder AppImage segfaults on m1 mac in docker using Rosetta #307

Open benklop opened 1 year ago

benklop commented 1 year ago

What the title says. When using the AppImage inside a docker container on an M1 mac, I get a segfault. In order to get that far, I need to: 1) Enable rosetta in Docker Desktop 2) Perform this workaround https://github.com/AppImage/AppImageKit/issues/828#issuecomment-731895751

With those steps done, I can extract the appimage using --appimage-extract, but if I use --appimage-extract-and-run it segfaults.

After extracting, I checked a number of the binaries inside (such as python) and they all segfault if I attempt to use them.

azubieta commented 1 year ago

Hello @benklop thanks for reporting, sadly I don't have a M1 mac at hand to test this scenario. We will have to rely on the community to fix it.

benklop commented 1 year ago

I've worked around the issue for now by installing appimage-builder via pip, but in doing a bit of digging, it seems that the ubuntu 20.04 docker image you're building with (and the python3 included there) works fine on m1.

I notice that patchelf has had quite a few releases since the 2020 version you're packaging with - maybe that's related? I'll see if I can reproduce that.

aur3l14no commented 1 year ago

Adding a data point here. When trying to use nvim.appimage I got the same errors.

  1. Run ./nvim.appimage with or without --appimage-extract -> exec format error: ./nvim.appimage
  2. Patch it using sed '0,/AI\x02/{s|AI\x02|\x00\x00\x00|}' -i nvim.appimage, then extraction works but extracted binaries cannot be executed -> segmentation fault

I also have rosetta2 turned on for docker.