Hi,
I’m trying to create a snap of an open-source image-viewer project of mine at https://github.com/bluescan/tacentview
using snapcraft version 4.1.1 with a core 20 VM. The yaml file can be seen here:
https://github.com/bluescan/tacentview/blob/master/Linux/snapcraft/snap/snapcraft.yaml
The app uses an OpenGL-based immediate-mode GUI toolkit (Dear IMGUI). It links statically (yes, I know) with glfw and uses the cmake build generator.
After the snap is ‘crafted’ and installed, if I run by typing tacentview in a terminal, I am greeted with
Glfw Error 65544: X11: Failed to load Xlib.
If I directly run the installed snap app (not using the symbolic link in /snap/bin) by typing /snap/tacentview/current/tacentview, Glfw successfully initializes. I don’t get any env vars that way (the app needs SNAP_USER_DATA and SNAP_USER_COMMON), but sure enough if I temporariliy manually set them, it all works, I get my glfw X11 window etc.
The specific glfw line that fails in x11_init.c is:
_glfw.x11.xlib.handle = _glfw_dlopen(“libX11.so.6”);
In short, running /snap/tacentview/current/tacentview works, but running /snap/bin/tacentview (which symbolically links to /usr/bin/snap) does not.
The fact the running from one location works at all leads me to believe I have setup the plugs/dependencies/whatnot correctly in the yaml file – or have I ?