unofficial mirror of bug-guix@gnu.org 
 help / color / mirror / code / Atom feed
From: "Ludovic Courtès" <ludo@gnu.org>
To: Vagrant Cascadian <vagrant@debian.org>
Cc: 51466@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	[thread overview]
Message-ID: <87lf2atwyi.fsf@gnu.org> (raw)
In-Reply-To: <87k0hvggu1.fsf@yucca> (Vagrant Cascadian's message of "Fri, 29 Oct 2021 23:35:50 -0700")

[-- Attachment #1: Type: text/plain, Size: 1449 bytes --]

Howdy!

Vagrant Cascadian <vagrant@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’.


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: Type: text/x-patch, Size: 701 bytes --]

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))
 

  reply	other threads:[~2021-10-30 14:22 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-10-28 19:08 bug#51466: guix shell --check reports missing PKG_CONFIG_PATH on Debian bookworm Vagrant Cascadian
2021-10-29 19:06 ` Ludovic Courtès
2021-10-30  6:35   ` Vagrant Cascadian
2021-10-30 14:21     ` Ludovic Courtès [this message]
2022-03-27 17:01 ` bug#51466: [PATCH 0/1] environment: properly parse environment variables during --check Kevin Boulain
2022-03-27 17:01   ` bug#51466: [PATCH 1/1] " Kevin Boulain

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://guix.gnu.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87lf2atwyi.fsf@gnu.org \
    --to=ludo@gnu.org \
    --cc=51466@debbugs.gnu.org \
    --cc=vagrant@debian.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).