I’m evaluating snap for packaging a PyQt5 application that uses QtMultimedia. I built a snap of the pyqt5 camera example. However, there is an error when I run it.
$ pyqt5camera
Traceback (most recent call last):
File "camera.py", line 47, in <module>
from PyQt5.QtMultimedia import (QCamera,
ImportError: libpulsecommon-8.0.so: cannot open shared object file: No such file or directory
I manually looked up the missing so file and found it under examples/multimediawidgets/camera/prime/usr/lib/x86_64-linux-gnu/pulseaudio/libpulsecommon-8.0.so. Since it is in a sub-folder of /usr/lib/x86_64-linux-gnu, would it be the problem?
I’ve hit this problem too. The libraries in the dir $SNAP/usr/lib/$SNAPCRAFT_ARCH_TRIPLET/pulseaudio are installed by an official Ubuntu package. @ogra I think requiring the user to manually add the dir to LD_LIBRARY_PATH is pretty ugly. In general, there is plenty of packages that install libraries into subdirectories like this, so this practice is unsustainable on a large scale.
i fully agree that it is annoying, OTOH it also gives the developer full control
(note that i’m not the one who has implemented it this way, just the one that tries to help around it, filing a bug might help)
there is another option if you find your apps stanza gets to big with LD_LIBRARY_PATH entries for each and every lib in a subdir you can simply make sure the file gets installed under $SNAP/usr/lib:
Rather than listing each subdir of usr/lib/<arch>, what’s most difficult for the user (I think), is simply to figure out what’s wrong with their snap. The snap build OK, but then when it starts, the dynamic linker simply reports that for example libpulsecommon... could not be found, without saying why. The user has to figure out on their own where this library is in the first place and then why it is not found. The snapcraft documentation also does not say anything about the possibility of libraries installed as official Ubuntu packages not being found at runtime.