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

error while loading shared libraries: libgtksourceview-3.0.so.1: cannot open shared object file: No such file or directory #1986

Closed
guillemcordoba opened this issue Jun 15, 2021 · 10 comments
Labels
scope: cli.rs The tauri-cli rust crate type: bug

Comments

@guillemcordoba
Copy link
Contributor

Describe the bug

After I package my tauri app in an AppImage and try to run it in another Ubuntu, I get this error:

app: error while loading shared libraries: libgtksourceview-3.0.so.1: cannot open shared object file: No such file or directory

To Reproduce
Steps to reproduce the behavior:

  1. Build your tauri app into an AppImage.
  2. Download that AppImage to another PC that doesn't have libgtksourceview installed.
  3. Try to run the AppImage in a terminal.

I've tried with both my app (it uses the Vue CLI plugin) and the vue example, same result in both cases.

I have also tried with Rust 1.52.1, with the same result.

Expected behavior
Tauri packages all the necessary libraries inside the AppImage so that the end users don't need to install them.

Platform and Versions (please complete the following information):

launcher@0.1.0 tauri
tauri "info"

Operating System - Ubuntu, version 20.04 X64

Node.js environment
Node.js - 16.3.0
@tauri-apps/cli - 1.0.0-beta.1 (outdated, latest: 1.0.0-beta.2)
@tauri-apps/api - 1.0.0-beta-rc.3

Global packages
npm - 7.15.1
yarn - 1.22.5

Rust environment
rustc - 1.55.0-nightly
cargo - 1.54.0-nightly

App directory structure
/node_modules
/target
/.cargo
/.git
/public
/src
/tests
/src-tauri

App
tauri.rs - 1.0.0-beta.1
build-type - bundle
CSP - default-src blob: data: filesystem: ws: http: https: 'unsafe-eval' 'unsafe-inline' 'self' img-src: 'self'
distDir - Set automatically by Vue CLI plugin
devPath - Set automatically by Vue CLI plugin
framework - Vue.js (Vue CLI)
bundler - Webpack

Additional context
Add any other context about the problem here.

@lucasfernog
Copy link
Member

I wonder what we should do with the whole GTK dependency tree :/

@lucasfernog
Copy link
Member

