[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
XDG_DATA_DIRS issue in execution environment on LTSP
From: |
Giovanni Biscuolo |
Subject: |
XDG_DATA_DIRS issue in execution environment on LTSP |
Date: |
Wed, 27 Mar 2019 15:51:18 +0100 |
Hello,
I want to share this issue and show my "workaround" to fix it, please
send your comments on alternative ways or other caveats you may find in
my reasoning
I'm running Guix on top of Debian/stretch, recently I made Guix
environment the default execution one for my console and graphical
applications (bad idea?) and now I have to fix env every time I want to
run a Debian installed application
Since I'm connecting to my machine via an LTSP terminal, I followed this
guide https://wiki.debian.org/EnvironmentVariables#Quick_guide to have
the Guix profile automatically set up when I login via LDM; so now I
have this in my .profile:
--8<---------------cut here---------------start------------->8---
### Guix settings
#
# add Guix current path
export PATH="$HOME/.config/guix/current/bin${PATH:+:}$PATH"
# add Guix infopath
export INFOPATH="$HOME/.config/guix/current/share/info:$INFOPATH"
# set default Guix profile
export GUIX_PROFILE="$HOME/.guix-profile"
# source default Guix profile
. $GUIX_PROFILE/etc/profile
# set Guix locale path
export GUIX_LOCPATH="$GUIX_PROFILE/lib/locale"
### end Guix
--8<---------------cut here---------------end--------------->8---
and this in my .bash_profile *and* .xsessionrc:
--8<---------------cut here---------------start------------->8---
if [ -f ~/.profile ]; then
. ~/.profile
fi
--8<---------------cut here---------------end--------------->8---
and lastly this in $GUIX_PROFILE/etc/profile:
--8<---------------cut here---------------start------------->8---
# Source this file to define all the relevant environment variables in Bash
# for this profile. You may want to define the 'GUIX_PROFILE' environment
# variable to point to the "visible" name of the profile, like this:
#
# GUIX_PROFILE=/path/to/profile ; \
# source /path/to/profile/etc/profile
#
# When GUIX_PROFILE is undefined, the various environment variables refer
# to this specific profile generation.
export
PATH="${GUIX_PROFILE:-/gnu/store/gvfl5wxrgalxjjmyp7cwgfj48bdd34n4-profile}/bin:${GUIX_PROFILE:-/gnu/store/gvfl5wxrgalxjjmyp7cwgfj48bdd34n4-profile}/sbin${PATH:+:}$PATH"
export
GST_PLUGIN_SYSTEM_PATH="${GUIX_PROFILE:-/gnu/store/gvfl5wxrgalxjjmyp7cwgfj48bdd34n4-profile}/lib/gstreamer-1.0${GST_PLUGIN_SYSTEM_PATH:+:}$GST_PLUGIN_SYSTEM_PATH"
export
XDG_DATA_DIRS="${GUIX_PROFILE:-/gnu/store/gvfl5wxrgalxjjmyp7cwgfj48bdd34n4-profile}/share${XDG_DATA_DIRS:+:}$XDG_DATA_DIRS"
export
GIO_EXTRA_MODULES="${GUIX_PROFILE:-/gnu/store/gvfl5wxrgalxjjmyp7cwgfj48bdd34n4-profile}/lib/gio/modules${GIO_EXTRA_MODULES:+:}$GIO_EXTRA_MODULES"
--8<---------------cut here---------------end--------------->8---
AFAIU it conforms to the suggested way to setup a working user profile:
right?
The problem here is I'm getting this env when I login and open a
terminal emulator:
--8<---------------cut here---------------start------------->8---
~ $ env | grep -i guix
GIO_EXTRA_MODULES=/home/giovanni/.guix-profile/lib/gio/modules
GST_PLUGIN_SYSTEM_PATH=/home/giovanni/.guix-profile/lib/gstreamer-1.0
GUIX_LOCPATH=/home/giovanni/.guix-profile/lib/locale
GUIX_PROFILE=/home/giovanni/.guix-profile
INFOPATH=/home/giovanni/.config/guix/current/share/info:
PATH=/home/giovanni/.guix-profile/bin:/home/giovanni/.guix-profile/sbin:/home/giovanni/.config/guix/current/bin:/usr/local/bin/Zotero_linux-x86_64:/home/giovanni/.local/bin:/home/giovanni/bin:/usr/local/bin:/usr/bin:/bin:/usr/games:/home/giovanni/bin:/home/giovanni/.local/bin:/home/giovanni/go/bin:/home/giovanni/bin:/home/giovanni/.local/bin
XDG_DATA_DIRS=/home/giovanni/.guix-profile/share
--8<---------------cut here---------------end--------------->8---
This causes some Debian installed GUI applications to chrash with a
GLib-GIO-ERROR like this (evince in this case, I also tried eom from
Mate and gnome-character-map):
--8<---------------cut here---------------start------------->8---
~ $ evince
(evince:26326): GLib-GIO-ERROR **: Settings schema 'org.gnome.Evince' is not
installed
rilevato trace/breakpoint
--8<---------------cut here---------------end--------------->8---
At first I did not ralized it was an env problem, then looking at an
strace log it tunrs out that it reads gschema.compiled from my user Guix
profile and not from Debian standard folder [2]:
--8<---------------cut here---------------start------------->8---
openat(AT_FDCWD,
"/home/giovanni/.guix-profile/share/glib-2.0/schemas/gschemas.compiled",
O_RDONLY) = 12
--8<---------------cut here---------------end--------------->8---
[1] /usr/share/gnome:/usr/local/share/:/usr/share/ as documented here
https://www.debian.org/doc/manuals/debian-reference/ch09.en.html#_starting_a_program_from_gui
To fix this issue now I do (in a terminal emulator):
--8<---------------cut here---------------start------------->8---
unset XDG_DATA_DIRS
export
XDG_DATA_DIRS="${GUIX_PROFILE:-/gnu/store/gvfl5wxrgalxjjmyp7cwgfj48bdd34n4-profile}/share:/usr/share/gnome:/usr/local/share/:/usr/share/"
--8<---------------cut here---------------end--------------->8---
Now I should just "backport" this fix in my ~/.profile so it will be
applied to my graphical login session, too
WDYT? Thanks, Gio'
--
Giovanni Biscuolo
Xelera IT Infrastructures
signature.asc
Description: PGP signature
- XDG_DATA_DIRS issue in execution environment on LTSP,
Giovanni Biscuolo <=