GNU bug report logs - #40872
First installed package on guix system is not instantly usable

Previous Next

Package: guix;

Reported by: Stefan <stefan-guix <at> vodafonemail.de>

Date: Sun, 26 Apr 2020 16:03:01 UTC

Severity: normal

To reply to this bug, email your comments to 40872 AT debbugs.gnu.org.

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

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


Report forwarded to bug-guix <at> gnu.org:
bug#40872; Package guix. (Sun, 26 Apr 2020 16:03:01 GMT) Full text and rfc822 format available.

Acknowledgement sent to Stefan <stefan-guix <at> vodafonemail.de>:
New bug report received and forwarded. Copy sent to bug-guix <at> gnu.org. (Sun, 26 Apr 2020 16:03:01 GMT) Full text and rfc822 format available.

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

From: Stefan <stefan-guix <at> vodafonemail.de>
To: bug-guix <at> gnu.org
Subject: First installed package on guix system is not instantly usable
Date: Sun, 26 Apr 2020 14:38:53 +0200
Hi!

I have a guix system and my user account has no package installed yet. After installing the first package – git-minimal in my case – this message is printed and I get this error when trying to use the new command:

building profile with 1 package...
Hinweis: Vielleicht möchten Sie die nötigen Umgebungsvariablen festlegen, indem Sie dies ausführen:

     GUIX_PROFILE="/home/stefan/.guix-profile"
     . "$GUIX_PROFILE/etc/profile"

Sie können sie auch mit `guix package --search-paths -p "/home/stefan/.guix-profile"' nachlesen.

stefan <at> guix ~$ git show
-bash: git: Kommando nicht gefunden.


The problem is that without a single package installed there is no user profile-link present:


stefan <at> guix ~$ echo $PATH
/run/setuid-programs:/home/stefan/.config/guix/current/bin:/run/current-system/profile/bin:/run/current-system/profile/sbin


This is of course easily solved by either following the hint or a logout and login:


stefan <at> guix ~$ exit
Abgemeldet
Connection to raspberry closed.
Computer:~ stefan$ ssh stefan <at> raspberry
Last login: Sun Apr 26 13:59:31 2020 
stefan <at> guix ~$ echo $PATH
/run/setuid-programs:/home/stefan/.config/guix/current/bin:/home/stefan/.guix-profile/bin:/run/current-system/profile/bin:/run/current-system/profile/sbin


However, this gives a bad first impression to users. Moreover users may think that a logout/login cycle or manually following the hint could be necessary after each package installation. They may get annoyed by this.


Bye

Stefan








Information forwarded to bug-guix <at> gnu.org:
bug#40872; Package guix. (Tue, 28 Apr 2020 16:13:02 GMT) Full text and rfc822 format available.

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

From: Marius Bakke <mbakke <at> fastmail.com>
To: Stefan <stefan-guix <at> vodafonemail.de>, 40872 <at> debbugs.gnu.org
Subject: Re: bug#40872: First installed package on guix system is not
 instantly usable
Date: Tue, 28 Apr 2020 18:12:25 +0200
[Message part 1 (text/plain, inline)]
Stefan <stefan-guix <at> vodafonemail.de> writes:

> Hi!
>
> I have a guix system and my user account has no package installed yet. After installing the first package – git-minimal in my case – this message is printed and I get this error when trying to use the new command:
>
> building profile with 1 package...
> Hinweis: Vielleicht möchten Sie die nötigen Umgebungsvariablen festlegen, indem Sie dies ausführen:
>
>      GUIX_PROFILE="/home/stefan/.guix-profile"
>      . "$GUIX_PROFILE/etc/profile"
>
> Sie können sie auch mit `guix package --search-paths -p "/home/stefan/.guix-profile"' nachlesen.
>
> stefan <at> guix ~$ git show
> -bash: git: Kommando nicht gefunden.
>
>
> The problem is that without a single package installed there is no user profile-link present:
>
>
> stefan <at> guix ~$ echo $PATH
> /run/setuid-programs:/home/stefan/.config/guix/current/bin:/run/current-system/profile/bin:/run/current-system/profile/sbin

This is odd, as /etc/profile contains a workaround for this exact
problem (notice the else clause):

# Arrange so that ~/.config/guix/current comes first.
for profile in "$HOME/.guix-profile" "$HOME/.config/guix/current"
do
  if [ -f "$profile/etc/profile" ]
  then
    # Load the user profile's settings.
    GUIX_PROFILE="$profile" ; \
    . "$profile/etc/profile"
  else
    # At least define this one so that basic things just work
    # when the user installs their first package.
    export PATH="$profile/bin:$PATH"
  fi
done

