I was expecting various libraries to be picked up from /snap/core22/current/… (and not the host system), and the fact they aren’t means that the snap I’m working on doesn’t work on, for example, a 20.04 host system.
I think this is a change in behaviour in core20 as I don’t see the problem with a similar snap built with base:core20. However, I’ve not found any documentation of this change, or how to deal with it. Is there any advice?
Here’s the problem (with https://snapcraft.io/miriway):
$ snap run --shell miriway
$ ldd `which miriway-shell` | grep -v /snap
linux-vdso.so.1 (0x00007ffe5d9e7000)
libstdc++.so.6 => /lib/x86_64-linux-gnu/libstdc++.so.6 (0x00007f352ea00000)
libgcc_s.so.1 => /lib/x86_64-linux-gnu/libgcc_s.so.1 (0x00007f352ec2d000)
libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007f352e600000)
libgio-2.0.so.0 => /lib/x86_64-linux-gnu/libgio-2.0.so.0 (0x00007f352e1b3000)
libgobject-2.0.so.0 => /lib/x86_64-linux-gnu/libgobject-2.0.so.0 (0x00007f352e8ac000)
libglib-2.0.so.0 => /lib/x86_64-linux-gnu/libglib-2.0.so.0 (0x00007f352e079000)
libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x00007f352df92000)
/lib64/ld-linux-x86-64.so.2 (0x00007f352eda2000)
libdrm.so.2 => /lib/x86_64-linux-gnu/libdrm.so.2 (0x00007f352de9f000)
libuuid.so.1 => /lib/x86_64-linux-gnu/libuuid.so.1 (0x00007f352de96000)
libffi.so.8 => /lib/x86_64-linux-gnu/libffi.so.8 (0x00007f352dcc3000)
libgmodule-2.0.so.0 => /lib/x86_64-linux-gnu/libgmodule-2.0.so.0 (0x00007f352dcbc000)
libz.so.1 => /lib/x86_64-linux-gnu/libz.so.1 (0x00007f352dca0000)
libmount.so.1 => /lib/x86_64-linux-gnu/libmount.so.1 (0x00007f352dc5c000)
libselinux.so.1 => /lib/x86_64-linux-gnu/libselinux.so.1 (0x00007f352dc30000)
libpcre.so.3 => /lib/x86_64-linux-gnu/libpcre.so.3 (0x00007f352dbba000)
libbz2.so.1.0 => /lib/x86_64-linux-gnu/libbz2.so.1.0 (0x00007f352dba5000)
liblzma.so.5 => /lib/x86_64-linux-gnu/liblzma.so.5 (0x00007f352db7a000)
libzstd.so.1 => /lib/x86_64-linux-gnu/libzstd.so.1 (0x00007f352daab000)
libnettle.so.8 => /lib/x86_64-linux-gnu/libnettle.so.8 (0x00007f352d9ad000)
libpng16.so.16 => /lib/x86_64-linux-gnu/libpng16.so.16 (0x00007f352d7d2000)
libbrotlidec.so.1 => /lib/x86_64-linux-gnu/libbrotlidec.so.1 (0x00007f352d7c4000)
libblkid.so.1 => /lib/x86_64-linux-gnu/libblkid.so.1 (0x00007f352d78b000)
libpcre2-8.so.0 => /lib/x86_64-linux-gnu/libpcre2-8.so.0 (0x00007f352d6f4000)
libbsd.so.0 => /lib/x86_64-linux-gnu/libbsd.so.0 (0x00007f352d6dc000)
libbrotlicommon.so.1 => /lib/x86_64-linux-gnu/libbrotlicommon.so.1 (0x00007f352d6b9000)
libmd.so.0 => /lib/x86_64-linux-gnu/libmd.so.0 (0x00007f352d6ac000)
I was expecting these libraries to be picked up from /snap/core22/current/…, and the fact they aren’t means that the snap doesn’t work on, for example, a 20.04 host system.
The similar core20 snap that works is https://snapcraft.io/egmde:
$ snap run --shell egmde
$ ldd `which egmde` | grep -v /snap
linux-vdso.so.1 (0x00007ffcd9c97000)
libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007fa3fe600000)
/lib64/ld-linux-x86-64.so.2 (0x00007fa3fea0e000)
One, possibly related, thing I’ve noticed is that LD_LIBRARY_PATH
is being set in the miriway snap (which I wasn’t expecting for classic):
$ grep LD_LIBRARY_PATH -r $SNAP/meta/
/snap/miriway/x26/meta/snap.yaml: LD_LIBRARY_PATH: ${SNAP_LIBRARY_PATH}${LD_LIBRARY_PATH:+:$LD_LIBRARY_PATH}:$SNAP/lib:$SNAP/usr/lib:$SNAP/lib/x86_64-linux-gnu:$SNAP/usr/lib/x86_64-linux-gnu
The Miriway project is on github:
git clone https://github.com/Miriway/Miriway
cd Miriway
git checkout snap
Direct link to snapcraft.yaml: https://github.com/Miriway/Miriway/blob/snap/snap/snapcraft.yaml