Skip to content

Fix appimage creation in container when host has appimagelauncher enabled#4457

Merged
lucasfernog merged 2 commits intotauri-apps:devfrom
dswd:patch-1
Jun 27, 2022
Merged

Fix appimage creation in container when host has appimagelauncher enabled#4457
lucasfernog merged 2 commits intotauri-apps:devfrom
dswd:patch-1

Conversation

@dswd
Copy link
Contributor

@dswd dswd commented Jun 24, 2022

I ran into a problem that building the very same project in the very same container worked on one machine but not on the other (same host OS, roughly same version). The error was ./linuxdeploy-x86_64.AppImage: No such file or directory. As I looked into the problem I found this:

If Appimagelauncher is enabled on the host, it modifies binfmt to inject itself as a launcher for appimages. This also applies to appimages in containers although the appimagelauncher binary is most likely not available there. So the "No such file" does not mean the appimage itself but the launcher it tries to execute.

The easiest way to fix this is to modify the appimage ELF header so that binfmt no longer identifies it as an appimage and lets the binary run itself. This is my PR.

What kind of change does this PR introduce?

  • Bugfix
  • Feature
  • Docs
  • New Binding issue #___
  • Code style update
  • Refactor
  • Build-related changes
  • Other, please describe:

Does this PR introduce a breaking change?

  • Yes, and the changes were approved in issue #___
  • No

Checklist

  • When resolving issues, they are referenced in the PR's title (e.g fix: remove a typo, closes #___, #___)
  • A change file is added if any packages will require a version bump due to this PR per the instructions in the readme.
  • I have added a convincing reason for adding this feature, if necessary

Other information

Fix appimage creation in container when host has appimagelauncher enabled
@dswd dswd requested a review from a team as a code owner June 24, 2022 08:01
@lucasfernog
Copy link
Member

I tried running appimagelauncherd and the logs shows ERROR: not an AppImage, skipping on the dev branch. In your branch, the launcher exits with Segmentation fault (core dumped). Can you double check @FabianLars ?

@FabianLars
Copy link
Member

@lucasfernog For me it behaves as described by the OP. Without the change appimagelauncher thinks it's an appimage, and with their branch it doesn't, without any side-effects for me (= the build succeeds).
That said i only tested it on my host machine (fedora36) without any container stuff. The latter needs to wait until tomorrow, but as i see no change for "normal" users i'd tend to give my okay for this change 🤔

@lucasfernog lucasfernog merged commit b013308 into tauri-apps:dev Jun 27, 2022
@lucasfernog
Copy link
Member

A weird side effect is that I had to reboot after uninstalling appimagelauncher, it was giving me the same ./linuxdeploy-x86_64.AppImage: No such file or directory error somehow. Just posting here in case someone sees it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants