GNU bug report logs -
#35942
guix install: environment variable message is very confusing
Previous Next
Reported by: Robert Vollmert <rob <at> vllmrt.net>
Date: Tue, 28 May 2019 11:19:02 UTC
Severity: normal
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 35942 in the body.
You can then email your comments to 35942 AT debbugs.gnu.org in the normal way.
Toggle the display of automated, internal messages from the tracker.
Report forwarded
to
bug-guix <at> gnu.org
:
bug#35942
; Package
guix
.
(Tue, 28 May 2019 11:19:02 GMT)
Full text and
rfc822 format available.
Acknowledgement sent
to
Robert Vollmert <rob <at> vllmrt.net>
:
New bug report received and forwarded. Copy sent to
bug-guix <at> gnu.org
.
(Tue, 28 May 2019 11:19:02 GMT)
Full text and
rfc822 format available.
Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):
When installing a package that needs an environment variaible to be set for
use, `guix install` prints e.g.:
$ guix install python
...
The following environment variable definitions may be needed:
export PYTHONPATH="/home/rob/.guix-profile/lib/python3.7/site-packages${PYTHONPATH:+:}$PYTHONPATH"
I understand that the variable will be set in a new shell, but not in the current shell.
But as it stands, the message serves to confuse even users that are somewhat experienced
with unix-like systems.
Suggestion to instead print:
Set the following environment variables to use <package> right away:
export PYTHONPATH="/home/rob/.guix-profile/lib/python3.7/site-packages${PYTHONPATH:+:}$PYTHONPATH"
Information forwarded
to
bug-guix <at> gnu.org
:
bug#35942
; Package
guix
.
(Tue, 28 May 2019 12:10:02 GMT)
Full text and
rfc822 format available.
Message #8 received at 35942 <at> debbugs.gnu.org (full text, mbox):
[Message part 1 (text/plain, inline)]
Robert,
Robert Vollmert wrote:
> Suggestion to instead print:
>
> Set the following environment variables to use <package> right
> away:
Thanks for the bug report! Related (not duplicate) thread:
<https://lists.gnu.org/archive/html/guix-devel/2019-02/msg00362.html>
Kind regards,
T G-R
[signature.asc (application/pgp-signature, inline)]
Information forwarded
to
bug-guix <at> gnu.org
:
bug#35942
; Package
guix
.
(Tue, 28 May 2019 15:24:02 GMT)
Full text and
rfc822 format available.
Message #11 received at 35942 <at> debbugs.gnu.org (full text, mbox):
Hi,
Tobias Geerinckx-Rice <me <at> tobias.gr> skribis:
> Robert Vollmert wrote:
>> Suggestion to instead print:
>>
>> Set the following environment variables to use <package> right away:
>
> Thanks for the bug report! Related (not duplicate) thread:
>
> <https://lists.gnu.org/archive/html/guix-devel/2019-02/msg00362.html>
I don’t think we reached a conclusion back then. I’m fine with Robert’s
suggestion, but do people think it will really help?
Others were in favor of dropping this message altogether, which I think
wouldn’t be a good idea: how would people discover about search path
handling?
Thoughts?
Ludo’.
Information forwarded
to
bug-guix <at> gnu.org
:
bug#35942
; Package
guix
.
(Thu, 30 May 2019 07:09:01 GMT)
Full text and
rfc822 format available.
Message #14 received at 35942 <at> debbugs.gnu.org (full text, mbox):
Ludovic Courtès <ludo <at> gnu.org> writes:
> Hi,
>
> Tobias Geerinckx-Rice <me <at> tobias.gr> skribis:
>
>> Robert Vollmert wrote:
>>> Suggestion to instead print:
>>>
>>> Set the following environment variables to use <package> right away:
>>
>> Thanks for the bug report! Related (not duplicate) thread:
>>
>> <https://lists.gnu.org/archive/html/guix-devel/2019-02/msg00362.html>
>
> I don’t think we reached a conclusion back then. I’m fine with Robert’s
> suggestion, but do people think it will really help?
>
> Others were in favor of dropping this message altogether, which I think
> wouldn’t be a good idea: how would people discover about search path
> handling?
I was in favour of *replacing* the message with the suggestion to run
export GUIX_PROFILE=/this/profile
source $GUIX_PROFILE/etc/profile
because it usually does the right thing.
It looks less overwhelming than the individual list of environment
variables. I’ve seen a lot of people who added all of these variables
to their bashrc (or bash_profile if they talked to me before), which is
not what we want to encourage.
We can also hint at “guix package --search-paths” to see a full list of
environment variables for people who want to set them manually right
here and now.
--
Ricardo
Information forwarded
to
bug-guix <at> gnu.org
:
bug#35942
; Package
guix
.
(Fri, 31 May 2019 16:46:02 GMT)
Full text and
rfc822 format available.
Message #17 received at 35942 <at> debbugs.gnu.org (full text, mbox):
Hello,
On Thu, May 30, 2019 at 09:07:30AM +0200, Ricardo Wurmus wrote:
> I was in favour of *replacing* the message with the suggestion to run
> export GUIX_PROFILE=/this/profile
> source $GUIX_PROFILE/etc/profile
> because it usually does the right thing.
I think this was the conclusion reached, and am just waiting for Guix to
give me the message to update one of my bash* files :-)
Andreas
Information forwarded
to
bug-guix <at> gnu.org
:
bug#35942
; Package
guix
.
(Fri, 31 May 2019 21:21:02 GMT)
Full text and
rfc822 format available.
Message #20 received at 35942 <at> debbugs.gnu.org (full text, mbox):
[Message part 1 (text/plain, inline)]
Hi!
Ricardo Wurmus <rekado <at> elephly.net> skribis:
> Ludovic Courtès <ludo <at> gnu.org> writes:
[...]
>>> <https://lists.gnu.org/archive/html/guix-devel/2019-02/msg00362.html>
>>
>> I don’t think we reached a conclusion back then. I’m fine with Robert’s
>> suggestion, but do people think it will really help?
>>
>> Others were in favor of dropping this message altogether, which I think
>> wouldn’t be a good idea: how would people discover about search path
>> handling?
>
> I was in favour of *replacing* the message with the suggestion to run
>
> export GUIX_PROFILE=/this/profile
> source $GUIX_PROFILE/etc/profile
>
> because it usually does the right thing.
>
> It looks less overwhelming than the individual list of environment
> variables. I’ve seen a lot of people who added all of these variables
> to their bashrc (or bash_profile if they talked to me before), which is
> not what we want to encourage.
>
> We can also hint at “guix package --search-paths” to see a full list of
> environment variables for people who want to set them manually right
> here and now.
Sounds good to me.
How about the following patch?
It does produce a slightly verbose message, but I don’t think we can do
much better (we could save one line by not mentioning ‘--search-paths’.)
Thanks for getting the ball rolling. :-)
Ludo’.
[Message part 2 (text/x-patch, inline)]
diff --git a/guix/scripts/package.scm b/guix/scripts/package.scm
index 06e4cf5b9c..5751123525 100644
--- a/guix/scripts/package.scm
+++ b/guix/scripts/package.scm
@@ -57,7 +57,6 @@
#:export (build-and-use-profile
delete-generations
delete-matching-generations
- display-search-paths
guix-package
(%options . %package-options)
@@ -169,8 +168,7 @@ hooks\" run when building the profile."
"~a packages in profile~%"
count)
count)
- (display-search-paths entries (list profile)
- #:kind 'prefix)))
+ (display-search-path-hint entries profile)))
(warn-about-disk-space profile))))))
@@ -289,17 +287,23 @@ symlinks like 'canonicalize-path' would do."
file
(string-append (getcwd) "/" file)))
-(define* (display-search-paths entries profiles
- #:key (kind 'exact))
- "Display the search path environment variables that may need to be set for
-ENTRIES, a list of manifest entries, in the context of PROFILE."
- (let* ((profiles (map (compose user-friendly-profile absolutize)
- profiles))
- (settings (search-path-environment-variables entries profiles
- #:kind kind)))
+(define (display-search-path-hint entries profile)
+ "Display a hint on how to set environment variables to use ENTRIES, a list
+of manifest entries, in the context of PROFILE."
+ (let* ((profile (user-friendly-profile (absolutize profile)))
+ (settings (search-path-environment-variables entries (list profile)
+ #:kind 'prefix)))
(unless (null? settings)
- (format #t (G_ "The following environment variable definitions may be needed:~%"))
- (format #t "~{ ~a~%~}" settings))))
+ (display-hint (format #f (G_ "Consider setting the necessary environment
+variables by running:
+
+@example
+GUIX_PROFILE=\"~a\"
+. \"$GUIX_PROFILE/etc/profile\"
+@end example
+
+Alternately, see @command{guix package --search-paths -p ~s}.")
+ profile profile)))))
;;;
Reply sent
to
Ludovic Courtès <ludo <at> gnu.org>
:
You have taken responsibility.
(Thu, 06 Jun 2019 07:49:02 GMT)
Full text and
rfc822 format available.
Notification sent
to
Robert Vollmert <rob <at> vllmrt.net>
:
bug acknowledged by developer.
(Thu, 06 Jun 2019 07:49:02 GMT)
Full text and
rfc822 format available.
Message #25 received at 35942-done <at> debbugs.gnu.org (full text, mbox):
Hello,
Ludovic Courtès <ludo <at> gnu.org> skribis:
> How about the following patch?
>
> It does produce a slightly verbose message, but I don’t think we can do
> much better (we could save one line by not mentioning ‘--search-paths’.)
Pushed as bcb7c900cc9d01603fb8fa47bc52caa8e7ebd480.
Feedback welcome!
Thanks,
Ludo’.
bug archived.
Request was from
Debbugs Internal Request <help-debbugs <at> gnu.org>
to
internal_control <at> debbugs.gnu.org
.
(Thu, 04 Jul 2019 11:24:05 GMT)
Full text and
rfc822 format available.
This bug report was last modified 4 years and 291 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.