tauri-apps / tauri

Build smaller, faster, and more secure desktop applications with a web frontend.
https://tauri.app
Apache License 2.0
81.55k stars 2.44k forks source link

[bug] appimage does not contain libthai.so #4930

Closed dnaq closed 1 month ago

dnaq commented 2 years ago

Describe the bug

Running an appimage generated by the tauri build system doesn't work on linux distributions that don't contain libthai.so in the library search path, making the appimage not fully self-contained.

Reproduction

  1. Create an appimage with tauri
  2. Try to run it on a linux distro not containing libthai.so
  3. Get the error message: error while loading shared libraries: libthai.so.0: cannot open shared object file: No such file or directory

Expected behavior

That the application should run

Platform and versions

N/A (since this affects users of the system, not application developers)

Stack trace

No response

Additional context

The bug was previously reported by someone else as #4847, but subsequently closed.

Unpacking the appimage and running ls on appimage-path/usr/lib shows the following libraries bundled:

im-am-et.so -> x86_64-linux-gnu/gtk-3.0/3.0.0/immodules/im-am-et.so
im-broadway.so -> x86_64-linux-gnu/gtk-3.0/3.0.0/immodules/im-broadway.so
im-cedilla.so -> x86_64-linux-gnu/gtk-3.0/3.0.0/immodules/im-cedilla.so
im-cyrillic-translit.so -> x86_64-linux-gnu/gtk-3.0/3.0.0/immodules/im-cyrillic-translit.so
im-inuktitut.so -> x86_64-linux-gnu/gtk-3.0/3.0.0/immodules/im-inuktitut.so
im-ipa.so -> x86_64-linux-gnu/gtk-3.0/3.0.0/immodules/im-ipa.so
im-multipress.so -> x86_64-linux-gnu/gtk-3.0/3.0.0/immodules/im-multipress.so
im-thai.so -> x86_64-linux-gnu/gtk-3.0/3.0.0/immodules/im-thai.so
im-ti-er.so -> x86_64-linux-gnu/gtk-3.0/3.0.0/immodules/im-ti-er.so
im-ti-et.so -> x86_64-linux-gnu/gtk-3.0/3.0.0/immodules/im-ti-et.so
im-viqr.so -> x86_64-linux-gnu/gtk-3.0/3.0.0/immodules/im-viqr.so
im-wayland.so -> x86_64-linux-gnu/gtk-3.0/3.0.0/immodules/im-wayland.so
im-waylandgtk.so -> x86_64-linux-gnu/gtk-3.0/3.0.0/immodules/im-waylandgtk.so
im-xim.so -> x86_64-linux-gnu/gtk-3.0/3.0.0/immodules/im-xim.so
libatk-1.0.so.0
libatk-bridge-2.0.so.0
libatspi.so.0
libavahi-client.so.3
libavahi-common.so.3
libblkid.so.1
libbrotlicommon.so.1
libbrotlidec.so.1
libbsd.so.0
libcairo-gobject.so.2
libcairo.so.2
libcolord.so.2
libcups.so.2
libdatrie.so.1
libdbus-1.so.3
libenchant-2.so.2
libepoxy.so.0
libffi.so.7
libgcrypt.so.20
libgdk-3.so.0
libgdk_pixbuf-2.0.so
libgdk_pixbuf-2.0.so.0
libgdk_pixbuf-2.0.so.0.4000.0
libgio-2.0.so
libgio-2.0.so.0
libgio-2.0.so.0.6400.6
libglib-2.0.so.0
libgmodule-2.0.so.0
libgnutls.so.30
libgobject-2.0.so
libgobject-2.0.so.0
libgobject-2.0.so.0.6400.6
libgraphite2.so.3
libgssapi_krb5.so.2
libgstallocators-1.0.so.0
libgstapp-1.0.so.0
libgstaudio-1.0.so.0
libgstbase-1.0.so.0
libgstfft-1.0.so.0
libgstgl-1.0.so.0
libgstpbutils-1.0.so.0
libgstreamer-1.0.so.0
libgsttag-1.0.so.0
libgstvideo-1.0.so.0
libgtk-3.so.0
libgudev-1.0.so.0
libharfbuzz-icu.so.0
libhogweed.so.5
libhyphen.so.0
libicudata.so.66
libicui18n.so.66
libicuuc.so.66
libidn2.so.0
libjavascriptcoregtk-4.0.so.18
libjbig.so.0
libjpeg.so.8
libjson-glib-1.0.so.0
libk5crypto.so.3
libkeyutils.so.1
libkrb5.so.3
libkrb5support.so.0
liblcms2.so.2
liblz4.so.1
liblzma.so.5
libmount.so.1
libnettle.so.7
libnotify.so.4
libopenjp2.so.7
liborc-0.4.so.0
libpango-1.0.so
libpango-1.0.so.0
libpango-1.0.so.0.4400.7
libpangocairo-1.0.so
libpangocairo-1.0.so.0
libpangocairo-1.0.so.0.4400.7
libpangoft2-1.0.so
libpangoft2-1.0.so.0
libpangoft2-1.0.so.0.4400.7
libpcre.so.3
libpcre2-8.so.0
libpixbufloader-ani.so -> x86_64-linux-gnu/gdk-pixbuf-2.0/2.10.0/loaders/libpixbufloader-ani.so
libpixbufloader-bmp.so -> x86_64-linux-gnu/gdk-pixbuf-2.0/2.10.0/loaders/libpixbufloader-bmp.so
libpixbufloader-gif.so -> x86_64-linux-gnu/gdk-pixbuf-2.0/2.10.0/loaders/libpixbufloader-gif.so
libpixbufloader-icns.so -> x86_64-linux-gnu/gdk-pixbuf-2.0/2.10.0/loaders/libpixbufloader-icns.so
libpixbufloader-ico.so -> x86_64-linux-gnu/gdk-pixbuf-2.0/2.10.0/loaders/libpixbufloader-ico.so
libpixbufloader-jpeg.so -> x86_64-linux-gnu/gdk-pixbuf-2.0/2.10.0/loaders/libpixbufloader-jpeg.so
libpixbufloader-png.so -> x86_64-linux-gnu/gdk-pixbuf-2.0/2.10.0/loaders/libpixbufloader-png.so
libpixbufloader-pnm.so -> x86_64-linux-gnu/gdk-pixbuf-2.0/2.10.0/loaders/libpixbufloader-pnm.so
libpixbufloader-qtif.so -> x86_64-linux-gnu/gdk-pixbuf-2.0/2.10.0/loaders/libpixbufloader-qtif.so
libpixbufloader-svg.so -> x86_64-linux-gnu/gdk-pixbuf-2.0/2.10.0/loaders/libpixbufloader-svg.so
libpixbufloader-tga.so -> x86_64-linux-gnu/gdk-pixbuf-2.0/2.10.0/loaders/libpixbufloader-tga.so
libpixbufloader-tiff.so -> x86_64-linux-gnu/gdk-pixbuf-2.0/2.10.0/loaders/libpixbufloader-tiff.so
libpixbufloader-xbm.so -> x86_64-linux-gnu/gdk-pixbuf-2.0/2.10.0/loaders/libpixbufloader-xbm.so
libpixbufloader-xpm.so -> x86_64-linux-gnu/gdk-pixbuf-2.0/2.10.0/loaders/libpixbufloader-xpm.so
libpixman-1.so.0
libpng16.so.16
libprintbackend-cloudprint.so -> x86_64-linux-gnu/gtk-3.0/3.0.0/printbackends/libprintbackend-cloudprint.so
libprintbackend-cups.so -> x86_64-linux-gnu/gtk-3.0/3.0.0/printbackends/libprintbackend-cups.so
libprintbackend-file.so -> x86_64-linux-gnu/gtk-3.0/3.0.0/printbackends/libprintbackend-file.so
libprintbackend-lpr.so -> x86_64-linux-gnu/gtk-3.0/3.0.0/printbackends/libprintbackend-lpr.so
libprintbackend-test.so -> x86_64-linux-gnu/gtk-3.0/3.0.0/printbackends/libprintbackend-test.so
libpsl.so.5
librest-0.7.so.0
librsvg-2.so
librsvg-2.so.2
librsvg-2.so.2.47.0
libseccomp.so.2
libsecret-1.so.0
libselinux.so.1
libsoup-2.4.so.1
libsoup-gnome-2.4.so.1
libsqlite3.so.0
libsystemd.so.0
libtasn1.so.6
libtiff.so.5
libudev.so.1
libunistring.so.2
libwayland-client.so.0
libwayland-cursor.so.0
libwayland-egl.so.1
libwayland-server.so.0
libwebkit2gtk-4.0.so.37
libwebp.so.6
libwebpdemux.so.2
libwoff2common.so.1.0.2
libwoff2dec.so.1.0.2
libX11-xcb.so.1
libXau.so.6
libxcb-render.so.0
libxcb-shm.so.0
libXcomposite.so.1
libXcursor.so.1
libXdamage.so.1
libXdmcp.so.6
libXext.so.6
libXfixes.so.3
libXi.so.6
libXinerama.so.1
libxkbcommon.so.0
libxml2.so.2
libXrandr.so.2
libXrender.so.1
libxslt.so.1
libzstd.so.1
x86_64-linux-gnu

