* I don't understand profiles and directories
@ 2019-01-19 16:13 HiPhish
2019-01-19 16:27 ` Ricardo Wurmus
0 siblings, 1 reply; 9+ messages in thread
From: HiPhish @ 2019-01-19 16:13 UTC (permalink / raw)
To: help-guix
Hello everyone,
I am running Kubuntu 18.04 with Guix as my other package manager. I originally
installed it when Guix was still in version 0.15 and I ran in a bunch of
trouble when I tried updating to 0.16. I am still not sure I updated properly.
From what I understand, Guix works as follows: packages are "installed" in the
store, which is a directory that has separate directories for each package.
This allows users to have different versions of the same package installed at
the same time, no two packages will interfere with each other, since each one
has its own subdirectory in the store.
This however does not make packages available to the user, so this is where
profiles come in. A profile is a directory which contains symlinks to the actual
store items. So if I want to run "foo-bin" it first has to be built and placed
in the store, and then Guix will symlink everything into my profile. I also
need to set some environment variables so that my system will know where to
search. If foo-bin depends on libbar, then libbar will be installed into the
store as well, but it will not be symlinked into the profile because I did not
request it explicitly. Everything correct so far?
Here is my first question: where is this profile and which environment variables
do I need to set? There is the directory `~/.guix-profile`, so I assume that's
my "default profile". When I ran `guix pull` it did not update my Guix binary,
As per the Guix Pull manual, I first had to add
export PATH="$HOME/.config/guix/current/bin:$PATH"
export INFOPATH="$HOME/.config/guix/current/share/info:$INFOPATH"
to my `~/.profile` file. Is `$HOME/.config/guix/current` another profile? Is this
the actual profile I should be using? Other parts of the manual instructed me
to add
source "$HOME/.guix-profile/etc/profile"
export GUIX_LOCPATH="$HOME/.guix-profile/lib/locale"
export XDG_DATA_DIRS="$HOME/.guix-profile/share:${XDG_DATA_DIRS}"
as well. Is this the correct setup, or am I missing something? Because when I
install a package (e.g. glibc-locales) I get the message
The following environment variable definitions may be needed:
export PATH="/home/username/.guix-profile/bin${PATH:+:}$PATH"
export GUILE_LOAD_PATH="/home/username/.guix-profile/share/guile/site/
2.2${GUILE_LOAD_PATH:+:}$GUILE_LOAD_PATH"
export GUILE_LOAD_COMPILED_PATH="/home/username/.guix-profile/lib/guile/
2.2/site-ccache:/home/username/.guix-profile/share/guile/site/2.2$
{GUILE_LOAD_COMPILED_PATH:+:}$GUILE_LOAD_COMPILED_PATH"
and running `guix --version` shows me 0.15 again. So something seems to be
amiss here.
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: I don't understand profiles and directories
2019-01-19 16:13 I don't understand profiles and directories HiPhish
@ 2019-01-19 16:27 ` Ricardo Wurmus
2019-01-19 16:54 ` HiPhish
0 siblings, 1 reply; 9+ messages in thread
From: Ricardo Wurmus @ 2019-01-19 16:27 UTC (permalink / raw)
To: HiPhish; +Cc: help-guix
HiPhish <hiphish@posteo.de> writes:
> Is `$HOME/.config/guix/current` another profile?
Yes. It is the profile that “guix pull” uses to install Guix and
nothing more than that.
> source "$HOME/.guix-profile/etc/profile"
This sets all environment variables that Guix suggests to set when you
install packages.
> export GUIX_LOCPATH="$HOME/.guix-profile/lib/locale"
On a foreign distro you need this, yes.
> export XDG_DATA_DIRS="$HOME/.guix-profile/share:${XDG_DATA_DIRS}"
You don’t need this as it will be set by sourcing etc/profile if
necessary. (Guix would have added it to etc/profile if it was required.)
> The following environment variable definitions may be needed:
> export PATH="/home/username/.guix-profile/bin${PATH:+:}$PATH"
> export GUILE_LOAD_PATH="/home/username/.guix-profile/share/guile/site/
> 2.2${GUILE_LOAD_PATH:+:}$GUILE_LOAD_PATH"
> export GUILE_LOAD_COMPILED_PATH="/home/username/.guix-profile/lib/guile/
> 2.2/site-ccache:/home/username/.guix-profile/share/guile/site/2.2$
> {GUILE_LOAD_COMPILED_PATH:+:}$GUILE_LOAD_COMPILED_PATH"
You can ignore this when you’re using Bash and you’re source’ing
$GUIX_PROFILE/etc/profile, because that file will contain all of these
recommendations.
> and running `guix --version` shows me 0.15 again.
What “guix” are you using? What does “which guix” tell you?
--
Ricardo
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: I don't understand profiles and directories
2019-01-19 16:27 ` Ricardo Wurmus
@ 2019-01-19 16:54 ` HiPhish
2019-01-19 17:05 ` Ricardo Wurmus
0 siblings, 1 reply; 9+ messages in thread
From: HiPhish @ 2019-01-19 16:54 UTC (permalink / raw)
To: help-guix
Hello Ricardo,
I have logged out and back in just to be sure everything is reset.
> What “guix” are you using? What does “which guix” tell you?
When I run `guix --version` I get "guix (GNU Guix) 0.15.0-5.1d0be47" (and the
usual copyright boilerplate of course). `which guix` prints "guix (GNU Guix)
0.15.0-5.1d0be47". Should I change my `.profile` file to be like this instead?
source "$HOME/.guix-profile/etc/profile"
export GUIX_LOCPATH="$HOME/.guix-profile/lib/locale"
export PATH="$HOME/.config/guix/current/bin:$PATH"
export INFOPATH="$HOME/.config/guix/current/share/info:$INFOPATH"
I.e. first source the Guix profile, which will add itself to the `$PATH`, and
then add the path to the other profile.
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: I don't understand profiles and directories
2019-01-19 16:54 ` HiPhish
@ 2019-01-19 17:05 ` Ricardo Wurmus
2019-01-19 17:55 ` HiPhish
0 siblings, 1 reply; 9+ messages in thread
From: Ricardo Wurmus @ 2019-01-19 17:05 UTC (permalink / raw)
To: HiPhish; +Cc: help-guix
HiPhish <hiphish@posteo.de> writes:
> `which guix` prints "guix (GNU Guix) 0.15.0-5.1d0be47".
I don’t think so. It should print a file name.
> Should I change my `.profile` file to be like this instead?
>
> source "$HOME/.guix-profile/etc/profile"
> export GUIX_LOCPATH="$HOME/.guix-profile/lib/locale"
> export PATH="$HOME/.config/guix/current/bin:$PATH"
> export INFOPATH="$HOME/.config/guix/current/share/info:$INFOPATH"
>
> I.e. first source the Guix profile, which will add itself to the `$PATH`, and
> then add the path to the other profile.
Yes.
--
Ricardo
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: I don't understand profiles and directories
2019-01-19 17:05 ` Ricardo Wurmus
@ 2019-01-19 17:55 ` HiPhish
2019-01-19 21:00 ` Ricardo Wurmus
0 siblings, 1 reply; 9+ messages in thread
From: HiPhish @ 2019-01-19 17:55 UTC (permalink / raw)
To: help-guix
On Saturday, 19 January 2019 18:05:03 CET you wrote:
> I don’t think so. It should print a file name.
The message must have cut off, there was a full file path into `/gnu/
store/...`.
> > Should I change my `.profile` file to be like this instead?
> >
> > source "$HOME/.guix-profile/etc/profile"
> > export GUIX_LOCPATH="$HOME/.guix-profile/lib/locale"
> > export PATH="$HOME/.config/guix/current/bin:$PATH"
> > export INFOPATH="$HOME/.config/guix/current/share/info:$INFOPATH"
> >
> > I.e. first source the Guix profile, which will add itself to the `$PATH`,
> > and then add the path to the other profile.
>
> Yes.
OK, now it seems to work. Just to re-iterate, the Guix binary I'm going to
invoke from the command line (`guix`) comes from this profile `~/.config/guix/
current/`, while all my packages are in the `~/.guix-profile` profile, correct?
This means that the Guix binary from `~/.config/guix/current/` shadows the one
from `~/.guix-profile`.
My complete `~/.profile` file now contains
source "$HOME/.guix-profile/etc/profile"
export GUIX_LOCPATH="$HOME/.guix-profile/lib/locale"
export PATH="$HOME/.config/guix/current/bin:$PATH"
export INFOPATH="$HOME/.config/guix/current/share/info:$INFOPATH"
# SSL certificates (after installing 'nss-certs')
export SSL_CERT_DIR="$HOME/.guix-profile/etc/ssl/certs"
export SSL_CERT_FILE="$HOME/.guix-profile/etc/ssl/certs/ca-certificates.crt"
export GIT_SSL_CAINFO="$SSL_CERT_FILE"
and `which guix` prints
/home/username/.config/guix/current/bin/guix
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: I don't understand profiles and directories
2019-01-19 17:55 ` HiPhish
@ 2019-01-19 21:00 ` Ricardo Wurmus
2019-01-19 23:20 ` HiPhish
0 siblings, 1 reply; 9+ messages in thread
From: Ricardo Wurmus @ 2019-01-19 21:00 UTC (permalink / raw)
To: HiPhish; +Cc: help-guix
HiPhish <hiphish@posteo.de> writes:
> On Saturday, 19 January 2019 18:05:03 CET you wrote:
>> I don’t think so. It should print a file name.
> The message must have cut off, there was a full file path into `/gnu/
> store/...`.
That’s not correct. This indicates that the GUIX_PROFILE variable is
not exported.
> Just to re-iterate, the Guix binary I'm going to
> invoke from the command line (`guix`) comes from this profile `~/.config/guix/
> current/`, while all my packages are in the `~/.guix-profile` profile,
> correct?
Yes.
> This means that the Guix binary from `~/.config/guix/current/` shadows the one
> from `~/.guix-profile`.
There shouldn’t be any “guix” package in ~/.guix-profile.
>
> My complete `~/.profile` file now contains
>
> source "$HOME/.guix-profile/etc/profile"
I’d replace this with:
export GUIX_PROFILE=$HOME/.guix-profile
source $GUIX_PROFILE/etc/profile
This ensures that the variables won’t point to specific store items but
rather to the *current* generation (even when you upgrade).
> and `which guix` prints
>
> /home/username/.config/guix/current/bin/guix
Good!
--
Ricardo
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: I don't understand profiles and directories
2019-01-19 21:00 ` Ricardo Wurmus
@ 2019-01-19 23:20 ` HiPhish
2019-01-19 23:31 ` Ricardo Wurmus
0 siblings, 1 reply; 9+ messages in thread
From: HiPhish @ 2019-01-19 23:20 UTC (permalink / raw)
To: help-guix
On Saturday, 19 January 2019 22:00:20 CET you wrote:
> > This means that the Guix binary from `~/.config/guix/current/` shadows the
> > one from `~/.guix-profile`.
>
> There shouldn’t be any “guix” package in ~/.guix-profile.
Here is what I have:
$ cd ~/.guix-profile/bin
$ ls | grep guix
guix
guix-daemon
$ file guix guix-daemon
guix: symbolic link to /gnu/store/vv1kkj9aqpv1akk7l7vp2kkd695wgxcr
guix-0.16.0-8.7ba2b27/bin/guix
guix-daemon: symbolic link to /gnu/store/vv1kkj9aqpv1akk7l7vp2kkd695wgxcr-
guix-0.16.0-8.7ba2b27/bin/guix-daemon
$ ./guix --version
guix (GNU Guix) 0.16.0-8.7ba2b27
$ guix --version
guix (GNU Guix) 8d09e97b8cdde9dcceb2353112613a3fee63426d
So both are symlinks to items in the store, and they are distinct from the
Guix that's in my $PATH.
> > My complete `~/.profile` file now contains
> >
> > source "$HOME/.guix-profile/etc/profile"
>
> I’d replace this with:
>
> export GUIX_PROFILE=$HOME/.guix-profile
> source $GUIX_PROFILE/etc/profile
>
> This ensures that the variables won’t point to specific store items but
> rather to the *current* generation (even when you upgrade).
OK, got it.
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: I don't understand profiles and directories
2019-01-19 23:20 ` HiPhish
@ 2019-01-19 23:31 ` Ricardo Wurmus
2019-01-19 23:34 ` HiPhish
0 siblings, 1 reply; 9+ messages in thread
From: Ricardo Wurmus @ 2019-01-19 23:31 UTC (permalink / raw)
To: HiPhish; +Cc: help-guix
HiPhish <hiphish@posteo.de> writes:
> On Saturday, 19 January 2019 22:00:20 CET you wrote:
>> > This means that the Guix binary from `~/.config/guix/current/` shadows the
>> > one from `~/.guix-profile`.
>>
>> There shouldn’t be any “guix” package in ~/.guix-profile.
> Here is what I have: […]
What I meant is: you shouldn’t install “guix” with Guix because you will
necessarily end up with an older version of Guix (namely the previous
version that is available though the current version).
Use “guix pull” only to avoid these problems.
--
Ricardo
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: I don't understand profiles and directories
2019-01-19 23:31 ` Ricardo Wurmus
@ 2019-01-19 23:34 ` HiPhish
0 siblings, 0 replies; 9+ messages in thread
From: HiPhish @ 2019-01-19 23:34 UTC (permalink / raw)
To: help-guix
On Sunday, 20 January 2019 00:31:33 CET you wrote:
> What I meant is: you shouldn’t install “guix” with Guix because you will
> necessarily end up with an older version of Guix (namely the previous
> version that is available though the current version).
>
> Use “guix pull” only to avoid these problems.
>
> --
> Ricardo
OK, got it. Should I run `guix package --remove=guix` to get rid of that Guix
in `~/.guix-profile/bin` or is it normal to have that one in there?
^ permalink raw reply [flat|nested] 9+ messages in thread
end of thread, other threads:[~2019-01-20 12:47 UTC | newest]
Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-01-19 16:13 I don't understand profiles and directories HiPhish
2019-01-19 16:27 ` Ricardo Wurmus
2019-01-19 16:54 ` HiPhish
2019-01-19 17:05 ` Ricardo Wurmus
2019-01-19 17:55 ` HiPhish
2019-01-19 21:00 ` Ricardo Wurmus
2019-01-19 23:20 ` HiPhish
2019-01-19 23:31 ` Ricardo Wurmus
2019-01-19 23:34 ` HiPhish
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).