unofficial mirror of bug-guix@gnu.org 
 help / color / mirror / code / Atom feed
* bug#40872: First installed package on guix system is not instantly usable
@ 2020-04-26 12:38 Stefan
  2020-04-28 16:12 ` Marius Bakke
  0 siblings, 1 reply; 7+ messages in thread
From: Stefan @ 2020-04-26 12:38 UTC (permalink / raw)
  To: 40872

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@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@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@guix ~$ exit
Abgemeldet
Connection to raspberry closed.
Computer:~ stefan$ ssh stefan@raspberry
Last login: Sun Apr 26 13:59:31 2020 
stefan@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

^ permalink raw reply	[flat|nested] 7+ messages in thread

* bug#40872: First installed package on guix system is not instantly usable
  2020-04-26 12:38 bug#40872: First installed package on guix system is not instantly usable Stefan
@ 2020-04-28 16:12 ` Marius Bakke
  2020-04-28 19:50   ` Stefan
  0 siblings, 1 reply; 7+ messages in thread
From: Marius Bakke @ 2020-04-28 16:12 UTC (permalink / raw)
  To: Stefan, 40872

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

Stefan <stefan-guix@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@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@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?

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 487 bytes --]

^ permalink raw reply	[flat|nested] 7+ messages in thread

* bug#40872: First installed package on guix system is not instantly usable
  2020-04-28 16:12 ` Marius Bakke
@ 2020-04-28 19:50   ` Stefan
  2020-05-02 14:20     ` Marius Bakke
  0 siblings, 1 reply; 7+ messages in thread
From: Stefan @ 2020-04-28 19:50 UTC (permalink / raw)
  To: Marius Bakke; +Cc: 40872

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

^ permalink raw reply	[flat|nested] 7+ messages in thread

* bug#40872: First installed package on guix system is not instantly usable
  2020-04-28 19:50   ` Stefan
@ 2020-05-02 14:20     ` Marius Bakke
  2020-05-02 16:59       ` bug#40872: Subject: [PATCH] gnu: system: Fix PATH export if the profile has no bin directory Stefan
  2020-05-03 23:32       ` bug#40872: First installed package on guix system is not instantly usable Stefan
  0 siblings, 2 replies; 7+ messages in thread
From: Marius Bakke @ 2020-05-02 14:20 UTC (permalink / raw)
  To: Stefan; +Cc: 40872

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

Stefan <stefan-guix@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@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@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?

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 487 bytes --]

^ permalink raw reply	[flat|nested] 7+ messages in thread

* bug#40872: Subject: [PATCH] gnu: system: Fix PATH export if the profile has no bin directory.
  2020-05-02 14:20     ` Marius Bakke
@ 2020-05-02 16:59       ` Stefan
  2020-05-09 22:50         ` bug#40872: " Stefan
  2020-05-03 23:32       ` bug#40872: First installed package on guix system is not instantly usable Stefan
  1 sibling, 1 reply; 7+ messages in thread
From: Stefan @ 2020-05-02 16:59 UTC (permalink / raw)
  To: 40872

* 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





^ permalink raw reply related	[flat|nested] 7+ messages in thread

* bug#40872: First installed package on guix system is not instantly usable
  2020-05-02 14:20     ` Marius Bakke
  2020-05-02 16:59       ` bug#40872: Subject: [PATCH] gnu: system: Fix PATH export if the profile has no bin directory Stefan
@ 2020-05-03 23:32       ` Stefan
  1 sibling, 0 replies; 7+ messages in thread
From: Stefan @ 2020-05-03 23:32 UTC (permalink / raw)
  To: Marius Bakke; +Cc: 40872

Hi Marius!

> Am 02.05.2020 um 16:20 schrieb Marius Bakke <mbakke@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



^ permalink raw reply	[flat|nested] 7+ messages in thread

* bug#40872: [PATCH] gnu: system: Fix PATH export if the profile has no bin directory.
  2020-05-02 16:59       ` bug#40872: Subject: [PATCH] gnu: system: Fix PATH export if the profile has no bin directory Stefan
@ 2020-05-09 22:50         ` Stefan
  0 siblings, 0 replies; 7+ messages in thread
From: Stefan @ 2020-05-09 22:50 UTC (permalink / raw)
  To: 40872

Hi!

> Am 02.05.2020 um 18:59 schrieb Stefan <stefan-guix@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




^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2020-05-09 22:51 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-04-26 12:38 bug#40872: First installed package on guix system is not instantly usable Stefan
2020-04-28 16:12 ` Marius Bakke
2020-04-28 19:50   ` Stefan
2020-05-02 14:20     ` Marius Bakke
2020-05-02 16:59       ` bug#40872: Subject: [PATCH] gnu: system: Fix PATH export if the profile has no bin directory Stefan
2020-05-09 22:50         ` bug#40872: " Stefan
2020-05-03 23:32       ` bug#40872: First installed package on guix system is not instantly usable Stefan

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