This is the output of ldd on a Tauri binary:

		linux-vdso.so.1 (0x00007ffe905bf000)
        libssl.so.1.1 => /usr/lib/libssl.so.1.1 (0x00007fdb4fcc4000)
        libcrypto.so.1.1 => /usr/lib/libcrypto.so.1.1 (0x00007fdb4f9e6000)
        libbz2.so.1.0 => /usr/lib/libbz2.so.1.0 (0x00007fdb4f9d3000)
        libwebkit2gtk-4.0.so.37 => /usr/lib/libwebkit2gtk-4.0.so.37 (0x00007fdb4be59000)
        libgtk-3.so.0 => /usr/lib/libgtk-3.so.0 (0x00007fdb4b6b2000)
        libgdk-3.so.0 => /usr/lib/libgdk-3.so.0 (0x00007fdb4b5b3000)
        libpango-1.0.so.0 => /usr/lib/libpango-1.0.so.0 (0x00007fdb4b55f000)
        libcairo-gobject.so.2 => /usr/lib/libcairo-gobject.so.2 (0x00007fdb4b553000)
        libcairo.so.2 => /usr/lib/libcairo.so.2 (0x00007fdb4b434000)
        libgdk_pixbuf-2.0.so.0 => /usr/lib/libgdk_pixbuf-2.0.so.0 (0x00007fdb4b3ee000)
        libgio-2.0.so.0 => /usr/lib/libgio-2.0.so.0 (0x00007fdb4b231000)
        libjavascriptcoregtk-4.0.so.18 => /usr/lib/libjavascriptcoregtk-4.0.so.18 (0x00007fdb497e6000)
        libgobject-2.0.so.0 => /usr/lib/libgobject-2.0.so.0 (0x00007fdb4978a000)
        libglib-2.0.so.0 => /usr/lib/libglib-2.0.so.0 (0x00007fdb49655000)
        libgtksourceview-3.0.so.1 => /usr/lib/libgtksourceview-3.0.so.1 (0x00007fdb495ad000)
        libappindicator3.so.1 => /usr/lib/libappindicator3.so.1 (0x00007fdb4959b000)
        libdl.so.2 => /usr/lib/libdl.so.2 (0x00007fdb49594000)
        libgcc_s.so.1 => /usr/lib/libgcc_s.so.1 (0x00007fdb49579000)
        librt.so.1 => /usr/lib/librt.so.1 (0x00007fdb4956c000)
        libpthread.so.0 => /usr/lib/libpthread.so.0 (0x00007fdb4954b000)
        libm.so.6 => /usr/lib/libm.so.6 (0x00007fdb49407000)
        libc.so.6 => /usr/lib/libc.so.6 (0x00007fdb4923b000)
        /lib64/ld-linux-x86-64.so.2 => /usr/lib64/ld-linux-x86-64.so.2 (0x00007fdb51053000)
        libwpe-1.0.so.1 => /usr/lib/libwpe-1.0.so.1 (0x00007fdb49231000)
        libWPEBackend-fdo-1.0.so.1 => /usr/lib/libWPEBackend-fdo-1.0.so.1 (0x00007fdb4921d000)
        libGL.so.1 => /usr/lib/libGL.so.1 (0x00007fdb49195000)
        libEGL.so.1 => /usr/lib/libEGL.so.1 (0x00007fdb49183000)
        libnotify.so.4 => /usr/lib/libnotify.so.4 (0x00007fdb49179000)
        libz.so.1 => /usr/lib/libz.so.1 (0x00007fdb4915f000)
        libharfbuzz.so.0 => /usr/lib/libharfbuzz.so.0 (0x00007fdb49089000)
        libxml2.so.2 => /usr/lib/libxml2.so.2 (0x00007fdb48f1b000)
        libsqlite3.so.0 => /usr/lib/libsqlite3.so.0 (0x00007fdb48dd4000)
        libxslt.so.1 => /usr/lib/libxslt.so.1 (0x00007fdb48d92000)
        libwoff2dec.so.1.0.2 => /usr/lib/libwoff2dec.so.1.0.2 (0x00007fdb48d85000)
        libfontconfig.so.1 => /usr/lib/libfontconfig.so.1 (0x00007fdb48d36000)
        libfreetype.so.6 => /usr/lib/libfreetype.so.6 (0x00007fdb48c62000)
        libharfbuzz-icu.so.0 => /usr/lib/libharfbuzz-icu.so.0 (0x00007fdb48c5d000)
        libgcrypt.so.20 => /usr/lib/libgcrypt.so.20 (0x00007fdb48b1e000)
        libgstapp-1.0.so.0 => /usr/lib/libgstapp-1.0.so.0 (0x00007fdb48b0c000)
        libgstbase-1.0.so.0 => /usr/lib/libgstbase-1.0.so.0 (0x00007fdb48a8b000)
        libgstreamer-1.0.so.0 => /usr/lib/libgstreamer-1.0.so.0 (0x00007fdb48941000)
        libgstpbutils-1.0.so.0 => /usr/lib/libgstpbutils-1.0.so.0 (0x00007fdb48902000)
        libgstaudio-1.0.so.0 => /usr/lib/libgstaudio-1.0.so.0 (0x00007fdb48885000)
        libgsttag-1.0.so.0 => /usr/lib/libgsttag-1.0.so.0 (0x00007fdb48842000)
        libgstvideo-1.0.so.0 => /usr/lib/libgstvideo-1.0.so.0 (0x00007fdb4878c000)
        libgstgl-1.0.so.0 => /usr/lib/libgstgl-1.0.so.0 (0x00007fdb48710000)
        libgstfft-1.0.so.0 => /usr/lib/libgstfft-1.0.so.0 (0x00007fdb48704000)
        libjpeg.so.8 => /usr/lib/libjpeg.so.8 (0x00007fdb4867a000)
        libpng16.so.16 => /usr/lib/libpng16.so.16 (0x00007fdb48643000)
        libopenjp2.so.7 => /usr/lib/libopenjp2.so.7 (0x00007fdb485df000)
        libwebpdemux.so.2 => /usr/lib/libwebpdemux.so.2 (0x00007fdb485d9000)
        libwebp.so.7 => /usr/lib/libwebp.so.7 (0x00007fdb4856a000)
        libsoup-2.4.so.1 => /usr/lib/libsoup-2.4.so.1 (0x00007fdb484cc000)
        libatk-1.0.so.0 => /usr/lib/libatk-1.0.so.0 (0x00007fdb484a3000)
        libenchant-2.so.2 => /usr/lib/libenchant-2.so.2 (0x00007fdb48495000)
        libgmodule-2.0.so.0 => /usr/lib/libgmodule-2.0.so.0 (0x00007fdb4848e000)
        libsecret-1.so.0 => /usr/lib/libsecret-1.so.0 (0x00007fdb4842b000)
        libtasn1.so.6 => /usr/lib/libtasn1.so.6 (0x00007fdb48415000)
        libhyphen.so.0 => /usr/lib/libhyphen.so.0 (0x00007fdb4840e000)
        libX11.so.6 => /usr/lib/libX11.so.6 (0x00007fdb482cd000)
        libXcomposite.so.1 => /usr/lib/libXcomposite.so.1 (0x00007fdb482c8000)
        libXdamage.so.1 => /usr/lib/libXdamage.so.1 (0x00007fdb482c1000)
        libwayland-server.so.0 => /usr/lib/libwayland-server.so.0 (0x00007fdb482aa000)
        libwayland-egl.so.1 => /usr/lib/libwayland-egl.so.1 (0x00007fdb482a5000)
        libwayland-client.so.0 => /usr/lib/libwayland-client.so.0 (0x00007fdb48293000)
        libmanette-0.2.so.0 => /usr/lib/libmanette-0.2.so.0 (0x00007fdb48264000)
        libseccomp.so.2 => /usr/lib/libseccomp.so.2 (0x00007fdb48241000)
        libicui18n.so.69 => /usr/lib/libicui18n.so.69 (0x00007fdb47f18000)
        libicuuc.so.69 => /usr/lib/libicuuc.so.69 (0x00007fdb47d25000)
        libsystemd.so.0 => /usr/lib/libsystemd.so.0 (0x00007fdb47c6d000)
        libstdc++.so.6 => /usr/lib/libstdc++.so.6 (0x00007fdb47a57000)
        libpangocairo-1.0.so.0 => /usr/lib/libpangocairo-1.0.so.0 (0x00007fdb47a46000)
        libpangoft2-1.0.so.0 => /usr/lib/libpangoft2-1.0.so.0 (0x00007fdb47a2b000)
        libfribidi.so.0 => /usr/lib/libfribidi.so.0 (0x00007fdb47a0c000)
        libepoxy.so.0 => /usr/lib/libepoxy.so.0 (0x00007fdb478da000)
        libXi.so.6 => /usr/lib/libXi.so.6 (0x00007fdb478c7000)
        libatk-bridge-2.0.so.0 => /usr/lib/libatk-bridge-2.0.so.0 (0x00007fdb47891000)
        libcloudproviders.so.0 => /usr/lib/libcloudproviders.so.0 (0x00007fdb47879000)
        libXfixes.so.3 => /usr/lib/libXfixes.so.3 (0x00007fdb4786e000)
        libxkbcommon.so.0 => /usr/lib/libxkbcommon.so.0 (0x00007fdb47826000)
        libwayland-cursor.so.0 => /usr/lib/libwayland-cursor.so.0 (0x00007fdb4781d000)
        libXext.so.6 => /usr/lib/libXext.so.6 (0x00007fdb47808000)
        libXcursor.so.1 => /usr/lib/libXcursor.so.1 (0x00007fdb477fc000)
        libXrandr.so.2 => /usr/lib/libXrandr.so.2 (0x00007fdb477ef000)
        libXinerama.so.1 => /usr/lib/libXinerama.so.1 (0x00007fdb477e8000)
        libthai.so.0 => /usr/lib/libthai.so.0 (0x00007fdb477dd000)
        libXrender.so.1 => /usr/lib/libXrender.so.1 (0x00007fdb477d0000)
        libxcb.so.1 => /usr/lib/libxcb.so.1 (0x00007fdb477a6000)
        libxcb-render.so.0 => /usr/lib/libxcb-render.so.0 (0x00007fdb47796000)
        libxcb-shm.so.0 => /usr/lib/libxcb-shm.so.0 (0x00007fdb4778f000)
        libpixman-1.so.0 => /usr/lib/libpixman-1.so.0 (0x00007fdb476e7000)
        libtiff.so.5 => /usr/lib/libtiff.so.5 (0x00007fdb47653000)
        libmount.so.1 => /usr/lib/libmount.so.1 (0x00007fdb475f3000)
        libresolv.so.2 => /usr/lib/libresolv.so.2 (0x00007fdb475d9000)
        libffi.so.7 => /usr/lib/libffi.so.7 (0x00007fdb475cb000)
        libpcre.so.1 => /usr/lib/libpcre.so.1 (0x00007fdb47559000)
        libdbusmenu-gtk3.so.4 => /usr/lib/libdbusmenu-gtk3.so.4 (0x00007fdb47543000)
        libdbusmenu-glib.so.4 => /usr/lib/libdbusmenu-glib.so.4 (0x00007fdb47524000)
        libGLdispatch.so.0 => /usr/lib/libGLdispatch.so.0 (0x00007fdb4746c000)
        libGLX.so.0 => /usr/lib/libGLX.so.0 (0x00007fdb47437000)
        libgraphite2.so.3 => /usr/lib/libgraphite2.so.3 (0x00007fdb47412000)
        liblzma.so.5 => /usr/lib/liblzma.so.5 (0x00007fdb473ea000)
        libwoff2common.so.1.0.2 => /usr/lib/libwoff2common.so.1.0.2 (0x00007fdb473e5000)
        libbrotlidec.so.1 => /usr/lib/libbrotlidec.so.1 (0x00007fdb473d7000)
        libexpat.so.1 => /usr/lib/libexpat.so.1 (0x00007fdb473a5000)
        libgpg-error.so.0 => /usr/lib/libgpg-error.so.0 (0x00007fdb4737e000)
        libunwind.so.8 => /usr/lib/libunwind.so.8 (0x00007fdb47364000)
        libdw.so.1 => /usr/lib/libdw.so.1 (0x00007fdb472c8000)
        liborc-0.4.so.0 => /usr/lib/liborc-0.4.so.0 (0x00007fdb47243000)
        libgstallocators-1.0.so.0 => /usr/lib/libgstallocators-1.0.so.0 (0x00007fdb4723a000)
        libX11-xcb.so.1 => /usr/lib/libX11-xcb.so.1 (0x00007fdb47235000)
        libgudev-1.0.so.0 => /usr/lib/libgudev-1.0.so.0 (0x00007fdb47228000)
        libdrm.so.2 => /usr/lib/libdrm.so.2 (0x00007fdb47213000)
        libgbm.so.1 => /usr/lib/libgbm.so.1 (0x00007fdb47203000)
        libgssapi_krb5.so.2 => /usr/lib/libgssapi_krb5.so.2 (0x00007fdb471ac000)
        libpsl.so.5 => /usr/lib/libpsl.so.5 (0x00007fdb47199000)
        libevdev.so.2 => /usr/lib/libevdev.so.2 (0x00007fdb4717b000)
        libicudata.so.69 => /usr/lib/libicudata.so.69 (0x00007fdb45622000)
        libzstd.so.1 => /usr/lib/libzstd.so.1 (0x00007fdb45513000)
        liblz4.so.1 => /usr/lib/liblz4.so.1 (0x00007fdb454ee000)
        libcap.so.2 => /usr/lib/libcap.so.2 (0x00007fdb454e3000)
        libdbus-1.so.3 => /usr/lib/libdbus-1.so.3 (0x00007fdb4548e000)
        libatspi.so.0 => /usr/lib/libatspi.so.0 (0x00007fdb45453000)
        libdatrie.so.1 => /usr/lib/libdatrie.so.1 (0x00007fdb45449000)
        libXau.so.6 => /usr/lib/libXau.so.6 (0x00007fdb45442000)
        libXdmcp.so.6 => /usr/lib/libXdmcp.so.6 (0x00007fdb4543a000)
        libblkid.so.1 => /usr/lib/libblkid.so.1 (0x00007fdb453e4000)
        libbrotlicommon.so.1 => /usr/lib/libbrotlicommon.so.1 (0x00007fdb453c1000)
        libelf.so.1 => /usr/lib/libelf.so.1 (0x00007fdb453a7000)
        libudev.so.1 => /usr/lib/libudev.so.1 (0x00007fdb4537d000)
        libkrb5.so.3 => /usr/lib/libkrb5.so.3 (0x00007fdb45296000)
        libk5crypto.so.3 => /usr/lib/libk5crypto.so.3 (0x00007fdb45265000)
        libcom_err.so.2 => /usr/lib/libcom_err.so.2 (0x00007fdb4525f000)
        libkrb5support.so.0 => /usr/lib/libkrb5support.so.0 (0x00007fdb45250000)
        libkeyutils.so.1 => /usr/lib/libkeyutils.so.1 (0x00007fdb45247000)
        libunistring.so.2 => /usr/lib/libunistring.so.2 (0x00007fdb450c5000)
        libidn2.so.0 => /usr/lib/libidn2.so.0 (0x00007fdb450a3000)