notably libthai.so.0 is missing from that output

FabianLars commented 2 years ago

N/A (since this affects users of the system, not application developers)

Wellll, about that. We still need info about your build system since that's where the appimages pulls its files from. On that topic, does the build system has the file in question?

dnaq commented 2 years ago

This is from running a third party application that uses tauri, the application can be found here and uses a github action to build it on ubuntu-latest

FabianLars commented 2 years ago

Thanks! I still have a couple of follow up questions. If this error happens on your system:

dnaq commented 2 years ago

I'm running nixos (unstable) with a display language of english and an input language of english

FabianLars commented 2 years ago

Ahhh so it probably only happens on nixos then 🤔 Wouldn't surprise me since we have many unresolved issues with it (primarily when using it as a build system), because none of the team members use nixos.

Thanks again ❤️ we'll look into it as soon as we can :)

dnaq commented 2 years ago

I don’t think that’s the issue, I think the main issue is that the buildapp step doesn’t bundle libthai, while the actual generated appimage needs it to run.

It probably manifests on nixos since nixos doesn’t have a standard library search path to fall back to, and most other distros will have libthai in the search path, so it’ll work on those.

Still, the main issue is that the appimage created isn’t system independent, and an easy way to make it system independent is to just make sure that all library dependencies are bundled in the final result.

FabianLars commented 2 years ago

Yeah no, i'm totally with you there. I meant that it seems to only be a problem on nixos which is why it's so rare and why i wasn't able to reproduce it. I didn't mean to blame the issue itself on nixos, if you get what i mean.

Now the question is, why it's not being bundled. It's a dependency of webkitgtk, so linuxdeploy is supposed to include all the needed .so files 🤔

Edit: Found the answer, it's on the excludelist: https://raw.githubusercontent.com/probonopd/AppImages/master/excludelist

dnaq commented 2 years ago

I was just searching for an excludelist, but you beat me to it :).

yixinBC commented 1 year ago

A user using GNU\Gentoo Linux also report the same issue:https://github.com/lencx/ChatGPT/issues/312

phil294 commented 1 year ago

Edit: Found the answer, it's on the excludelist: https://raw.githubusercontent.com/probonopd/AppImages/master/excludelist

but it looks like it shouldn't: https://github.com/AppImageCommunity/pkg2appimage/issues/538

JohnCC330 commented 1 year ago

The same happens on the Slackware distribution. I have Slackware64 version 15.0 installed and libthai is not present.

Note: Libthai is available in the Slackbuilds repo. It has libdatie as dependency though (also available on the repo).

ZendaiOwl commented 8 months ago

Just bumping this that it happens when I build a Tauri application on GitHub actions as well

EDIT: Installing libthai.so does not solve the issue for me when trying to run the AppImage (NixOS)

EDIT2: For those of you coming here trying to run a Tauri bundled AppImage under NixOS, overriding the appimage-run package and adding the libthai.so package is what finally worked for me to run the AppImage.

Found the answer thanks to #7046 :pray:

nix-shell -p 'appimage-run.override { extraPkgs = pkgs: [ pkgs.libthai ]; }' --run "appimage-run ./${TAURI-APP}.AppImage"

Zylanx commented 8 months ago

Found the answer thanks to #7046 🙏

nix-shell -p 'appimage-run.override { extraPkgs = pkgs: [ pkgs.libthai ]; }' --run "appimage-run ./${TAURI-APP}.AppImage"

A better fix than using this workaround or waiting would be to merge this into the actual derivation. Then it would immediately start helping people using Nix, rather than waiting for it to filter through updating tauri, surely?

SuperSamus commented 8 months ago

A better fix than using this workaround or waiting would be to merge this into the actual derivation.

This is already done: https://github.com/NixOS/nixpkgs/pull/271170

Korne127 commented 1 month ago

This has been fixed by https://github.com/AppImageCommunity/pkg2appimage/pull/555

Korne127 commented 1 month ago

You need to call generate-excludelist.sh and compile linuxdeploy or wait for the next linuxdeploy release for this to be resolved in the next tauri release.

Norbiros commented 1 month ago

linuxdeploy release in tauri's binary releases has been updated! After recompiling my app, I was finally able to run it without libthai.