appimage-builder icon indicating copy to clipboard operation
appimage-builder copied to clipboard

Bundling gtk in AppImage causes errors in some distros.

Open Kingtous opened this issue 3 years ago • 8 comments

We are creating AppImage for rustdesk, which can greatly improve the user experience using it. We use appimage-builder to create the AppImage and follow the instructions on offical website of appimage-builder. However, the AppImage can only run successfully in a part of distros. I highly doubt there is some issue when bundling gtk in AppImage, causing critical errors with different version of X11.

Build Env: Ubuntu 18.04 Tested: Ubuntu 18.04(works), Ubuntu 20.04(works), Kubuntu 22.04(works), Manjaro 21.2.6(some works, some is not working, causing gnutls 3_6 not symbol found), Fedora 36 workstation(GNOME wayland) (not working, core dumped).

The AppImageBuilder.yml is here. I use gdb on Fedora 36 workstation to trace the issue, the backtrace is shown below:

(gdb) bt
#0  0x00007ffff1851fc1 in ?? () from /tmp/.mount_RustDeu7cpf2//usr/lib/x86_64-linux-gnu/libglib-2.0.so.0
#1  0x00007ffff185305c in g_log_default_handler () from /tmp/.mount_RustDeu7cpf2//usr/lib/x86_64-linux-gnu/libglib-2.0.so.0
#2  0x00007ffff18532e2 in g_logv () from /tmp/.mount_RustDeu7cpf2//usr/lib/x86_64-linux-gnu/libglib-2.0.so.0
#3  0x00007ffff185343f in g_log () from /tmp/.mount_RustDeu7cpf2//usr/lib/x86_64-linux-gnu/libglib-2.0.so.0
#4  0x00007ffff210e4f9 in ?? () from /tmp/.mount_RustDeu7cpf2//usr/lib/x86_64-linux-gnu/libgio-2.0.so.0
#5  0x00007ffff210eb5c in ?? () from /tmp/.mount_RustDeu7cpf2//usr/lib/x86_64-linux-gnu/libgio-2.0.so.0
#6  0x00007ffff211297b in g_settings_get_enum () from /tmp/.mount_RustDeu7cpf2//usr/lib/x86_64-linux-gnu/libgio-2.0.so.0
#7  0x00007ffff5494edf in ?? () from /tmp/.mount_RustDeu7cpf2//usr/lib/x86_64-linux-gnu/libgdk-3.so.0
#8  0x00007ffff5496148 in ?? () from /tmp/.mount_RustDeu7cpf2//usr/lib/x86_64-linux-gnu/libgdk-3.so.0
#9  0x00007ffff549072e in ?? () from /tmp/.mount_RustDeu7cpf2//usr/lib/x86_64-linux-gnu/libgdk-3.so.0
#10 0x00007ffff5435d5d in gdk_display_manager_open_display () from /tmp/.mount_RustDeu7cpf2//usr/lib/x86_64-linux-gnu/libgdk-3.so.0
#11 0x00007ffff702f69a in gtk_init_check () from /tmp/.mount_RustDeu7cpf2//usr/lib/x86_64-linux-gnu/libgtk-3.so.0
#12 0x00007ffff702f6c9 in gtk_init () from /tmp/.mount_RustDeu7cpf2//usr/lib/x86_64-linux-gnu/libgtk-3.so.0
#13 0x00005555554d1a9d in ?? ()
#14 0x00005555554be0e3 in ?? ()
#15 0x00005555554d5bcc in main ()

Is it OK to bundle the whole of libgtk-3-0 in AppImage(it's added by appimage-builder --generate automatically)? This package brings lots of dependencies(like gnutls, libglib-2.0), which causes conflict with some systems.

Kingtous avatar Jun 13 '22 01:06 Kingtous

libnsl is part of glibc on Ubuntu based systems but Fedora people move it into another package therefore is not present in the system when the AppImage runs. A solution would be to move libnsl.so.1 from opt/libc to /lib/x86_64-linux-gnu/libnsl.so.1 (you can use a cp command for this in the after bundle, if you use the include file it will also put it in opt/libc).

We should implement this solutions as part of appimage-builder soon.

azubieta avatar Jun 13 '22 16:06 azubieta

Thanks for your kind reply :). Another question is libgtk-3-0, appimage-builder bundles whole libgtk-3-0 into AppImage(brings lots of dependencies like gnutls, libglib-2.0), but I found some of distros crashes when startup our application, just like the backstrace shown above. But without libgtk-3-0 package being bundled, the AppImage cannot run entirely. is there any better solutions for this issue?

Kingtous avatar Jun 14 '22 03:06 Kingtous

AFIK there are no known issues with libgtk-3-0. I use a Gimp recipe for testing it, maybe you could share the broken bundle so I could take a closer look into it.

azubieta avatar Jun 14 '22 15:06 azubieta

AFIK there are no known issues with libgtk-3-0. I use a Gimp recipe for testing it, maybe you could share the broken bundle so I could take a closer look into it.

Thanks, Appimage is here

AppimageBuilder.yml is here

Kingtous avatar Jun 15 '22 00:06 Kingtous

any issues found in this AppImage? :)

Kingtous avatar Jun 29 '22 12:06 Kingtous

I think it's also worth noticing https://github.com/rustdesk/rustdesk/issues/577#issuecomment-1151399825

maverick74 avatar Jul 11 '22 11:07 maverick74

Fedora 36 workstation(GNOME wayland) (not working, core dumped).

This could be related to missing wayland support. -> https://github.com/rustdesk/rustdesk/issues/56

cooperbang avatar Aug 11 '22 05:08 cooperbang

I maintain the 0ad appimage. The Atlas map editor uses gtk3. There haven't been any reports of problems with it yet.

To bundle gtk, I use the linuxdeploy gtk plugin

andy5995 avatar Feb 07 '23 21:02 andy5995