I’ve discovered a rather problematic issue with the dub
classic snap defined here:
The dub
application is a package/build manager for the D programming language, and it uses libcurl to download package data. It does this via the wrapper in the D standard library, which takes a list of possible different libcurl dynamic library names, and attempts to load each in turn using dlopen
until it either succeeds or exhausts the list:
Currently the snap package does not include libcurl in its stage-packages, but (as a classic snap) depends on the presence of libcurl on the host system. This seems to work fine on 16.04 and earlier, but the app fails to find any appropriate libcurl on 18.04. There’s clearly a risk that the same thing will happen on other non-Ubuntu distros as well.
There seem to be two broad possibilities here:
-
the design principle is OK but the snap package isn’t searching the right library paths on the 18.04 host
-
the snap package should bundle libcurl using
stage-packages
or some other mechanism
W.r.t. the former, searching for libcurl on 16.04:
$ ldconfig -p | grep curl
libcurl.so.4 (libc6,x86-64) => /usr/lib/x86_64-linux-gnu/libcurl.so.4
libcurl-gnutls.so.4 (libc6,x86-64) => /usr/lib/x86_64-linux-gnu/libcurl-gnutls.so.4
libcurl-gnutls.so (libc6,x86-64) => /usr/lib/x86_64-linux-gnu/libcurl-gnutls.so
… reveals something not substantially different from on 18.04:
$ ldconfig -p | grep curl
libcurl.so.4 (libc6,x86-64) => /usr/lib/x86_64-linux-gnu/libcurl.so.4
libcurl-gnutls.so.4 (libc6,x86-64) => /usr/lib/x86_64-linux-gnu/libcurl-gnutls.so.4
… so it’s not clear why the library on the host system would be found in the former case and not in the latter.
When I tried bundling libcurl
using stage-packages
, dub still failed to find it – I presume that this might again comes down to what paths are being searched for the libraries.
Any advice on how to address this, or to track down the problem more precisely? I would consider setting LD_LIBRARY_PATH
but from some searching around it looks like this is frowned on for snaps.