GNU bug report logs - #53447
[PATCH] doc: Unset environment variables considered harmful

Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.

Package: guix-patches; Reported by: Liliana Marie Prikler <liliana.prikler@HIDDEN>; Keywords: patch; dated Sat, 22 Jan 2022 14:17:01 UTC; Maintainer for guix-patches is guix-patches@HIDDEN.

Message received at 53447 <at> debbugs.gnu.org:


Received: (at 53447) by debbugs.gnu.org; 25 Jan 2022 13:29:53 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Tue Jan 25 08:29:53 2022
Received: from localhost ([127.0.0.1]:47422 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1nCLtR-0000nA-MG
	for submit <at> debbugs.gnu.org; Tue, 25 Jan 2022 08:29:53 -0500
Received: from hera.aquilenet.fr ([185.233.100.1]:55936)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <ludo@HIDDEN>) id 1nCLtO-0000mw-E7
 for 53447 <at> debbugs.gnu.org; Tue, 25 Jan 2022 08:29:53 -0500
Received: from localhost (localhost [127.0.0.1])
 by hera.aquilenet.fr (Postfix) with ESMTP id DA0905D0;
 Tue, 25 Jan 2022 14:29:43 +0100 (CET)
X-Virus-Scanned: Debian amavisd-new at aquilenet.fr
Received: from hera.aquilenet.fr ([127.0.0.1])
 by localhost (hera.aquilenet.fr [127.0.0.1]) (amavisd-new, port 10024)
 with ESMTP id U4OmD4uBPcQ4; Tue, 25 Jan 2022 14:29:42 +0100 (CET)
Received: from ribbon (91-160-117-201.subs.proxad.net [91.160.117.201])
 by hera.aquilenet.fr (Postfix) with ESMTPSA id 99C589D;
 Tue, 25 Jan 2022 14:29:42 +0100 (CET)
From: =?utf-8?Q?Ludovic_Court=C3=A8s?= <ludo@HIDDEN>
To: Maxim Cournoyer <maxim.cournoyer@HIDDEN>
Subject: Introducing =?utf-8?Q?=E2=80=98GUIX=5F=E2=80=99-prefixed?=
 environment variables
References: <a57ac1e74fda0ee2585d4a3cb3244fcbcb0c84a3.camel@HIDDEN>
 <875yqb21va.fsf@HIDDEN>
 <19bb45159c0934e8d84035abdcfb00d8202233dd.camel@HIDDEN>
 <87y2344vnv.fsf_-_@HIDDEN>
X-URL: http://www.fdn.fr/~lcourtes/
X-Revolutionary-Date: 6 =?utf-8?Q?Pluvi=C3=B4se?= an 230 de la =?utf-8?Q?R?=
 =?utf-8?Q?=C3=A9volution?=
