GNU bug report logs - #51466
guix shell --check reports missing PKG_CONFIG_PATH on Debian bookworm

Previous Next

Package: guix;

Reported by: Vagrant Cascadian <vagrant <at> debian.org>

Date: Thu, 28 Oct 2021 19:10:02 UTC

Severity: normal

Tags: moreinfo

Merged with 53355

Full log


View this message in rfc822 format

From: Ludovic Courtès <ludo <at> gnu.org>
To: Vagrant Cascadian <vagrant <at> debian.org>
Cc: 51466 <at> debbugs.gnu.org
Subject: bug#51466: guix shell --check reports missing PKG_CONFIG_PATH on Debian bookworm
Date: Sat, 30 Oct 2021 16:21:25 +0200
[Message part 1 (text/plain, inline)]
Howdy!

Vagrant Cascadian <vagrant <at> debian.org> skribis:

> On 2021-10-29, Ludovic Courtès wrote:

[...]

>> If you look at ‘child-shell-environment’ in (guix scripts environment),
>> it runs this in the child shell:
>>
>>   env || /usr/bin/env || set; echo GUIX-CHECK-DONE; read x; exit
>>
>> If the shell prints non-newline-terminated stuff before the output of
>> ‘env’, the first line of ‘env’ would be swallowed by the parser below.
>>
>> Could you run:
>>
>>   strace -o log -s 500 guix shell --check -D guix
>>
>> to see exactly what ‘guix shell’ reads?
>
> That showed nothing obvious to me; the log it spits out is about 3MB
> (~320k compressed with zstd) I could attach if it is useful...
>
> I did notice SHELL=/bin/bash, and tried an experiment:
>
>   $ SHELL=/gnu/store/87kif0bpf0anwbsaw0jvg8fyciw4sz67-bash-5.0.16/bin/bash guix shell --check -D guix
>   guix shell: checking the environment variables visible from shell
>   '/gnu/store/87kif0bpf0anwbsaw0jvg8fyciw4sz67-bash-5.0.16/bin/bash'...
>   guix shell: All is good!  The shell gets correct environment variables.
>
> So, somehow the value of SHELL and/or the user's default shell is
> triggering the issue?

Yes, ‘--check’ runs $SHELL.

To make sure, could you try with the attached patch to see exactly which
variables ‘guix shell’ “sees”, and whether it drops a line it shouldn’t
drop?

TIA,
Ludo’.

[Message part 2 (text/x-patch, inline)]
diff --git a/guix/scripts/environment.scm b/guix/scripts/environment.scm
index cca0ad991b..7f3d3b9db8 100644
--- a/guix/scripts/environment.scm
+++ b/guix/scripts/environment.scm
@@ -452,10 +452,10 @@ (define lines
           ;; but it also truncates values anyway, so don't try to support it.
           (let ((index (string-index line #\=)))
             (if index
-                (vhash-cons (string-take line index)
+                (vhash-cons (pk 'variable line (string-take line index))
                             (string-drop line (+ 1 index))
                             table)
-                table)))
+                (pk 'dropped line table))))
         vlist-null
         lines))
 

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

Previous Next


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