GNU bug report logs - #60566
guix container with FHS emulation and env vars

Previous Next

Package: guix;

Reported by: jman <jman <at> city17.xyz>

Date: Thu, 5 Jan 2023 04:34:01 UTC

Severity: normal

Done: John Kehayias <john.kehayias <at> protonmail.com>

Bug is archived. No further changes may be made.

Full log


Message #8 received at 60566 <at> debbugs.gnu.org (full text, mbox):

From: John Kehayias <john.kehayias <at> protonmail.com>
To: jman <jman <at> city17.xyz>
Cc: Ludovic Courtès <ludo <at> gnu.org>, 60566 <at> debbugs.gnu.org
Subject: [PATCH] environment: Fix '--emulate-fhs' option overriding $PATH.
Date: Thu, 05 Jan 2023 21:19:48 +0000
[Message part 1 (text/plain, inline)]
On Wed, Jan 04, 2023 at 11:33 PM, jman wrote:

> Hello,
>
> When emulating a FHS I observe that env vars seems to be not preserved. Example,
> the following command will not preserve $PATH:
>
>     guix shell --container --emulate-fhs --preserve='^PATH$'
>
> When creating a container *without* emulating a FHS, env vars are available,
> example:
>
>     guix shell --container --preserve='^PATH$'
>
> Pastebin log of a sample of this behaviour:
> https://paste.sr.ht/~jman/65e7f96c445504e11f55595b237280e0c1e3ad34
>
> ref: https://lists.gnu.org/archive/html/help-guix/2023-01/msg00002.html
>
> Thanks for an opinion on this

Thanks for reporting, I can confirm this behavior.

Here is a patch for this where the FHS directories are added to the
current value of $PATH. I believe this should in general be fine since
this is the last step before actually calling the command given to 'guix
shell' and thus $PATH has been set or preserved as needed already.

CC'ing Ludo as most familiar with this code. Anything we should be aware
of here? This change to $PATH in the first place wasn't strictly needed
('guix shell' already has the profile bin directory) but I thought made
sense to make it look most like FHS.

Thanks!
John

[0001-environment-Fix-emulate-fhs-option-overriding-PATH.patch (text/x-patch, attachment)]

This bug report was last modified 2 years and 177 days ago.

Previous Next


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