[gnome-shell] GNOME Shell crashes with custom $XDG_DATA_DIRS
I'm using GNOME Shell on Wayland on a Librebooted ThinkPad X200. I'm running GNU Guix as an additional package manager, and am trying to extend the environment variable $XDG_DATA_DIRS for GNOME, so that it can automatically find files installed by Guix.
Apparently, GNOME on Wayland reads the declarations from ‘~/.bash_profile’ and ‘~/.config/environment.d/*.conf’ (with special syntax for the latter; just ‘name=value’). However, when I try extending $XDG_DATA_DIRS in there, GNOME Shell crashes when I try logging back in. Enlightenment (which should also be running on Wayland) seems to be reading them just fine, so it feels specific to GNOME Shell. Here's the line I put in ‘~/.config/environment.d/guix.conf’:
When I try ‘~/.bash_profile’ instead, I just prefix the line with ‘export ’. I don't know if the issue is Parabola-specific, but figured it would be a good place to report it.
Updated by Tirifto over 1 year ago
I have resolved my issue. The problem is unrelated to Wayland or Guix, but is instead inherent to GNOME on Arch Linux (and by heritage, Parabola) and possibly some other distributions as well.
By default, the environment variable $XDG_DATA_DIRS is empty. When the system tries to access it and find out that it doesn't contain anything, it falls back to the value
/usr/local/share:/usr/share (it acts as if the variable contained that). GNOME depends on this fallback mechanism, because it needs to access
/usr/share via $XDG_DATA_DIRS.
If you configure $XDG_DATA_DIRS to contain its original value plus some extra path, it's going to contain only that extra path, because the original value was empty. Then, when GNOME looks at $XDG_DATA_DIRS, it will find only that extra path, but not
/usr/share, which in needs to work, so it just crashes. The way to avoid this is to explicitly add those paths to the configuration. Here's the line I ended up using:
The reason Enlightenment didn't have this same issue is likely that it already defined $XDG_DATA_DIRS, unlike GNOME, so the necessary paths were added explicitly by Enlightenment (just like they are now by my configuration file). Thank you, good folks of Parabola, Guix and Arch!