Hello,
I’m trying to build a Tauri v2 app with snapcraft core22 but I’m getting a linking error with what looks like glib function:
:: Compiling libappindicator v0.9.0
:: Compiling tray-icon v0.17.0
:: error: linking with `cc` failed: exit status: 1
:: |
:: = 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:/root/parts/build-app/install/sbin:/snap/snapcraft/12563/libexec/snapcraft:/snap/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin" VSLANG="1033" "cc" "-m64" "/tmp/rustcHscpud/symbols.o" "/root/parts/build-app/build/src-tauri/target/release/deps/pomodorolm-d9fa0cd80f1f05c9.pomodorolm.48416b941c1dd7ae-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-06dfbf1de02fde3b.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-d9fa0cd80f1f05c9" "-Wl,--gc-sections" "-pie" "-Wl,-z,relro,-z,now" "-Wl,--strip-all" "-nodefaultlibs"
:: = 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'
:: /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'
:: /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'
:: collect2: error: ld returned 1 exit status
Here here the manifest:
name: pomodorolm
base: core22
version: "0.1.5"
summary: A simple, good looking and multi-platform pomodoro tracker
description: |
Pomodorolm is a simple and configurable Pomodoro timer. It aims to provide a visually-pleasing and reliable way to track productivity using the Pomodoro Technique.
grade: stable
confinement: strict
layout:
/usr/lib/$CRAFT_ARCH_TRIPLET/webkit2gtk-4.1:
bind: $SNAP/usr/lib/$CRAFT_ARCH_TRIPLET/webkit2gtk-4.1
apps:
pomodorolm:
command: usr/bin/pomodorolm
desktop: usr/share/applications/pomodorolm.desktop
extensions: [gnome]
plugs:
- alsa
- audio-playback
- home
- browser-support
- network
- gsettings
- pulseaudio
- opengl
# Add whatever plugs you need here, see https://snapcraft.io/docs/snapcraft-interfaces for more info.
# The gnome extension already includes [ desktop, desktop-legacy, gsettings, opengl, wayland, x11, mount-observe, calendar-service ]
package-repositories:
- type: apt
components: [main]
suites: [noble]
key-id: 78E1918602959B9C59103100F1831DDAFC42E99D
url: http://ppa.launchpad.net/snappy-dev/snapcraft-daily/ubuntu
parts:
build-app:
plugin: dump
build-snaps:
- node/20/stable
- rustup/latest/stable
build-packages:
- libwebkit2gtk-4.1-dev
- build-essential
- curl
- wget
- file
- libxdo-dev
- libssl-dev
- libayatana-appindicator3-dev
- librsvg2-dev
- dpkg
- libasound2-dev
- libsecret-1-0
- libsecret-1-dev
- libatk-bridge2.0-0
- libatk-bridge2.0-dev
- libpangoft2-1.0-0
stage-packages:
- libwebkit2gtk-4.1-0
- libayatana-appindicator3-1
- libc-bin
source: .
override-build: |
set -eu
npm install
rustup default stable
npm run tauri build -- --bundles deb
dpkg -x src-tauri/target/release/bundle/deb/*.deb $SNAPCRAFT_PART_INSTALL/
sed -i -e "s|Icon=pomodorolm|Icon=/usr/share/icons/hicolor/32x32/apps/pomodorolm.png|g" $SNAPCRAFT_PART_INSTALL/usr/share/applications/pomodorolm.desktop
Here are some nm
output:
snapcraft-pomodorolm-on-amd64-for-amd64-5980857 ../project# nm -gD /snap/gnome-42-2204-sdk/current/usr/lib/x86_64-linux-gnu/libsecret-1.so.0 | grep g_task_set_static_name
U g_task_set_static_name
snapcraft-pomodorolm-on-amd64-for-amd64-5980857 ../project# nm -gD /usr/lib/x86_64-linux-gnu/libsecret-1.so.0 | grep g_task_set_static_name
snapcraft-pomodorolm-on-amd64-for-amd64-5980857 ../project#
It looks like it’s linking with the libs provided with the gnome extension instead of the one of core. The problem being that the libs provided by the extension have been build with a newer gcc version. The missing symbols are from glib >= 2.67 and the version outputed by ldd --version
shows 2.35
.
The full code is available here: GitHub - vjousse/pomodorolm at chore/publish-on-snap
Any idea how I could debug it? Thanks!