Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

build appimage with static runtime #600

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from
Draft

Conversation

lievenhey
Copy link
Contributor

@lievenhey lievenhey commented Jan 23, 2024

This allows the user to run the appimage on non fuse2 systems (all moderns systems use fuse3). This is achieved by using the static appimage runtime. Since linuxdeploy doesn't support changing the runtime I only use it to create the appdir directory. Then I use the original appimagetool to package the appimage using the static runtime.

This should also make it possible to run the appimage on a non glibc system but I don't have access to one so I can't test it.

fixes: #485

@lievenhey lievenhey requested a review from milianw January 23, 2024 10:03
@lievenhey
Copy link
Contributor Author

lievenhey commented Jan 23, 2024

@GitMensch since you seem to have access to a non glibc system (unlike me) can you test if the appimage works there? I can confirm it works on ubuntu:23.04 ubuntu:23.10 which uses fuse3.

@lievenhey lievenhey force-pushed the no-fuse-appimage branch 2 times, most recently from f732996 to 1ea5ea8 Compare January 23, 2024 10:20
scripts/appimage/Dockerfile Outdated Show resolved Hide resolved
scripts/appimage/Dockerfile Outdated Show resolved Hide resolved
scripts/appimage/build_appimage.sh Outdated Show resolved Hide resolved
@lievenhey
Copy link
Contributor Author

@milianw I applied your changes. I will push an update once I build the docker container.

@GitMensch
Copy link
Contributor

Rechecked old appimage on Alpine:

Alpine:~$ ./hotspot-v1.4.1-294-g7474981-x86_64.AppImage
-ash: ./hotspot-v1.4.1-294-g7474981-x86_64.AppImage: not found
Alpine:~$ ldd ./hotspot-v1.4.1-294-g7474981-x86_64.AppImage
        /lib64/ld-linux-x86-64.so.2 (0x7fdddd997000)
        libdl.so.2 => /lib64/ld-linux-x86-64.so.2 (0x7fdddd997000)
        libpthread.so.0 => /lib64/ld-linux-x86-64.so.2 (0x7fdddd997000)
        libz.so.1 => /lib/libz.so.1 (0x7fdddd97d000)
        libc.so.6 => /lib64/ld-linux-x86-64.so.2 (0x7fdddd997000)
Error relocating ./hotspot-v1.4.1-294-g7474981-x86_64.AppImage: gnu_dev_makedev: symbol not found

new one:

Alpine:~$ ./hotspot-v1.4.1-295-gcd4518d-x86_64.AppImage
fuse: failed to exec fusermount: Permission denied

Cannot mount AppImage, please check your FUSE setup.
You might still be able to extract the contents of this AppImage
if you run it with the --appimage-extract option.
See https://github.com/AppImage/AppImageKit/wiki/FUSE
for more information
open dir error: No such file or directory

Note: I do get the same error message on Debian, while the old one worked :-(
Seems like the first thing is to get the appimage to run again on Debian, before we check back on Alpine.

Alpine:~$ file ./hotspot-*
./hotspot-v1.4.1-295-gcd4518d-x86_64.AppImage: ELF 64-bit LSB executable, x86-64, version 1 (SYSV), statically linked, stripped
./hotspot-v1.4.1-294-g7474981-x86_64.AppImage: ELF 64-bit LSB executable, x86-64, version 1 (SYSV), dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2, BuildID[sha1]=30e06184968532b6a9aa36f44ada39e4af0bda56, for GNU/Linux 2.6.32, stripped

One of the nice things: the new one is around 12% smaller than the old one.

This allows the user to run the appimage on non fuse2 systems (all
moderns systems use fuse3). This is achieved by using the static
appimage runtime. Since linuxdeploy doesn't support changing the runtime
I only use it to create the appdir directory. Then I use the original
appimagetool to package the appimage using the static runtime.

This should also make it possible to run the appimage on a non glibc
system but I don't have access to one so I can't test it.

fixes: #485
@GitMensch
Copy link
Contributor

note: the Debian one has libfuse2 installed, the Alpine environment no libfuse, seems the static part of this is missing.

@lievenhey
Copy link
Contributor Author

Test results so far:
Arch Linux: works
Debian 11: works
Debian 12: works
Ubuntu 22.10: works
Ubuntu 23.10: works
CentOS 7: works
Alpine 3.19: no, missing symbols

all cleans installs (except Arch Linux CentOS 7 and Alpine where I installed kde)

@GitMensch
Copy link
Contributor

Do you have any idea why the previous appimage works fine on my Debian 11.8, but the one from this one fails with a fuse error (and my Alpine experiencing the exact same thing)?

@lievenhey
Copy link
Contributor Author

Alpine has lots of unresolved symbols, debian no idea

@GitMensch
Copy link
Contributor

Until we find out why that appimage does not run on environments it previously did, I suggest to mark this PR as draft.

@@ -74,4 +74,7 @@ linuxdeploy-x86_64.AppImage --appdir appdir --plugin qt \
-d "./appdir/usr/share/applications/com.kdab.hotspot.desktop" \
--output appimage

mv Hotspot*x86_64.AppImage "/output/hotspot-$gitversion-x86_64.AppImage"
# package appdir with type 2 runtime so we don't depend on glibc and fuse2
appimagetool-x86_64.AppImage --runtime-file /opt/runtime-x86_64 appdir
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't quite get it - isn't the linuxdeploy --output appimage command above already creating an AppImage? I think that should be changed, no? We should only create on AppImage. AFAIR linuxdeploy can just create the AppDir (maybe just remove the --output appimage?) and then we can run appimagetool here next

@@ -43,7 +43,7 @@ RUN sed -i 's#enabled=1#enabled=0#' /etc/yum/pluginconf.d/fastestmirror.conf &&
# kgraphviewer
boost boost-devel graphviz-devel \
# appimages
fuse fuse-libs bzip2 && \
fuse fuse-libs bzip2 desktop-file-utils && \
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

out of interest: what is this required for?

@GitMensch
Copy link
Contributor

GitMensch commented Apr 15, 2024

Rechecked this PRs appimage on updated Debian 11.9: still getting

/tmp/hotspot-v1.4.1-295-g2a27d2a-x86_64.AppImage
fuse: failed to exec fusermount: Permission denied

Cannot mount AppImage, please check your FUSE setup.
You might still be able to extract the contents of this AppImage
if you run it with the --appimage-extract option.
See https://github.com/AppImage/AppImageKit/wiki/FUSE
for more information
open dir error: No such file or directory

while the appimage outside of this PR works fine.

I really like to have the appimage be more portable, including to non-glibc Linux environments, but until this is solved we likely should mark it as draft.

@lievenhey lievenhey marked this pull request as draft April 29, 2024 09:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

AppImage does not start on non-glibc (gnu_dev_makedev: symbol not found) and needs local-installed libfuse2
3 participants