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

[bug] [Tauri 2] Snapcraft build fail #10823

Closed
vjousse opened this issue Aug 29, 2024 · 2 comments
Closed

[bug] [Tauri 2] Snapcraft build fail #10823

vjousse opened this issue Aug 29, 2024 · 2 comments
Labels
platform: Linux status: needs triage This issue needs to triage, applied to new issues type: bug

Comments

@vjousse
Copy link

vjousse commented Aug 29, 2024

Describe the bug

When building my app by following the documentation here I'm encountering the following linking error:

2024-08-29 07:49:16.447 :: 2024-08-29 07:47:58.407 ::    Compiling muda v0.14.1
2024-08-29 07:49:16.447 :: 2024-08-29 07:47:58.917 ::    Compiling tray-icon v0.15.1
2024-08-29 07:49:16.447 :: 2024-08-29 07:49:15.759 :: error: linking with `cc` failed: exit status: 1
2024-08-29 07:49:16.447 :: 2024-08-29 07:49:15.760 ::   |
2024-08-29 07:49:16.447 :: 2024-08-29 07:49:15.760 ::   = note: LC_ALL="C" PATH="/root/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/bin:/root/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/bin:/root/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/bin:/root/.cargo/bin:/root/parts/build-app/build/node_modules/.bin:/root/parts/build-app/node_modules/.bin:/root/parts/node_modules/.bin:/root/node_modules/.bin:/node_modules/.bin:/snap/node/9049/lib/node_modules/npm/node_modules/@npmcli/run-script/lib/node-gyp-bin:/snap/gnome-42-2204-sdk/current/usr/bin:/root/parts/build-app/install/usr/sbin:/root/parts/build-app/install/usr/bin:/snap/snapcraft/12378/libexec/snapcraft:/snap/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin" VSLANG="1033" "cc" "-m64" "/tmp/rustcIJoz5U/symbols.o" "/root/parts/build-app/build/src-tauri/target/release/deps/pomodorolm-2e686f1b0ec0e3da.pomodorolm.2cb7dc1deff8197d-cgu.0.rcgu.o" "-Wl,--as-needed" "-L" "/root/parts/build-app/build/src-tauri/target/release/deps" "-L" "/usr/lib/x86_64-linux-gnu" "-L" "/snap/gnome-42-2204-sdk/current/usr/lib/x86_64-linux-gnu" "-L" "/snap/gnome-42-2204-sdk/current/usr/lib/x86_64-linux-gnu" "-L" "/snap/gnome-42-2204-sdk/current/usr/lib/x86_64-linux-gnu" "-L" "/snap/gnome-42-2204-sdk/current/usr/lib/x86_64-linux-gnu" "-L" "/snap/gnome-42-2204-sdk/current/usr/lib/x86_64-linux-gnu" "-L" "/snap/gnome-42-2204-sdk/current/usr/lib/x86_64-linux-gnu" "-L" "/snap/gnome-42-2204-sdk/current/usr/lib/x86_64-linux-gnu" "-L" "/snap/gnome-42-2204-sdk/current/usr/lib/x86_64-linux-gnu" "-L" "/snap/gnome-42-2204-sdk/current/usr/lib/x86_64-linux-gnu" "-L" "/snap/gnome-42-2204-sdk/current/usr/lib/x86_64-linux-gnu" "-L" "/snap/gnome-42-2204-sdk/current/usr/lib/x86_64-linux-gnu" "-L" "/snap/gnome-42-2204-sdk/current/usr/lib/x86_64-linux-gnu" "-L" "/snap/gnome-42-2204-sdk/current/usr/lib/x86_64-linux-gnu" "-L" "/snap/gnome-42-2204-sdk/current/usr/lib/x86_64-linux-gnu" "-L" "/snap/gnome-42-2204-sdk/current/usr/lib/x86_64-linux-gnu" "-L" "/root/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib" "-Wl,-Bstatic" "/root/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/libcompiler_builtins-6648dc218e522d87.rlib" "-Wl,-Bdynamic" "-lasound" "-lwebkit2gtk-4.1" "-lgtk-3" "-lgdk-3" "-lz" "-lpangocairo-1.0" "-lpango-1.0" "-lharfbuzz" "-latk-1.0" "-lcairo-gobject" "-lcairo" "-lgdk_pixbuf-2.0" "-lsoup-3.0" "-lgmodule-2.0" "-lgio-2.0" "-ljavascriptcoregtk-4.1" "-lgobject-2.0" "-lglib-2.0" "-lsoup-3.0" "-lgmodule-2.0" "-lgio-2.0" "-lgobject-2.0" "-lglib-2.0" "-ljavascriptcoregtk-4.1" "-lgobject-2.0" "-lglib-2.0" "-lgdk-3" "-lz" "-lpangocairo-1.0" "-lpango-1.0" "-lharfbuzz" "-lgdk_pixbuf-2.0" "-lcairo-gobject" "-lcairo" "-lgobject-2.0" "-lglib-2.0" "-ldl" "-ldl" "-lgobject-2.0" "-lgtk-3" "-lgdk-3" "-lz" "-lpangocairo-1.0" "-lpango-1.0" "-lharfbuzz" "-latk-1.0" "-lcairo-gobject" "-lcairo" "-lgdk_pixbuf-2.0" "-lgio-2.0" "-lgobject-2.0" "-lglib-2.0" "-latk-1.0" "-lgobject-2.0" "-lglib-2.0" "-lgdk-3" "-lz" "-lpangocairo-1.0" "-lpango-1.0" "-lharfbuzz" "-lgdk_pixbuf-2.0" "-lcairo-gobject" "-lcairo" "-lgobject-2.0" "-lglib-2.0" "-lpango-1.0" "-lgobject-2.0" "-lglib-2.0" "-lharfbuzz" "-lgdk_pixbuf-2.0" "-lgobject-2.0" "-lglib-2.0" "-lgio-2.0" "-lgobject-2.0" "-lglib-2.0" "-lcairo-gobject" "-lcairo" "-lgobject-2.0" "-lglib-2.0" "-lgobject-2.0" "-lglib-2.0" "-lgobject-2.0" "-lglib-2.0" "-lgcc_s" "-lutil" "-lrt" "-lpthread" "-lm" "-ldl" "-lc" "-Wl,--eh-frame-hdr" "-Wl,-z,noexecstack" "-L" "/root/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib" "-o" "/root/parts/build-app/build/src-tauri/target/release/deps/pomodorolm-2e686f1b0ec0e3da" "-Wl,--gc-sections" "-pie" "-Wl,-z,relro,-z,now" "-Wl,--strip-all" "-nodefaultlibs"
2024-08-29 07:49:16.447 :: 2024-08-29 07:49:15.760 ::   = note: /snap/gnome-42-2204-sdk/current/usr/bin/ld: /snap/gnome-42-2204-sdk/current/usr/lib/x86_64-linux-gnu/libsecret-1.so.0: undefined reference to `g_task_set_static_name'
2024-08-29 07:49:16.447 :: 2024-08-29 07:49:15.760 ::           /snap/gnome-42-2204-sdk/current/usr/bin/ld: /snap/gnome-42-2204-sdk/current/usr/lib/x86_64-linux-gnu/libatk-bridge-2.0.so.0: undefined reference to `g_string_free_and_steal'
2024-08-29 07:49:16.447 :: 2024-08-29 07:49:15.760 ::           /snap/gnome-42-2204-sdk/current/usr/bin/ld: /snap/gnome-42-2204-sdk/current/usr/lib/x86_64-linux-gnu/libpangoft2-1.0.so.0: undefined reference to `hb_font_set_synthetic_slant'
2024-08-29 07:49:16.447 :: 2024-08-29 07:49:15.760 ::           collect2: error: ld returned 1 exit status
2024-08-29 07:49:16.447 :: 2024-08-29 07:49:15.760 ::
2024-08-29 07:49:16.447 :: 2024-08-29 07:49:15.760 ::   = note: some `extern` functions couldn't be found; some native libraries may need to be installed or have their path specified
2024-08-29 07:49:16.447 :: 2024-08-29 07:49:15.760 ::   = note: use the `-l` flag to specify native libraries to link
2024-08-29 07:49:16.447 :: 2024-08-29 07:49:15.760 ::   = note: use the `cargo:rustc-link-lib` directive to specify the native libraries to link with Cargo (see https://doc.rust-lang.org/cargo/reference/build-scripts.html#rustc-link-lib)
2024-08-29 07:49:16.447 :: 2024-08-29 07:49:15.760 ::
2024-08-29 07:49:16.447 :: 2024-08-29 07:49:15.770 :: error: could not compile `pomodorolm` (bin "pomodorolm") due to 1 previous error
2024-08-29 07:49:16.447 :: 2024-08-29 07:49:15.794 ::     Error failed to build app: failed to build app

Here is the complete log file: snapcraft-20240829-074605.191999.log

Reproduction

git clone git@github.com:vjousse/pomodorolm.git
git checkout chore/publish-on-snap
snapcraft -v

Expected behavior

Build should be successful.

Full tauri info output

Inside the snapcraft build:


2024-08-29 07:59:43.367 :: 2024-08-29 07:57:26.815 :: + npm run tauri info
2024-08-29 07:59:43.367 :: 2024-08-29 07:57:26.984 ::
2024-08-29 07:59:43.367 :: 2024-08-29 07:57:26.984 :: > pomodorolm@0.0.0 tauri
2024-08-29 07:59:43.367 :: 2024-08-29 07:57:26.984 :: > tauri info
2024-08-29 07:59:43.367 :: 2024-08-29 07:57:26.984 ::
2024-08-29 07:59:43.367 :: 2024-08-29 07:57:30.129 ::
2024-08-29 07:59:43.367 :: 2024-08-29 07:57:30.129 :: [✔] Environment
2024-08-29 07:59:43.367 :: 2024-08-29 07:57:30.129 ::     - OS: Ubuntu 22.4.0 X64
2024-08-29 07:59:43.367 :: 2024-08-29 07:57:30.129 ::     ✔ webkit2gtk-4.1: 2.42.5
2024-08-29 07:59:43.367 :: 2024-08-29 07:57:30.129 ::     ✔ rsvg2: 2.56.4
2024-08-29 07:59:43.367 :: 2024-08-29 07:57:30.129 ::     ✔ rustc: 1.80.1 (3f5fd8dd4 2024-08-06)
2024-08-29 07:59:43.367 :: 2024-08-29 07:57:30.129 ::     ✔ cargo: 1.80.1 (376290515 2024-07-16)
2024-08-29 07:59:43.367 :: 2024-08-29 07:57:30.129 ::     ✔ rustup: 1.27.1 (54dd3d00f 2024-04-24)
2024-08-29 07:59:43.367 :: 2024-08-29 07:57:30.129 ::     ✔ Rust toolchain: stable-x86_64-unknown-linux-gnu (default)
2024-08-29 07:59:43.367 :: 2024-08-29 07:57:30.129 ::     - node: 20.17.0
2024-08-29 07:59:43.367 :: 2024-08-29 07:57:30.129 ::     - yarn: 1.22.22
2024-08-29 07:59:43.367 :: 2024-08-29 07:57:30.129 ::     - npm: 10.8.2
2024-08-29 07:59:43.367 :: 2024-08-29 07:57:32.466 ::
2024-08-29 07:59:43.367 :: 2024-08-29 07:57:32.466 :: [-] Packages
2024-08-29 07:59:43.367 :: 2024-08-29 07:57:32.466 ::     - tauri [RUST]: 2.0.0-rc.6
2024-08-29 07:59:43.367 :: 2024-08-29 07:57:32.467 ::     - tauri-build [RUST]: 2.0.0-rc.6
2024-08-29 07:59:43.367 :: 2024-08-29 07:57:32.467 ::     - wry [RUST]: 0.42.0
2024-08-29 07:59:43.367 :: 2024-08-29 07:57:32.467 ::     - tao [RUST]: 0.29.1
2024-08-29 07:59:43.367 :: 2024-08-29 07:57:32.467 ::     - @tauri-apps/api [NPM]: 2.0.0-beta.15
2024-08-29 07:59:43.367 :: 2024-08-29 07:57:32.467 ::     - @tauri-apps/cli [NPM]: 2.0.0-rc.7
2024-08-29 07:59:43.367 :: 2024-08-29 07:57:32.467 ::
2024-08-29 07:59:43.367 :: 2024-08-29 07:57:32.467 :: [-] App
2024-08-29 07:59:43.367 :: 2024-08-29 07:57:32.467 ::     - build-type: bundle
2024-08-29 07:59:43.367 :: 2024-08-29 07:57:32.467 ::     - CSP: unset
2024-08-29 07:59:43.367 :: 2024-08-29 07:57:32.467 ::     - frontendDist: ../dist
2024-08-29 07:59:43.367 :: 2024-08-29 07:57:32.467 ::     - devUrl: http://localhost:5173/
2024-08-29 07:59:43.367 :: 2024-08-29 07:57:32.467 ::     - bundler: Vite
@vjousse vjousse added status: needs triage This issue needs to triage, applied to new issues type: bug labels Aug 29, 2024
@vjousse vjousse changed the title [bug] [Tauri 2] Snapcraft build fail: [bug] [Tauri 2] Snapcraft build fail Aug 29, 2024
@charlesschaefer
Copy link

Have you tried to add these libraries (libsecret, libatk-bridge and libpangoft2) the the build-packages of your snapcraft.yml file? Maybe it is usefull to try the -dev version of them too.

@vjousse
Copy link
Author

vjousse commented Sep 13, 2024

Thanks for your answer! Adding the lib didn't fix the linking problem, but using base: core24 instead of base: core22 did.

@vjousse vjousse closed this as completed Sep 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
platform: Linux status: needs triage This issue needs to triage, applied to new issues type: bug
Projects
None yet
Development

No branches or pull requests

3 participants