X-PGP-Key-ID: 0x090B11993D9AEBB5
X-PGP-Key: http://www.fdn.fr/~lcourtes/ludovic.asc
X-PGP-Fingerprint: 3CE4 6455 8A84 FDC6 9DB4  0CFB 090B 1199 3D9A EBB5
X-OS: x86_64-pc-linux-gnu
Date: Tue, 25 Jan 2022 14:29:41 +0100
In-Reply-To: <87y2344vnv.fsf_-_@HIDDEN> (Maxim Cournoyer's message of "Mon, 
 24 Jan 2022 17:27:00 -0500")
Message-ID: <87lez4lz96.fsf_-_@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.2 (gnu/linux)
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable
X-Spamd-Bar: /
Authentication-Results: hera.aquilenet.fr;
	none
X-Rspamd-Server: hera
X-Rspamd-Queue-Id: DA0905D0
X-Spamd-Result: default: False [0.61 / 15.00]; ARC_NA(0.00)[];
 RCVD_VIA_SMTP_AUTH(0.00)[]; FROM_HAS_DN(0.00)[];
 RCPT_COUNT_THREE(0.00)[3]; TO_MATCH_ENVRCPT_ALL(0.00)[];
 FREEMAIL_ENVRCPT(0.00)[gmail.com]; TAGGED_RCPT(0.00)[];
 MIME_GOOD(-0.10)[text/plain]; TO_DN_SOME(0.00)[];
 FREEMAIL_TO(0.00)[gmail.com]; FROM_EQ_ENVFROM(0.00)[];
 MIME_TRACE(0.00)[0:+]; R_MIXED_CHARSET(0.71)[subject];
 RCVD_COUNT_TWO(0.00)[2]; RCVD_TLS_ALL(0.00)[];
 MID_RHS_MATCH_FROM(0.00)[];
 FREEMAIL_CC(0.00)[gmail.com,debbugs.gnu.org]
X-Spam-Score: 1.0 (+)
X-Debbugs-Envelope-To: 53447
Cc: 53447 <at> debbugs.gnu.org, Liliana Marie Prikler <liliana.prikler@HIDDEN>
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -0.0 (/)

Hi,

Maxim Cournoyer <maxim.cournoyer@HIDDEN> skribis:

> I like to see this as a bug, so I've opened one as 53514; Guix should
> strive to not mess with the host environment, and setting global
> variables used by both Guix and a potentially foreign host goes against
> this.  The proper fix would be to patch all applications in Guix to use
> Guix-specific variables, such as GUIX_XDG_DATA_DIRS instead of
> XDG_DATA_DIRS.

This approach has its appeal (like in the =E2=80=98GUIX_PYTHONPATH=E2=80=99=
 case), but
there=E2=80=99s a tension with our other unwritten (?) guideline that we sh=
ould
modify packages as little as possible.

Such wide-ranging changes would have the unfortunate effect that they=E2=80=
=99d
make Guix packages =E2=80=9Cspecial=E2=80=9D: documentation, bug reports, s=
uggestions
you=E2=80=99d find online would apply to the =E2=80=9Creal=E2=80=9D package=
, but maybe not to
the Guix one.  That is a situation we=E2=80=99d rather avoid IMO.


=E2=80=98XDG_DATA_DIRS=E2=80=99 is a real problem though.  In large part th=
at=E2=80=99s because
its purpose is too broad=E2=80=94what =E2=80=9Cdata dirs=E2=80=9D are we ta=
lking about?  It
would be ideal if we could progressively replace =E2=80=98XDG_DATA_DIRS=E2=
=80=99 search
path specifications with more specific environment variables, when they
exist, or perhaps by using =E2=80=98wrap-program=E2=80=99 instead of having=
 search path
specs.

Right now there are 9 packages that have =E2=80=98XDG_DATA_DIRS=E2=80=99 as=
 their search
path, including 4 Common Lisp packages.  Of the remaining ones, I guess
those we should first focus on are glib and qtbase.

Thoughts?

Ludo=E2=80=99.




Information forwarded to guix-patches@HIDDEN:
bug#53447; Package guix-patches. Full text available.

Message received at 53447 <at> debbugs.gnu.org:


Received: (at 53447) by debbugs.gnu.org; 25 Jan 2022 07:39:42 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Tue Jan 25 02:39:42 2022
Received: from localhost ([127.0.0.1]:46776 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1nCGQX-0005LI-TY
	for submit <at> debbugs.gnu.org; Tue, 25 Jan 2022 02:39:42 -0500
Received: from hera.aquilenet.fr ([185.233.100.1]:45182)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <ludo@HIDDEN>) id 1nCGQU-0005L4-W9
 for 53447 <at> debbugs.gnu.org; Tue, 25 Jan 2022 02:39:41 -0500
Received: from localhost (localhost [127.0.0.1])
 by hera.aquilenet.fr (Postfix) with ESMTP id 4F1F7188;
 Tue, 25 Jan 2022 08:39:32 +0100 (CET)
X-Virus-Scanned: Debian amavisd-new at aquilenet.fr
Received: from hera.aquilenet.fr ([127.0.0.1])
 by localhost (hera.aquilenet.fr [127.0.0.1]) (amavisd-new, port 10024)
 with ESMTP id h59taH-J0KEp; Tue, 25 Jan 2022 08:39:31 +0100 (CET)
Received: from ribbon (91-160-117-201.subs.proxad.net [91.160.117.201])
 by hera.aquilenet.fr (Postfix) with ESMTPSA id D98EC8B;
 Tue, 25 Jan 2022 08:39:30 +0100 (CET)
From: =?utf-8?Q?Ludovic_Court=C3=A8s?= <ludo@HIDDEN>
To: Liliana Marie Prikler <liliana.prikler@HIDDEN>
Subject: Re: bug#53447: [PATCH] doc: Unset environment variables considered
 harmful
References: <a57ac1e74fda0ee2585d4a3cb3244fcbcb0c84a3.camel@HIDDEN>
 <875yqb21va.fsf@HIDDEN>
 <19bb45159c0934e8d84035abdcfb00d8202233dd.camel@HIDDEN>
X-URL: http://www.fdn.fr/~lcourtes/
X-Revolutionary-Date: 6 =?utf-8?Q?Pluvi=C3=B4se?= an 230 de la =?utf-8?Q?R?=
 =?utf-8?Q?=C3=A9volution?=
X-PGP-Key-ID: 0x090B11993D9AEBB5
X-PGP-Key: http://www.fdn.fr/~lcourtes/ludovic.asc
X-PGP-Fingerprint: 3CE4 6455 8A84 FDC6 9DB4  0CFB 090B 1199 3D9A EBB5
X-OS: x86_64-pc-linux-gnu
Date: Tue, 25 Jan 2022 08:39:29 +0100
In-Reply-To: <19bb45159c0934e8d84035abdcfb00d8202233dd.camel@HIDDEN>
 (Liliana Marie Prikler's message of "Sat, 22 Jan 2022 18:53:02 +0100")
Message-ID: <875yq8qn66.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.2 (gnu/linux)
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable
X-Spamd-Bar: /
Authentication-Results: hera.aquilenet.fr;
	none
X-Rspamd-Server: hera
X-Rspamd-Queue-Id: 4F1F7188
X-Spamd-Result: default: False [-0.10 / 15.00]; ARC_NA(0.00)[];
 RCVD_VIA_SMTP_AUTH(0.00)[]; FROM_HAS_DN(0.00)[];
 TO_DN_SOME(0.00)[]; TO_MATCH_ENVRCPT_ALL(0.00)[];
 FREEMAIL_ENVRCPT(0.00)[gmail.com]; TAGGED_RCPT(0.00)[];
 MIME_GOOD(-0.10)[text/plain]; RCPT_COUNT_TWO(0.00)[2];
 FREEMAIL_TO(0.00)[gmail.com]; FROM_EQ_ENVFROM(0.00)[];
 MIME_TRACE(0.00)[0:+]; RCVD_COUNT_TWO(0.00)[2];
 RCVD_TLS_ALL(0.00)[]; MID_RHS_MATCH_FROM(0.00)[]
X-Spam-Score: 1.0 (+)
X-Debbugs-Envelope-To: 53447
Cc: 53447 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -0.0 (/)

Hi,

Liliana Marie Prikler <liliana.prikler@HIDDEN> skribis:

> I think there are too many examples to exhaustively list them all, but
> to give an example, [1, 2, 3, 4] are all the same bug and in [2] Carlo
> said we should document this under "Application Setup".  My personal
> stance is that the Guix behaviour is not a bug and other distros are
> weird for not explicitly binding it.

How about focusing specifically on XDG_DATA_DIRS, which is the root
cause of the first two bugs you mention?

We could say that installing certain packages will cause
~/.guix-profile/etc/profile to define XDG_DATA_DIRS, that this can
interfere with software installed outside Guix, such as GNOME, and that
we recommend unsetting XDG_DATA_DIRS (is that what we recommend?
breaking Guix-installed packages instead of breaking distro-installed
packages?)?

Thanks,
Ludo=E2=80=99.

> [1] https://issues.guix.gnu.org/26202
> [2] https://issues.guix.gnu.org/45360
> [3] https://issues.guix.gnu.org/48300
> [4] https://issues.guix.gnu.org/53379




Information forwarded to guix-patches@HIDDEN:
bug#53447; Package guix-patches. Full text available.

Message received at 53447 <at> debbugs.gnu.org:


Received: (at 53447) by debbugs.gnu.org; 24 Jan 2022 22:27:10 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Mon Jan 24 17:27:10 2022
Received: from localhost ([127.0.0.1]:46136 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1nC7np-0000iV-I9
	for submit <at> debbugs.gnu.org; Mon, 24 Jan 2022 17:27:09 -0500
Received: from mail-qt1-f170.google.com ([209.85.160.170]:34434)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <maxim.cournoyer@HIDDEN>) id 1nC7nn-0000iG-Dx
 for 53447 <at> debbugs.gnu.org; Mon, 24 Jan 2022 17:27:07 -0500
Received: by mail-qt1-f170.google.com with SMTP id c15so8867520qtv.1
 for <53447 <at> debbugs.gnu.org>; Mon, 24 Jan 2022 14:27:07 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112;
 h=from:to:cc:subject:references:date:in-reply-to:message-id
 :user-agent:mime-version:content-transfer-encoding;
 bh=iuTOWwsuYRY0+8jT4vahbzBYoagwr0gQ9GBLxy/K1VQ=;
 b=gEhG7drM54fKWHM+KR4866Rpj4TMpVVH+LmC3mOBrXR0JE6DMEGxMHCqr6Rmh3olij
 ZcCdzBBTb6xdOrTeBEGNvdwhvzaDIfugrMHI/juWDGJSWehLHynhzcykgd2LKjGe3BnQ
 UU0JAk1P/AYJPN0GwCLjLxwXp6ydcR1xHjbPHE6YZblPACvNhnF5+H/mECAN9fKIlMHc
 ebTaqTnMrgWKJcKJ1HcXqhp6dz+6Zt1VLN4N8ILEAmF+rv8JEwe1NwSbBqsrFE4Qqjq3
 BAYrFgVio3rsvzC/18RjZQxd1jTmfM/IDn3yXhsY7bsMqt/i3JpW7DGNcZidegRpqCyp
 JbUA==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20210112;
 h=x-gm-message-state:from:to:cc:subject:references:date:in-reply-to
 :message-id:user-agent:mime-version:content-transfer-encoding;
 bh=iuTOWwsuYRY0+8jT4vahbzBYoagwr0gQ9GBLxy/K1VQ=;
 b=Nu8fg1ZO1Te8AWLGH+MUg/KQDZPIsDod6Ne6bdXhM+a1WzguXkcfvERp7FPppqp1Eh
 tToz7x9o2+MtpUGiFs8x5x9ao0rxGs1axvjZErfDjjgrB4ToNAVpUE7IJ2hqrR225OO1
 a3lK0PA+dzs/Ff+EVxl9kbuucBxaT/YZhJP6iBOeCUd/wKB4Q5q7yZLrvEIFqLJ39oQ8
 L1BDvnaRCAcdhZJuYWyD33J70EJOPvAVRqBQiyj6hTCvYN4Vtq6z6U8tH3lUncFVxrkJ
 Nmx8bo7Fjb5SMpOvfaxyZLCoRNUOLHrAs6sssxpb2cqqESUSDKHD86JEcbSk2L76SfKb
 ESaA==
X-Gm-Message-State: AOAM530jg/MoFa0v2SyhvH2BgfAnHU5jVgmauig928+V1Bl4BdsJ6tf3
 BQctIDdYAihMU80/4Cei/KZkw/6yOUg=
X-Google-Smtp-Source: ABdhPJwALfaCpGBcASFNtw2LdKXNZIPb+G7mpu6R55i4KdrlwG6voFdD5gXrN7D3Cf6n5psIkMxBzQ==
X-Received: by 2002:ac8:5993:: with SMTP id e19mr14488266qte.500.1643063221789; 
 Mon, 24 Jan 2022 14:27:01 -0800 (PST)
Received: from hurd (dsl-205-233-125-146.b2b2c.ca. [205.233.125.146])
 by smtp.gmail.com with ESMTPSA id h12sm7876131qkp.129.2022.01.24.14.27.01
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Mon, 24 Jan 2022 14:27:01 -0800 (PST)
From: Maxim Cournoyer <maxim.cournoyer@HIDDEN>
To: Liliana Marie Prikler <liliana.prikler@HIDDEN>
Subject: Re: bug#53447: [PATCH] doc: Unset environment variables considered
 harmful
References: <a57ac1e74fda0ee2585d4a3cb3244fcbcb0c84a3.camel@HIDDEN>
 <875yqb21va.fsf@HIDDEN>
 <19bb45159c0934e8d84035abdcfb00d8202233dd.camel@HIDDEN>
Date: Mon, 24 Jan 2022 17:27:00 -0500
In-Reply-To: <19bb45159c0934e8d84035abdcfb00d8202233dd.camel@HIDDEN>
 (Liliana Marie Prikler's message of "Sat, 22 Jan 2022 18:53:02 +0100")
Message-ID: <87y2344vnv.fsf_-_@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.2 (gnu/linux)
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable
X-Spam-Score: 0.0 (/)
X-Debbugs-Envelope-To: 53447
Cc: Ludovic =?utf-8?Q?Court=C3=A8s?= <ludo@HIDDEN>, 53447 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

Hi Liliana and Ludo,

Liliana Marie Prikler <liliana.prikler@HIDDEN> writes:

> Hi Ludo,
>
> Am Samstag, dem 22.01.2022 um 17:04 +0100 schrieb Ludovic Court=C3=A8s:
>> Hi Liliana,
>>=20
>> Liliana Marie Prikler <liliana.prikler@HIDDEN> skribis:
>>=20
>> > * doc/guix.texi (Application Setup): Add subsection for implicit
>> > environment variables.
>> > ---
>> > =C2=A0doc/guix.texi | 27 +++++++++++++++++++++++++++
>> > =C2=A01 file changed, 27 insertions(+)
>> >=20
>> > diff --git a/doc/guix.texi b/doc/guix.texi
>> > index 912a8e3c5a..805e3b611f 100644
>> > --- a/doc/guix.texi
>> > +++ b/doc/guix.texi
>> > @@ -2023,6 +2023,33 @@ want to avoid auto-loading the Emacs
>> > packages installed with Guix, you
>> > =C2=A0can do so by running Emacs with the @option{--no-site-file} opti=
on
>> > =C2=A0(@pxref{Init File,,, emacs, The GNU Emacs Manual}).
>> > =C2=A0
>> > +@subsection Implicit Environment Variables
>> > +
>> > +Many environment variables are defined in a way that assumes a
>> > certain
>> > +default value, even if unset.=C2=A0 For example, bash uses the current
>> > +working directory as @env{PATH} if unset, or @env{XDG_CONFIG_HOME}
>> > +expands to @file{$HOME/.config}.=C2=A0 Some of these defaults remain
>> > the same
>> > +whether a package is used through Guix or not---however,
>> > environment
>> > +variables referring to @file{/etc} or @file{/usr} typically have
>> > their
>> > +meaning subtly changed in Guix.=C2=A0 An application installed via Gu=
ix
>> > might
>> > +instead look up files in its own @file{etc} structure, or (if a
>> > +search-path was specified) even override the default for packages
>> > from
>> > +the foreign distro.
>>=20
>> I think I miss some context: what concrete problem is this trying to
>> solve?=C2=A0 What is it telling me to do?
>>=20
>> I wonder to what extent this is actionable for a user, due to wording
>> that leaves it up to the reader to figure out how this applies to
>> them:
>>=20
>> =C2=A0 =E2=80=9CMany environment variables=E2=80=9D
>> =C2=A0 =E2=80=9Ca certain default value=E2=80=9D
>> =C2=A0 =E2=80=9CSome of these=E2=80=9D
>> =C2=A0 =E2=80=9CAn application installed via Guix might=E2=80=9D
>> =C2=A0 =E2=80=9Cproblems coming from such implicitly defined=E2=80=9D
>> =C2=A0 =E2=80=A6
>>=20
>> I think the =E2=80=9CApplication Setup=E2=80=9D section should be as con=
crete as
>> possible, with clear instructions (=E2=80=9CIf X then type Y=E2=80=9D), =
possibly
>> followed by explanations that curious readers can read and that
>> others can skip.
>>=20
>> WDYT?

I initially thought it unnecessary and vague, but after reading the bug
reports listed below, it seems to make sense to document it.  And
reading it now, that's probably the issue I encountered myself in
https://issues.guix.gnu.org/53233.

> I think there are too many examples to exhaustively list them all, but
> to give an example, [1, 2, 3, 4] are all the same bug and in [2] Carlo
> said we should document this under "Application Setup".  My personal
> stance is that the Guix behaviour is not a bug and other distros are
> weird for not explicitly binding it.

I like to see this as a bug, so I've opened one as 53514; Guix should
strive to not mess with the host environment, and setting global
variables used by both Guix and a potentially foreign host goes against
this.  The proper fix would be to patch all applications in Guix to use
Guix-specific variables, such as GUIX_XDG_DATA_DIRS instead of
XDG_DATA_DIRS.

> I know my wording is not the best here, but "If X then Y" is a little
> too late when your session broke.  But if your session broke and you
> read the manual saying "blah blah unset environment variables evil",
> you are more likely to suspect "hmm, maybe evil environment variables
> were evil".  Fortunately, with distros trying out Flatpaks and Snaps,
> XDG_DATA_DIRS is less likely to break them, but still.  We never know
> which variable will be the next to blow things up.

Agreed that this is useful in the meantime.  Perhaps add a TODO comment
pointing to the bug I've opened.

Thank you,

Maxim




Information forwarded to guix-patches@HIDDEN:
bug#53447; Package guix-patches. Full text available.

Message received at 53447 <at> debbugs.gnu.org:


Received: (at 53447) by debbugs.gnu.org; 22 Jan 2022 17:53:13 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sat Jan 22 12:53:13 2022
Received: from localhost ([127.0.0.1]:37813 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1nBKZd-0001lL-2A
	for submit <at> debbugs.gnu.org; Sat, 22 Jan 2022 12:53:13 -0500
Received: from mail-wr1-f66.google.com ([209.85.221.66]:38505)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <liliana.prikler@HIDDEN>) id 1nBKZb-0001l6-GJ
 for 53447 <at> debbugs.gnu.org; Sat, 22 Jan 2022 12:53:12 -0500
Received: by mail-wr1-f66.google.com with SMTP id h29so3157484wrb.5
 for <53447 <at> debbugs.gnu.org>; Sat, 22 Jan 2022 09:53:11 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112;
 h=message-id:subject:from:to:cc:date:in-reply-to:references
 :user-agent:mime-version:content-transfer-encoding;
 bh=KDtmAoLiyQMMflvd0yh+FNSBskw4I7RMeOClHkeP0Sg=;
 b=RgIQAsvcyHNrhyayaPAALtzkjxUb5RDunKOhDY9hv7NgdJ+pL8MnO+EH/ROTGJdSjb
 X8GA/e2zp7AfNrysJcpJYjCQREt6G9DdsM3gakGqg7Hq4em6TECwMZled2GqqDoScf0A
 48Jrs9cGplmYfojnEKUpH2xxc1CJLPOlXVBft2fNUQZ3Iy7LW/yqOHilxEYQmt2sWhB/
 DstAjesA/U5MkfZlJMA66/LuXNNpJpr5CKn5eCRyinEu7nkn7FkBfDI4SJMI3x20lJaK
 aF2Kperp1m6xXvoz5s/0YRRXLkFTqdAqsi+l98GKmWJzCWcFl/dWkT7swOz1aOPq3t6L
 w5Ng==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20210112;
 h=x-gm-message-state:message-id:subject:from:to:cc:date:in-reply-to
 :references:user-agent:mime-version:content-transfer-encoding;
 bh=KDtmAoLiyQMMflvd0yh+FNSBskw4I7RMeOClHkeP0Sg=;
 b=hzjDTvG9CC5iGsAxjHXrdmE3Sdoh+zm9rJZXO2TcUhSLCMo5jQrq1Swkj95KUnf+Tn
 hhgpHXnKhGJ3c0suS9tzeM9Xb1WnqFu579aJyxR/F9hCZIoUPE4ZAZVgYiuz2IJRF9Se
 VbieldB0lMQbTb4B5zvaie8kcuiPRrdL6I7OtTGUkpqz9FGaywQ3YowpZ+icM+f1NrH4
 b+BqT7Tn1jD0luiGLSyRhFLOIADwYZwTwnHqs/XqmSCcQK+yOMvclSDYWaTk6HK6t/uj
 Gk1J970hz9w0YoR8jp5lXhaQqd8JIwJ8nHDpBFSya0hnqa5x5u7LAwW3ySMVIeHNKr/L
 J8Gg==
X-Gm-Message-State: AOAM530d2FoG9z2xyZkh9Y+ZePlygIspDA9d+Xxai3NYRUIDUOGaNNRg
 jigILyDl+kcK/k96MkBSIyE=
X-Google-Smtp-Source: ABdhPJx8n3AUAmn6Vrl7xcwes1+GJKimvcachVMUWWOiAnlFnG53oQugJxiKD6H+LX2Cb3V2ZmT+Gg==
X-Received: by 2002:a05:6000:1acb:: with SMTP id
 i11mr8610627wry.617.1642873985174; 
 Sat, 22 Jan 2022 09:53:05 -0800 (PST)
Received: from nijino.fritz.box (85-127-52-93.dsl.dynamic.surfer.at.
 [85.127.52.93])
 by smtp.gmail.com with ESMTPSA id i6sm5073202wrw.8.2022.01.22.09.53.04
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Sat, 22 Jan 2022 09:53:04 -0800 (PST)
Message-ID: <19bb45159c0934e8d84035abdcfb00d8202233dd.camel@HIDDEN>
Subject: Re: bug#53447: [PATCH] doc: Unset environment variables considered
 harmful
From: Liliana Marie Prikler <liliana.prikler@HIDDEN>
To: Ludovic =?ISO-8859-1?Q?Court=E8s?= <ludo@HIDDEN>
Date: Sat, 22 Jan 2022 18:53:02 +0100
In-Reply-To: <875yqb21va.fsf@HIDDEN>
References: <a57ac1e74fda0ee2585d4a3cb3244fcbcb0c84a3.camel@HIDDEN>
 <875yqb21va.fsf@HIDDEN>
Content-Type: text/plain; charset="UTF-8"
User-Agent: Evolution 3.42.1 
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
X-Spam-Score: 0.0 (/)
X-Debbugs-Envelope-To: 53447
Cc: 53447 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

Hi Ludo,

Am Samstag, dem 22.01.2022 um 17:04 +0100 schrieb Ludovic Courtès:
> Hi Liliana,
> 
> Liliana Marie Prikler <liliana.prikler@HIDDEN> skribis:
> 
> > * doc/guix.texi (Application Setup): Add subsection for implicit
> > environment variables.
> > ---
> >  doc/guix.texi | 27 +++++++++++++++++++++++++++
> >  1 file changed, 27 insertions(+)
> > 
> > diff --git a/doc/guix.texi b/doc/guix.texi
> > index 912a8e3c5a..805e3b611f 100644
> > --- a/doc/guix.texi
> > +++ b/doc/guix.texi
> > @@ -2023,6 +2023,33 @@ want to avoid auto-loading the Emacs
> > packages installed with Guix, you
> >  can do so by running Emacs with the @option{--no-site-file} option
> >  (@pxref{Init File,,, emacs, The GNU Emacs Manual}).
> >  
> > +@subsection Implicit Environment Variables
> > +
> > +Many environment variables are defined in a way that assumes a
> > certain
> > +default value, even if unset.  For example, bash uses the current
> > +working directory as @env{PATH} if unset, or @env{XDG_CONFIG_HOME}
> > +expands to @file{$HOME/.config}.  Some of these defaults remain
> > the same
> > +whether a package is used through Guix or not---however,
> > environment
> > +variables referring to @file{/etc} or @file{/usr} typically have
> > their
> > +meaning subtly changed in Guix.  An application installed via Guix
> > might
> > +instead look up files in its own @file{etc} structure, or (if a
> > +search-path was specified) even override the default for packages
> > from
> > +the foreign distro.
> 
> I think I miss some context: what concrete problem is this trying to
> solve?  What is it telling me to do?
> 
> I wonder to what extent this is actionable for a user, due to wording
> that leaves it up to the reader to figure out how this applies to
> them:
> 
>   “Many environment variables”
>   “a certain default value”
>   “Some of these”
>   “An application installed via Guix might”
>   “problems coming from such implicitly defined”
>   …
> 
> I think the “Application Setup” section should be as concrete as
> possible, with clear instructions (“If X then type Y”), possibly
> followed by explanations that curious readers can read and that
> others can skip.
> 
> WDYT?
I think there are too many examples to exhaustively list them all, but
to give an example, [1, 2, 3, 4] are all the same bug and in [2] Carlo
said we should document this under "Application Setup".  My personal
stance is that the Guix behaviour is not a bug and other distros are
weird for not explicitly binding it.

I know my wording is not the best here, but "If X then Y" is a little
too late when your session broke.  But if your session broke and you
read the manual saying "blah blah unset environment variables evil",
you are more likely to suspect "hmm, maybe evil environment variables
were evil".  Fortunately, with distros trying out Flatpaks and Snaps,
XDG_DATA_DIRS is less likely to break them, but still.  We never know
which variable will be the next to blow things up.

Cheers

[1] https://issues.guix.gnu.org/26202
[2] https://issues.guix.gnu.org/45360
[3] https://issues.guix.gnu.org/48300
[4] https://issues.guix.gnu.org/53379




Information forwarded to guix-patches@HIDDEN:
bug#53447; Package guix-patches. Full text available.

Message received at 53447 <at> debbugs.gnu.org:


Received: (at 53447) by debbugs.gnu.org; 22 Jan 2022 16:04:34 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sat Jan 22 11:04:34 2022
Received: from localhost ([127.0.0.1]:37708 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1nBIsU-0007HA-1Q
	for submit <at> debbugs.gnu.org; Sat, 22 Jan 2022 11:04:34 -0500
Received: from hera.aquilenet.fr ([185.233.100.1]:56152)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <ludo@HIDDEN>) id 1nBIsS-0007Gw-DM
 for 53447 <at> debbugs.gnu.org; Sat, 22 Jan 2022 11:04:32 -0500
Received: from localhost (localhost [127.0.0.1])
 by hera.aquilenet.fr (Postfix) with ESMTP id 985C31D2;
 Sat, 22 Jan 2022 17:04:26 +0100 (CET)
X-Virus-Scanned: Debian amavisd-new at aquilenet.fr
Received: from hera.aquilenet.fr ([127.0.0.1])
 by localhost (hera.aquilenet.fr [127.0.0.1]) (amavisd-new, port 10024)
 with ESMTP id 09pawlt5pIzc; Sat, 22 Jan 2022 17:04:25 +0100 (CET)
Received: from ribbon (91-160-117-201.subs.proxad.net [91.160.117.201])
 by hera.aquilenet.fr (Postfix) with ESMTPSA id 7CC201A0;
 Sat, 22 Jan 2022 17:04:25 +0100 (CET)
From: =?utf-8?Q?Ludovic_Court=C3=A8s?= <ludo@HIDDEN>
To: Liliana Marie Prikler <liliana.prikler@HIDDEN>
Subject: Re: bug#53447: [PATCH] doc: Unset environment variables considered
 harmful
References: <a57ac1e74fda0ee2585d4a3cb3244fcbcb0c84a3.camel@HIDDEN>
Date: Sat, 22 Jan 2022 17:04:25 +0100
In-Reply-To: <a57ac1e74fda0ee2585d4a3cb3244fcbcb0c84a3.camel@HIDDEN>
 (Liliana Marie Prikler's message of "Sat, 22 Jan 2022 15:13:20 +0100")
Message-ID: <875yqb21va.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.2 (gnu/linux)
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable
X-Spamd-Bar: /
Authentication-Results: hera.aquilenet.fr;
	none
X-Rspamd-Server: hera
X-Rspamd-Queue-Id: 985C31D2
X-Spamd-Result: default: False [-0.10 / 15.00]; ARC_NA(0.00)[];
 RCVD_VIA_SMTP_AUTH(0.00)[]; FROM_HAS_DN(0.00)[];
 TO_DN_SOME(0.00)[]; FREEMAIL_ENVRCPT(0.00)[gmail.com];
 TO_MATCH_ENVRCPT_ALL(0.00)[]; TAGGED_RCPT(0.00)[];
 MIME_GOOD(-0.10)[text/plain]; RCPT_COUNT_TWO(0.00)[2];
 FREEMAIL_TO(0.00)[gmail.com]; FROM_EQ_ENVFROM(0.00)[];
 MIME_TRACE(0.00)[0:+]; RCVD_COUNT_TWO(0.00)[2];
 RCVD_TLS_ALL(0.00)[]; MID_RHS_MATCH_FROM(0.00)[]
X-Spam-Score: 1.0 (+)
X-Debbugs-Envelope-To: 53447
Cc: 53447 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -0.0 (/)

Hi Liliana,

Liliana Marie Prikler <liliana.prikler@HIDDEN> skribis:

> * doc/guix.texi (Application Setup): Add subsection for implicit environm=
ent
> variables.
> ---
>  doc/guix.texi | 27 +++++++++++++++++++++++++++
>  1 file changed, 27 insertions(+)
>
> diff --git a/doc/guix.texi b/doc/guix.texi
> index 912a8e3c5a..805e3b611f 100644
> --- a/doc/guix.texi
> +++ b/doc/guix.texi
> @@ -2023,6 +2023,33 @@ want to avoid auto-loading the Emacs packages inst=
alled with Guix, you
>  can do so by running Emacs with the @option{--no-site-file} option
>  (@pxref{Init File,,, emacs, The GNU Emacs Manual}).
>=20=20
> +@subsection Implicit Environment Variables
> +
> +Many environment variables are defined in a way that assumes a certain
> +default value, even if unset.  For example, bash uses the current
> +working directory as @env{PATH} if unset, or @env{XDG_CONFIG_HOME}
> +expands to @file{$HOME/.config}.  Some of these defaults remain the same
> +whether a package is used through Guix or not---however, environment
> +variables referring to @file{/etc} or @file{/usr} typically have their
> +meaning subtly changed in Guix.  An application installed via Guix might
> +instead look up files in its own @file{etc} structure, or (if a
> +search-path was specified) even override the default for packages from
> +the foreign distro.

I think I miss some context: what concrete problem is this trying to
solve?  What is it telling me to do?

I wonder to what extent this is actionable for a user, due to wording
that leaves it up to the reader to figure out how this applies to them:

  =E2=80=9CMany environment variables=E2=80=9D
  =E2=80=9Ca certain default value=E2=80=9D
  =E2=80=9CSome of these=E2=80=9D
  =E2=80=9CAn application installed via Guix might=E2=80=9D
  =E2=80=9Cproblems coming from such implicitly defined=E2=80=9D
  =E2=80=A6

I think the =E2=80=9CApplication Setup=E2=80=9D section should be as concre=
te as
possible, with clear instructions (=E2=80=9CIf X then type Y=E2=80=9D), pos=
sibly
followed by explanations that curious readers can read and that others
can skip.

WDYT?

Ludo=E2=80=99.




Information forwarded to guix-patches@HIDDEN:
bug#53447; Package guix-patches. Full text available.

Message received at submit <at> debbugs.gnu.org:


Received: (at submit) by debbugs.gnu.org; 22 Jan 2022 14:16:59 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sat Jan 22 09:16:59 2022
Received: from localhost ([127.0.0.1]:36055 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1nBHCN-0003VP-5A
	for submit <at> debbugs.gnu.org; Sat, 22 Jan 2022 09:16:59 -0500
Received: from lists.gnu.org ([209.51.188.17]:35382)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <liliana.prikler@HIDDEN>) id 1nBHCL-0003VI-Ov
 for submit <at> debbugs.gnu.org; Sat, 22 Jan 2022 09:16:58 -0500
Received: from eggs.gnu.org ([209.51.188.92]:50950)
 by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <liliana.prikler@HIDDEN>)
 id 1nBHCK-0006DU-Uh
 for guix-patches@HIDDEN; Sat, 22 Jan 2022 09:16:57 -0500
Received: from [2a00:1450:4864:20::443] (port=42882
 helo=mail-wr1-x443.google.com)
 by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128)
 (Exim 4.90_1) (envelope-from <liliana.prikler@HIDDEN>)
 id 1nBHCJ-0007te-Cn
 for guix-patches@HIDDEN; Sat, 22 Jan 2022 09:16:56 -0500
Received: by mail-wr1-x443.google.com with SMTP id a13so5078067wrh.9
 for <guix-patches@HIDDEN>; Sat, 22 Jan 2022 06:16:52 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112;
 h=from:date:subject:to:content-transfer-encoding:message-id
 :mime-version; bh=nok2hJiP/4x23WJQTprT+KHLTN2O4FgLumAs1rSpdm4=;
 b=XwTuLxyQpM8M79GACRkEI09Z/DoRX4gLpgSXjbJS2vUsv8b00ah+Mhmb0aPeJCLSem
 Ctnlgs8kZgo9j132uoyZR6eU7nw8Sw0NG2maWOKBEqGIZubq315UgS8AcWoXOMuAn/nX
 4elU2zFUBkkF4dbpasPes/2t7yFAsxP4BVr6F3B4Fj2ayeC9fakAVM7G1Ny82FggzDdO
 SI+H9/pk+xNnq6g+AhJagsnM97OGKVzs2OZvmRqCODJj9wyk8LJcjpH0eSYeRVm6EBIf
 KgCQ1HImBPEygdit/0CMRePeOzfAfHZJUvgU6Hp8d3fm7jUeAtP1YaTAqikA8AbDIKKe
 hc9A==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20210112;
 h=x-gm-message-state:from:date:subject:to:content-transfer-encoding
 :message-id:mime-version;
 bh=nok2hJiP/4x23WJQTprT+KHLTN2O4FgLumAs1rSpdm4=;
 b=pr65wuwAkaTmar+ZLRK1tvFMa7rKDkDGaSzPGv5BeugT7lqrw+fqKnexqlMmKbrPuW
 TvBvT8WhjbgSyofKPHzArRW74ly1OEThdc2jBJmI8Jn+ehpJP2xnNz3Bi0UGpMH4Onyc
 5MW7IsANeu6gT2jlYbc9QUVBMRJ51EYOWsazB+A5G8+wtllT+wn+5zCuGcDDNvZBfJmD
 P9ywQBOZh7XuldMpapKtiikGAJRqHIuwJE3j86KSzg9cFBF9EzEX6VRrfNtOqG8LNRlG
 5kWNb24inC+gx4oW58zGxM9+l8zqo/0oPGFQqIZg5yBsotRf6BL3WXwFZgV3D7sGEe4f
 QUBw==
X-Gm-Message-State: AOAM533SDbcYzWbwXvPP69dWFGvaZ5gUMVtW7R5Oq5wY6104a85GSMTF
 XsrYuK5GbID8ku/nyOoSvRtkZ/ciz6k=
X-Google-Smtp-Source: ABdhPJzJEmvl8n4Qg7zrshbxDW8W2AHtABLJnPt+ZrB0H0xPC/JOXPkprF3KOcf5/uQR7RsFvANklg==
X-Received: by 2002:adf:dec3:: with SMTP id i3mr1420349wrn.225.1642861010937; 
 Sat, 22 Jan 2022 06:16:50 -0800 (PST)
Received: from nijino.fritz.box (85-127-52-93.dsl.dynamic.surfer.at.
 [85.127.52.93])
 by smtp.gmail.com with ESMTPSA id z13sm10280551wrm.90.2022.01.22.06.16.49
 for <guix-patches@HIDDEN>
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Sat, 22 Jan 2022 06:16:50 -0800 (PST)
From: Liliana Marie Prikler <liliana.prikler@HIDDEN>
Date: Sat, 22 Jan 2022 15:13:20 +0100
Subject: [PATCH] doc: Unset environment variables considered harmful
to: guix-patches@HIDDEN
Content-Transfer-Encoding: 7bit
Message-ID: <a57ac1e74fda0ee2585d4a3cb3244fcbcb0c84a3.camel@HIDDEN>
MIME-Version: 1.0
X-Host-Lookup-Failed: Reverse DNS lookup failed for 2a00:1450:4864:20::443
 (failed)
Received-SPF: pass client-ip=2a00:1450:4864:20::443;
 envelope-from=liliana.prikler@HIDDEN; helo=mail-wr1-x443.google.com
X-Spam_score_int: -12
X-Spam_score: -1.3
X-Spam_bar: -
X-Spam_report: (-1.3 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1,
 DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001,
 PDS_HP_HELO_NORDNS=0.001, RCVD_IN_DNSWL_NONE=-0.0001, RDNS_NONE=0.793,
 SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no
X-Spam_action: no action
X-Spam-Score: 1.4 (+)
X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org",
 has NOT identified this incoming email as spam.  The original
 message has been attached to this so you can view it or label
 similar future email.  If you have any questions, see
 the administrator of that system for details.
 Content preview: * doc/guix.texi (Application Setup): Add subsection for
 implicit
 environment variables. --- doc/guix.texi | 27 +++++++++++++++++++++++++++
 1 file changed, 27 insertions(+) diff --git a/doc/guix.texi b/doc/guix.texi
 index 912a8e3c5a..805e3b611f 100644 --- a/doc/guix.texi +++ b/doc/guix.texi
 @@ -2023, 6 +2023,
 33 @@ want to avoid auto-loading the Emacs packages installed
 wi [...] 
 Content analysis details:   (1.4 points, 10.0 required)
 pts rule name              description
 ---- ---------------------- --------------------------------------------------
 -0.0 SPF_HELO_PASS          SPF: HELO matches SPF record
 1.0 SPF_SOFTFAIL           SPF: sender does not match SPF record (softfail)
 0.0 FREEMAIL_FROM          Sender email is commonly abused enduser mail
 provider (liliana.prikler[at]gmail.com)
 -2.3 RCVD_IN_DNSWL_MED      RBL: Sender listed at https://www.dnswl.org/,
 medium trust [209.51.188.17 listed in list.dnswl.org]
 -0.0 RCVD_IN_MSPIKE_H2      RBL: Average reputation (+2)
 [209.51.188.17 listed in wl.mailspike.net]
 1.3 SPOOFED_FREEMAIL       No description available.
 1.5 SPOOF_GMAIL_MID        From Gmail but it doesn't seem to be...
X-Debbugs-Envelope-To: submit
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -2.3 (--)

* doc/guix.texi (Application Setup): Add subsection for implicit environment
variables.
---
 doc/guix.texi | 27 +++++++++++++++++++++++++++
 1 file changed, 27 insertions(+)

diff --git a/doc/guix.texi b/doc/guix.texi
index 912a8e3c5a..805e3b611f 100644
--- a/doc/guix.texi
+++ b/doc/guix.texi
@@ -2023,6 +2023,33 @@ want to avoid auto-loading the Emacs packages installed with Guix, you
 can do so by running Emacs with the @option{--no-site-file} option
 (@pxref{Init File,,, emacs, The GNU Emacs Manual}).
 
+@subsection Implicit Environment Variables
+
+Many environment variables are defined in a way that assumes a certain
+default value, even if unset.  For example, bash uses the current
+working directory as @env{PATH} if unset, or @env{XDG_CONFIG_HOME}
+expands to @file{$HOME/.config}.  Some of these defaults remain the same
+whether a package is used through Guix or not---however, environment
+variables referring to @file{/etc} or @file{/usr} typically have their
+meaning subtly changed in Guix.  An application installed via Guix might
+instead look up files in its own @file{etc} structure, or (if a
+search-path was specified) even override the default for packages from
+the foreign distro.
+
+In order to avoid problems coming from such implicitly defined
+environment variables, it is best to explicitly define them somewhere.
+Startup files like @file{~/.bash_profile} are usually a good location
+to do so.  However, not all setups treat them equally.  While on Guix
+System, the user's login shell is used to spawn a graphical session,
+other distros may choose a different approach.  For instance, systemd
+is capable of spawning graphical applications in a clean environment,
+but allows said environments to be modified through an
+@file{override.conf} placed in the right directory.
+
+Regardless of which method is used to set such environment variables,
+they typically should only be set once at login.  Placing them in files
+like @file{~/.bashrc} or similar has adverse effects on other commands
+that want to create clean environments, such as @command{guix shell}.
 
 @node Upgrading Guix
 @section Upgrading Guix
-- 
2.34.0





Acknowledgement sent to Liliana Marie Prikler <liliana.prikler@HIDDEN>:
New bug report received and forwarded. Copy sent to guix-patches@HIDDEN. Full text available.
Report forwarded to guix-patches@HIDDEN:
bug#53447; Package guix-patches. Full text available.
Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.
Last modified: Tue, 25 Jan 2022 13:45:01 UTC

GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997 nCipher Corporation Ltd, 1994-97 Ian Jackson.