all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Giovanni Biscuolo <g@xelera.eu>
To: guix-devel@gnu.org
Subject: XDG_DATA_DIRS issue in execution environment on LTSP
Date: Wed, 27 Mar 2019 15:51:18 +0100	[thread overview]
Message-ID: <87r2asweu1.fsf@roquette.mug.biscuolo.net> (raw)

[-- Attachment #1: Type: text/plain, Size: 5184 bytes --]

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

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 832 bytes --]

             reply	other threads:[~2019-03-27 14:51 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-03-27 14:51 Giovanni Biscuolo [this message]
2019-03-28  1:55 ` XDG_DATA_DIRS issue in execution environment on LTSP Meiyo Peng
2019-03-28  2:35   ` Meiyo Peng
2019-03-28 11:22   ` Giovanni Biscuolo
2019-03-28 11:51     ` Meiyo Peng

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87r2asweu1.fsf@roquette.mug.biscuolo.net \
    --to=g@xelera.eu \
    --cc=guix-devel@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/guix.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.