GNU bug report logs - #53355
guix shell --check: confusing error message

Previous Next

Package: guix;

Reported by: Chris Marusich <cmmarusich <at> gmail.com>

Date: Wed, 19 Jan 2022 03:30:02 UTC

Severity: normal

Tags: moreinfo

Merged with 51466

Full log


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

From: Ludovic Courtès <ludo <at> gnu.org>
To: Chris Marusich <cmmarusich <at> gmail.com>
Cc: 53355 <at> debbugs.gnu.org
Subject: Re: bug#53355: guix shell --check: confusing error message
Date: Mon, 24 Jan 2022 15:35:52 +0100
[Message part 1 (text/plain, inline)]
Hi Chris,

Chris Marusich <cmmarusich <at> gmail.com> skribis:

> [130] marusich <at> suzaku:~/guix-master
> $ guix shell --container --check -D guix
> guix shell: checking the environment variables visible from shell '/bin/bash'...
> guix shell: warning: variable 'PKG_CONFIG_PATH' is missing from shell environment

[...]

> I found the following things to be confusing:
>
> (1) The error message claims that PKG_CONFIG_PATH is "missing from shell
> environment."  However, it seems to be present when I run "env".
>
> (2) It says I can avoid the problem by passing the `--container' option,
> but even when I do that, the problem seems to persist.  If that is
> expected behavior, then perhaps the wording should be changed to
> something less certain, such as "you might be able to avoid the
> problem".  It does not seem to be the case that I can avoid the problem
> by passing the `--container' option in this case.

What’s confusing is that ‘--check’ does the same job whether or not
‘--container’ is passed: it checks the behavior of your shell *outside*
a container.

I think ‘--check’ should just do nothing when ‘--container’ is used,
possibly emitting a warning saying it’s not doing anything (patch
below).

Now, the diagnostic is hopefully correct if you use, say, ‘--pure’
instead of ‘--container’.  Could you check whether this is the case?

Thanks,
Ludo’.

[Message part 2 (text/x-patch, inline)]
diff --git a/guix/scripts/environment.scm b/guix/scripts/environment.scm
index 510cee727f..ec071402f4 100644
--- a/guix/scripts/environment.scm
+++ b/guix/scripts/environment.scm
@@ -1,6 +1,6 @@
 ;;; GNU Guix --- Functional package management for GNU
 ;;; Copyright © 2014, 2015, 2018 David Thompson <davet <at> gnu.org>
-;;; Copyright © 2015, 2016, 2017, 2018, 2019, 2020, 2021 Ludovic Courtès <ludo <at> gnu.org>
+;;; Copyright © 2015-2022 Ludovic Courtès <ludo <at> gnu.org>
 ;;; Copyright © 2018 Mike Gerwitz <mtg <at> gnu.org>
 ;;;
 ;;; This file is part of GNU Guix.
@@ -975,7 +975,10 @@ (define manifest
 
                   (mwhen (assoc-ref opts 'check?)
                     (return
-                     (validate-child-shell-environment profile manifest)))
+                     (if container?
+                         (warning (G_ "'--check' is unnecessary \
+when using '--container'; doing nothing~%"))
+                         (validate-child-shell-environment profile manifest))))
 
                   (cond
                    ((assoc-ref opts 'search-paths)

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.