I have discovered that the recommended solution above doesn't work for a
variety of reasons, and am posting this update in case anyone else
encounters similar problems.
1. On amd64 systems, $SNAP_ARCH expands to amd64, so
"$SNAP/usr/lib/$SNAP_ARCH-linux-gnu" expands to
$SNAP/usr/lib/amd64-linux-gnu. Instead we need to use
$CRAFT_ARCH_TRIPLET_BUILD_FOR, and set the library path to
"$SNAP/usr/lib/$CRAFT_ARCH_TRIPLET_BUILD_FOR".
2. We need both /usr/lib and /lib since libnl-3, libnl-genl-3 and
libpcre3 are installed into /lib, whereas all the other libraries in the
snap are installed in /usr/lib. LD_LIBRARY_PATH is now set to
$SNAP/usr/lib/${CRAFT_ARCH_TRIPLET_BUILD_FOR}:$SNAP/lib/${CRAFT_ARCH_TRIPLET_BUILD_FOR}${LD_LIBRARY_PATH:+:$LD_LIBRARY_PATH}
3. The command executed by the snap is a shell script, and even though
LD_LIBRARY_PATH is now correctly set in the environment (as seen by
running the env command in the snap executed by snap run --shell
keepalived), LD_LIBRARY_PATH is not set when the script runs.
I have modified the keepalived-wrapper script so that if LD_LIBRARY_PATH
is not set, it now constructs an appropriate LD_LIBRARY_PATH itself.
In case it helps, the snapcraft.yaml is at
https://github.com/acassen/keepalived/blob/master/snap/snapcraft.yaml
and the shell script is
https://github.com/acassen/keepalived/blob/master/snap-tools/keepalived-
wrapper .
--
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/2103599
Title:
Snap installation fails though library dependencies are in snap
To manage notifications about this bug go to:
https://bugs.launchpad.net/snapcraft/+bug/2103599/+subscriptions
--
ubuntu-bugs mailing list
[email protected]
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs