KDAB / hotspot

The Linux perf GUI for performance analysis.
4.16k stars 257 forks source link

build appimage with static runtime #600

Open lievenhey opened 10 months ago

lievenhey commented 10 months ago

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 commented 10 months ago

@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 commented 10 months ago

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

GitMensch commented 10 months ago

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.

GitMensch commented 10 months ago

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

lievenhey commented 10 months ago

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 commented 10 months ago

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 commented 10 months ago

Alpine has lots of unresolved symbols, debian no idea

GitMensch commented 9 months ago

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

GitMensch commented 7 months ago

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.