I’ve hit an issue when packaging a python app, the snap package tries to load a library that exists on the host rather than the one in snap. The app uses
ctypes.util.find_library to look for the library and seems it is causing the problem.
I’ve made a simple test with this test.py and snapcraft.yaml. This test snap is very simple and does not contain any extra libraries, but if your host has
libsodium, the snap will report the library can be found.
If I build the test snap with
devmode confinement, then execute
snap run --shell test and run
ldconfig in it, and then run the test snap again, it will report libsodium cannot be found, which makes me wonder if the problem is related to ldconfig cache.