Hello here,
my issue is pretty similar to Snap run: xkbcommon: ERROR: failed to add default include path /usr/share/X11/xkb , but none of the proposed solution helped me.
I migrated my app from qt5 and core20 to qt6 and core24. I am using the kde-neon-qt6 extension.
When running the application under Wayland, I get the following error. No problems in X11.
xkbcommon: ERROR: failed to add default include path /usr/share/X11/xkb
Segmentation fault (core dumped)
This is because the app looks in directories which do not provide a xkb configuration
newfstatat(AT_FDCWD, "/home/luke/snap/sayonara/x1/.config/xkb", 0x7fff69791470, 0) = -1 ENOENT (No such file or directory)
newfstatat(AT_FDCWD, "/home/luke/snap/sayonara/x1/.xkb", 0x7fff69791470, 0) = -1 ENOENT (No such file or directory)
newfstatat(AT_FDCWD, "/etc/xkb", 0x7fff69791470, 0) = -1 ENOENT (No such file or directory)
newfstatat(AT_FDCWD, "/snap/sayonara/x1/qt6/usr/share/X11/xkb", 0x7fff69791470, 0) = -1 ENOENT (No such file or directory)
On the system, there exist proper configurations though, but they are not in xkb’s search paths.
/snap/sayonara/x1/usr/share/X11/xkb
/snap/sayonara/x1/etc/X11/xkb
/snap/gnome-42-2204/202/usr/share/X11/xkb
/snap/kde-qt6-core24-sdk/31/var/lib/xkb
/snap/core24/1349/etc/X11/xkb
/snap/kf6-core24/34/usr/share/X11/xkb
I can confirm my app is starting when setting XKB_ROOT_CONFIG manually.
snap run --shell sayonara
XKB_ROOT_CONFIG=/snap/sayonara/x1/usr/share/X11/xkb sayonara
The KDE neon extension does a few things which breaks the system for me.
1. Setting the runtime and XKB_CONFIG_ROOT
I cannot fix that by modifying environment in the snapcraft.yml since the extension overrides it again.
environment:
XKB_CONFIG_ROOT: $SNAP/usr/share/X11/xkb
2. Using layout
Because of this, I cannot set a layout for /usr/share/X11/xkb, since no conflicts are allowed.
layout:
/usr/share/X11/xkb:
symlink: $SNAP/usr/share/X11/xkb
What’s the clean solution here? Is it possible to add some path to xkb’s search paths?
Another workaround would be to wrap my binary into a script which sets the XKB_CONFIG_ROOT before launching my application. But that seems like a hack.
Thank you a lot.