@lemarier
Copy link
Member

Maybe this can help;
https://github.com/philn/ephy-canary/blob/main/install-webkitgtk.sh

it's for a Flatpak but quite similar, it can give idea...

@guillemcordoba
Copy link
Contributor Author

@lucasfernog do you think there is some way to include a customized list of libs inside the bundle? Custom build.rs perhaps?

As far as I understand it should be as easy as adding a lib folder inside the already existing usr folder and package all of that.

@lucasfernog
Copy link
Member

Yeah we can easily copy the shared libraries to the appimage, but seems like it's a little tricky for GTK.

@guillemcordoba
Copy link
Contributor Author

Oh okey... Any possible directions to follow would be greatly appreciated :)

@lucasfernog
Copy link
Member

We need to change something to the Tauri bundler, nothing you can do directly on the app :/

@lemarier lemarier added the scope: cli.rs The tauri-cli rust crate label Jul 27, 2021
@ghost
Copy link

ghost commented Aug 10, 2021

I also tried reusing an appimage, that worked fine on ubuntu, on centos7 but hit this:

error while loading share libraries: libssl.so.1.1: cannot open shared object file: No such file or directory

Here is a hacky-as-heck work around:

  1. use e.g. the electron-builder AppRun bash script (forget if MIT else I would paste) and rename the app to run as AppRunTauri
  2. run: your_app.appimage --appimage-extract and cd inside the extracted folder
  3. mv AppRun AppRunTauri
  4. paste the bash script in as the new AppRun
  5. You will notice electron-builder is already adding ./usr/lib to the LD_LIBRARY_PATH, so add all libs you need in there
  6. install appimagetool as documented: https://appimage-builder.readthedocs.io/en/latest/intro/install.html
  7. re-archive your appimage: appimagetool <extracted_folder_name>

