Subject: Re: Guix should not set global variables that may affect host

From: Maxim Cournoyer <[email-masked]>
Date: Tue, 25 Jan 2022 18:14:19 -0500

Hi Liliana,

Liliana Marie Prikler <[email-masked]> writes:

> Hi,
>
> Am Montag, dem 24.01.2022 um 17:24 -0500 schrieb Maxim Cournoyer:
>> Hello!
>> 
>> There are multiple reports about the negative effects of Guix setting
>> variables such as XDG_DATA_DIRS on foreign distributions, that may
>> cause problems a severe as locking users out of their graphical
>> session [0].
>> 
>> In my opinion, we should pursue patching every application/library to
>> use a Guix-specific variant, e.g. GUIX_XDG_DATA_DIRS instead of
>> XDG_DATA_DIRS, to avoid interfering with the host system, as was done
>> for GUIX_PYTHONPATH.
>> 
>> This is a big task in itself; we can open more focused/actionable
>> tasks for each environment variable, starting with those causing the
>> most serious issues.
>> 
>> Any takers?
> I'm not convinced that patching XDG_DATA_DIRS is a good solution here.
> Even if we go forward and implement this for each and every
> library/application, (it would be reasonably simple to do so for glib
> and qt at least, but there's many more consumers, including Guix
> itself), we'd just force users on foreign distros to set up their
> XDG_DATA_DIRS for us if they e.g. want to have desktop icons available,
> so they'd quickly encounter the same issue on their own.

They may end up doing so, but at least they wouldn't be locked out of
their graphical session just for installing a package from Guix, which
is a clear improvement over the current situation.

> I see two ways forward for this:  First, "ignore it" and just document
> the behaviour.  This isn't just a bug Guix is suffering from, it also
> affects other third-party package installers like Flatpak and Snap.
>
> Since distros increasingly become aware of them, this will soon no
> longer be an issue for most our users.  Second, extend search-paths
> with a way of enforcing a default value when none is set.  This way,
> Guix will still override XDG_DATA_DIRS, but since
> $HOME/.local/share:/usr/share is set as the default as per spec, it
> will do what the distro expected.

That sounds good to, and should be easier to achieve.

Thanks,

Maxim