GNU bug report logs - #43034
[PATCH] environment: Set USER and LOGNAME in container

Previous Next

Package: guix-patches;

Reported by: Lars-Dominik Braun <ldb <at> leibniz-psychology.org>

Date: Tue, 25 Aug 2020 08:59:01 UTC

Severity: normal

Tags: patch

Done: Ludovic Courtès <ludo <at> gnu.org>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 43034 in the body.
You can then email your comments to 43034 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to guix-patches <at> gnu.org:
bug#43034; Package guix-patches. (Tue, 25 Aug 2020 08:59:01 GMT) Full text and rfc822 format available.

Acknowledgement sent to Lars-Dominik Braun <ldb <at> leibniz-psychology.org>:
New bug report received and forwarded. Copy sent to guix-patches <at> gnu.org. (Tue, 25 Aug 2020 08:59:01 GMT) Full text and rfc822 format available.

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

From: Lars-Dominik Braun <ldb <at> leibniz-psychology.org>
To: guix-patches <at> gnu.org
Subject: [PATCH] environment: Set USER and LOGNAME in container
Date: Tue, 25 Aug 2020 10:58:24 +0200
[Message part 1 (text/plain, inline)]
Hi,

I noticed `guix environment -C` lacks the two environment variable USER and
LOGNAME, which are part of %precious-variables (i.e. not cleared), but not
explicitly set when using a container. Some programs, in my case RStudio (see
https://github.com/leibniz-psychology/psychnotebook-app-rstudio/commit/3e15b9b173b8a9d2a7f55743ecba24e54b77ffad),
expect these to be set and can’t function properly without. Thus, the attached
patch exports them. This works with and without `-u`.

Cheers,
Lars

[0001-environment-Set-USER-and-LOGNAME-in-container.patch (text/x-diff, attachment)]
[signature.asc (application/pgp-signature, inline)]

Reply sent to Ludovic Courtès <ludo <at> gnu.org>:
You have taken responsibility. (Sun, 30 Aug 2020 21:55:02 GMT) Full text and rfc822 format available.

Notification sent to Lars-Dominik Braun <ldb <at> leibniz-psychology.org>:
bug acknowledged by developer. (Sun, 30 Aug 2020 21:55:02 GMT) Full text and rfc822 format available.

Message #10 received at 43034-done <at> debbugs.gnu.org (full text, mbox):

From: Ludovic Courtès <ludo <at> gnu.org>
To: Lars-Dominik Braun <ldb <at> leibniz-psychology.org>
Cc: 43034-done <at> debbugs.gnu.org
Subject: Re: [bug#43034] [PATCH] environment: Set USER and LOGNAME in container
Date: Sun, 30 Aug 2020 23:54:26 +0200
Hi Lars,

Lars-Dominik Braun <ldb <at> leibniz-psychology.org> skribis:

> From 516fecf81c980a020906533cd5135c6a7603a0a1 Mon Sep 17 00:00:00 2001
> From: Lars-Dominik Braun <ldb <at> leibniz-psychology.org>
> Date: Tue, 25 Aug 2020 10:52:21 +0200
> Subject: [PATCH] environment: Set USER and LOGNAME in container
>
> * guix/scripts/environment.scm (launch-environment/container): Set
>   username environment variables.

Applied!

>                        ;; The same variables as in Nix's 'build.cc'.
>                        '("TMPDIR" "TEMPDIR" "TMP" "TEMP"))
>  
> +            ;; Some programs expect USER and/or LOGNAME to be set.
> +            (setenv "LOGNAME" logname)
> +            (setenv "USER" logname)

I was hesitant because so far we were more or less following the set of
variables exported by the daemon (see nix/libstore/build.cc), but there
were already exceptions (HOME, GUIX_ENVIRONMENT, PS1), and I think
making ‘guix environment -C’ more convenient is what matters.

Thanks,
Ludo’.




bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Mon, 28 Sep 2020 11:24:05 GMT) Full text and rfc822 format available.

This bug report was last modified 3 years and 208 days ago.

Previous Next


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