And that so far has fixed my libssl.so.1.1 from missing, though many more still are so I probably need that entire list added...

@ghost
Copy link

ghost commented Aug 14, 2021

Note, what I did is a hack (not recommended). The proper approach I think should be when using linuxdeploy, not appimagetool.

There is some discussion about it here, though a little difficult to ascertain:
AppImage/AppImageKit#998 (comment)

Here is what ultimately worked for the OP:

cp $(ldconfig -p | grep libssl.so.1 | head -n1 | tr ' ' '\n' | grep /) ./$APP.AppDir/Qt/libs/
cp $(ldconfig -p | grep libcrypto.so.1 | head -n1 | tr ' ' '\n' | grep /) ./$APP.AppDir/Qt/libs/
cp $(ldconfig -p | grep libicui18n.so | head -n1 | tr ' ' '\n' | grep /) ./$APP.AppDir/Qt/libs/
cp $(ldconfig -p | grep libicuuc.so | head -n1 | tr ' ' '\n' | grep /) ./$APP.AppDir/Qt/libs/
cp $(ldconfig -p | grep libicudata.so | head -n1 | tr ' ' '\n' | grep /) ./$APP.AppDir/Qt/libs/
export APPIMAGE_EXTRACT_AND_RUN=1
./linuxdeploy-x86_64.AppImage --appdir ./$APP.AppDir --output appimage

@lucasfernog
Copy link
Member

I'll see if linuxdeploy fixes our problems.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
scope: cli.rs The tauri-cli rust crate type: bug
Projects
None yet
Development

No branches or pull requests

3 participants