Can you investigate why this is ineffective on your system?
[signature.asc (application/pgp-signature, inline)]

Information forwarded to bug-guix <at> gnu.org:
bug#40872; Package guix. (Tue, 28 Apr 2020 21:01:04 GMT) Full text and rfc822 format available.

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

From: Stefan <stefan-guix <at> vodafonemail.de>
To: Marius Bakke <mbakke <at> fastmail.com>
Cc: 40872 <at> debbugs.gnu.org
Subject: Re: bug#40872: First installed package on guix system is not
 instantly usable
Date: Tue, 28 Apr 2020 21:50:14 +0200
Hi Marius!

> This is odd, as /etc/profile contains a workaround for this exact
> problem (notice the else clause):
> 
> # Arrange so that ~/.config/guix/current comes first.
> for profile in "$HOME/.guix-profile" "$HOME/.config/guix/current"
> do
>  if [ -f "$profile/etc/profile" ]
>  then
>    # Load the user profile's settings.
>    GUIX_PROFILE="$profile" ; \
>    . "$profile/etc/profile"
>  else
>    # At least define this one so that basic things just work
>    # when the user installs their first package.
>    export PATH="$profile/bin:$PATH"
>  fi
> done
> 
> Can you investigate why this is ineffective on your system?

Previously I had some packages installed, but I rolled-back to generation 0. I found this in my scroll-back buffer:

stefan <at> guix ~/development/guix$ guix package --roll-back
Folgende Ableitung wird erstellt:
   /gnu/store/l0n6l104ldj7nz6kdyi7l8v5yjnc9p9g-profile.drv
building profile with 0 packages...
Von Generation „1“ zu „0“ gewechselt

By rolling back it created a new generation 0 profile which is now lying around with this kind of empty file: 

stefan <at> guix ~$ cat .guix-profile/etc/profile 
# Source this file to define all the relevant environment variables in Bash
# for this profile.  You may want to define the 'GUIX_PROFILE' environment
# variable to point to the "visible" name of the profile, like this:
#
#  GUIX_PROFILE=/path/to/profile ; \
#  source /path/to/profile/etc/profile
#
# When GUIX_PROFILE is undefined, the various environment variables refer
# to this specific profile generation.

So the test for the existence of this file does not fail, but it doesn't change PATH either. This is the profile content, it has no bin/ folder to add to PATH:

stefan <at> guix ~$ ls -lA /gnu/store/yyxqc1rhz2i062xq8lbfrhhmiyf6pzvp-profile
insgesamt 12
dr-xr-xr-x 2 root root 4096  1. Jan 1970  etc/
-r--r--r-- 4 root root   37  1. Jan 1970  manifest


Bye

Stefan



Information forwarded to bug-guix <at> gnu.org:
bug#40872; Package guix. (Sat, 02 May 2020 14:21:01 GMT) Full text and rfc822 format available.

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

From: Marius Bakke <mbakke <at> fastmail.com>
To: Stefan <stefan-guix <at> vodafonemail.de>
Cc: 40872 <at> debbugs.gnu.org
Subject: Re: bug#40872: First installed package on guix system is not
 instantly usable
Date: Sat, 02 May 2020 16:20:12 +0200
[Message part 1 (text/plain, inline)]
Stefan <stefan-guix <at> vodafonemail.de> writes:

> Hi Marius!
>
>> This is odd, as /etc/profile contains a workaround for this exact
>> problem (notice the else clause):
>> 
>> # Arrange so that ~/.config/guix/current comes first.
>> for profile in "$HOME/.guix-profile" "$HOME/.config/guix/current"
>> do
>>  if [ -f "$profile/etc/profile" ]
>>  then
>>    # Load the user profile's settings.
>>    GUIX_PROFILE="$profile" ; \
>>    . "$profile/etc/profile"
>>  else
>>    # At least define this one so that basic things just work
>>    # when the user installs their first package.
>>    export PATH="$profile/bin:$PATH"
>>  fi
>> done
>> 
>> Can you investigate why this is ineffective on your system?
>
> Previously I had some packages installed, but I rolled-back to generation 0. I found this in my scroll-back buffer:
>
> stefan <at> guix ~/development/guix$ guix package --roll-back
> Folgende Ableitung wird erstellt:
>    /gnu/store/l0n6l104ldj7nz6kdyi7l8v5yjnc9p9g-profile.drv
> building profile with 0 packages...
> Von Generation „1“ zu „0“ gewechselt
>
> By rolling back it created a new generation 0 profile which is now lying around with this kind of empty file: 
>
> stefan <at> guix ~$ cat .guix-profile/etc/profile 
> # Source this file to define all the relevant environment variables in Bash
> # for this profile.  You may want to define the 'GUIX_PROFILE' environment
> # variable to point to the "visible" name of the profile, like this:
> #
> #  GUIX_PROFILE=/path/to/profile ; \
> #  source /path/to/profile/etc/profile
> #
> # When GUIX_PROFILE is undefined, the various environment variables refer
> # to this specific profile generation.
>
> So the test for the existence of this file does not fail, but it doesn't change PATH either. This is the profile content, it has no bin/ folder to add to PATH:

I see.  We could extend the test in /etc/profile to look for a /bin
directory of the profile, but arguably rolling back to generation 0 is
not a very common case.  So I'm in favor of just keeping the status quo.

WDYT?
[signature.asc (application/pgp-signature, inline)]

Information forwarded to bug-guix <at> gnu.org:
bug#40872; Package guix. (Sat, 02 May 2020 17:00:03 GMT) Full text and rfc822 format available.

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

From: Stefan <stefan-guix <at> vodafonemail.de>
To: 40872 <at> debbugs.gnu.org
Cc: Marius Bakke <mbakke <at> fastmail.com>
Subject: Subject: [PATCH] gnu: system: Fix PATH export if the profile has no
 bin directory.
Date: Sat, 2 May 2020 18:59:40 +0200
* gnu/system.scm (operating-system-etc-service): Testing for $profile/bin.

Fixes <https://debbugs.gnu.org/40872>.
---
 gnu/system.scm | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/gnu/system.scm b/gnu/system.scm
index 540f0e4a9e..0eb5731c82 100644
--- a/gnu/system.scm
+++ b/gnu/system.scm
@@ -725,7 +725,8 @@ do
     # Load the user profile's settings.
     GUIX_PROFILE=\"$profile\" ; \\
     . \"$profile/etc/profile\"
-  else
+  fi
+  if [ ! -d \"$profile/bin\" ]
     # At least define this one so that basic things just work
     # when the user installs their first package.
     export PATH=\"$profile/bin:$PATH\"
-- 
2.26.0





Information forwarded to bug-guix <at> gnu.org:
bug#40872; Package guix. (Sun, 03 May 2020 23:33:01 GMT) Full text and rfc822 format available.

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

From: Stefan <stefan-guix <at> vodafonemail.de>
To: Marius Bakke <mbakke <at> fastmail.com>
Cc: 40872 <at> debbugs.gnu.org
Subject: Re: bug#40872: First installed package on guix system is not
 instantly usable
Date: Mon, 4 May 2020 01:32:02 +0200
Hi Marius!

> Am 02.05.2020 um 16:20 schrieb Marius Bakke <mbakke <at> fastmail.com>:
> 
> We could extend the test in /etc/profile to look for a /bin
> directory of the profile

I think this is the right solution, as that’s the actual aim of the else-part: Provide a path to a bin directory if the profile doesn’t do this by itself – there is just the implicit (but wrong) assumption that it would, if the profile is existing. I sent a patch, probably you saw it already.


Bye

Stefan



Information forwarded to bug-guix <at> gnu.org:
bug#40872; Package guix. (Sat, 09 May 2020 22:52:01 GMT) Full text and rfc822 format available.

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

From: Stefan <stefan-guix <at> vodafonemail.de>
To: 40872 <at> debbugs.gnu.org
Cc: Marius Bakke <mbakke <at> fastmail.com>
Subject: [PATCH] gnu: system: Fix PATH export if the profile has no bin
 directory.
Date: Sun, 10 May 2020 00:50:53 +0200
Hi!

> Am 02.05.2020 um 18:59 schrieb Stefan <stefan-guix <at> vodafonemail.de>:
> 
> * gnu/system.scm (operating-system-etc-service): Testing for $profile/bin.
> 
> Fixes <https://debbugs.gnu.org/40872>.
> ---
> gnu/system.scm | 3 ++-
> 1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/gnu/system.scm b/gnu/system.scm
> index 540f0e4a9e..0eb5731c82 100644
> --- a/gnu/system.scm
> +++ b/gnu/system.scm
> @@ -725,7 +725,8 @@ do
>     # Load the user profile's settings.
>     GUIX_PROFILE=\"$profile\" ; \\
>     . \"$profile/etc/profile\"
> -  else
> +  fi
> +  if [ ! -d \"$profile/bin\" ]

I just realised that I missed the necessary 

    then

between these lines. 

>     # At least define this one so that basic things just work
>     # when the user installs their first package.
>     export PATH=\"$profile/bin:$PATH\"
> -- 
> 2.26.0
> 


Bye

Stefan




This bug report was last modified 4 years and 228 days ago.

Previous Next


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