From mboxrd@z Thu Jan 1 00:00:00 1970 From: Giovanni Biscuolo Subject: XDG_DATA_DIRS issue in execution environment on LTSP Date: Wed, 27 Mar 2019 15:51:18 +0100 Message-ID: <87r2asweu1.fsf@roquette.mug.biscuolo.net> Mime-Version: 1.0 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha512; protocol="application/pgp-signature" Return-path: Received: from eggs.gnu.org ([209.51.188.92]:42049) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1h99u8-0007Q2-6P for guix-devel@gnu.org; Wed, 27 Mar 2019 10:51:49 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1h99u6-0003yG-Lz for guix-devel@gnu.org; Wed, 27 Mar 2019 10:51:48 -0400 Received: from ns13.heimat.it ([46.4.214.66]:43902) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1h99u6-0003w2-7t for guix-devel@gnu.org; Wed, 27 Mar 2019 10:51:46 -0400 Received: from localhost (ip6-localhost [127.0.0.1]) by ns13.heimat.it (Postfix) with ESMTP id 0FFF63021A7 for ; Wed, 27 Mar 2019 14:51:44 +0000 (UTC) Received: from ns13.heimat.it ([127.0.0.1]) by localhost (ns13.heimat.it [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id h0vdQn4dxyw2 for ; Wed, 27 Mar 2019 14:51:23 +0000 (UTC) Received: from bourrache.mug.xelera.it (unknown [93.56.161.211]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by ns13.heimat.it (Postfix) with ESMTPSA id 158113021A6 for ; Wed, 27 Mar 2019 14:51:23 +0000 (UTC) Received: from roquette.mug.biscuolo.net (roquette.mug.biscuolo.net [10.38.2.14]) by bourrache.mug.xelera.it (Postfix) with SMTP id 572A7300056 for ; Wed, 27 Mar 2019 15:51:22 +0100 (CET) List-Id: "Development of GNU Guix and the GNU System distribution." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-devel-bounces+gcggd-guix-devel=m.gmane.org@gnu.org Sender: "Guix-devel" To: guix-devel@gnu.org --=-=-= Content-Type: text/plain 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 --=-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAEBCgAdFiEERcxjuFJYydVfNLI5030Op87MORIFAlybjeYACgkQ030Op87M ORLcTxAAiilAuxxggVEkQP+F1n1lJTm5acmdFJRfE4XzHxxMIeBvH4W7t/ntWya1 r5EoQVr9/10CnQCAvpUQUOPQ80D0PYfsYm5F7uj8dRtAcI99MTNTG288CIZ0dcyX KObZvXJDwpcJyWFLzllUujVkdFlsZgZJPpOT6DwwFv9rTBNGJBmHMrztoOEA65z/ YcV/tUk7+WncAE80VhMtcCpTXM/qdXTpPWO9cxLyBJzVMYr0m2Kfn5MUJFvnwBEe q8wTn2t7276OIdS1Px+XUC4HjtXEkkpeUiig8CyFUFnxxgfcp9SDUtrdOLoro2yc 9gbuve1xrEZdxpplUJm/uXB/B0E8IVlc19TvzZT4319YMq4Dm6xJQtJpnhvEfeZb dQqpn1LqJogZ0adWJUqT7lV/9D5CP6dRiLpcFEyGqtOGeABY+TUL7Cshla9vNqK8 WWHXDMGsMPRHxEUl9YZqL13aE/WCBmTE1YFOh80Zcp3QVly+7s4U06x3AowLFLlv WTUUmCs+XVmzaQ3s/RVSSNLcn+Yn3G/TjrkpvKNOeGAAipyPMZrybK5k58CjOiQl kXcf7vCHoQHltqEXA6aLWXtg6scFCo1IEYZUj15EWXW7WBk5DtPeeNWpLZyS347e 05Oepi95D9cNZa4nPd+0CU9Z4GPTIdQ6Vqqqf017Rm2Q8Z6ZTpQ= =b/3t -----END PGP SIGNATURE----- --=-=-=--