unofficial mirror of help-guix@gnu.org 
 help / color / mirror / Atom feed
From: Niall Dooley <dooleyn@gmail.com>
To: myglc2 <myglc2@gmail.com>
Cc: help-guix <help-guix@gnu.org>
Subject: Re: "The following environment variable definitions may be needed"
Date: Wed, 10 May 2017 22:49:44 +0100	[thread overview]
Message-ID: <CADS3Lq6dPNqFVq1o1BFUgAFxR1FDBzvUu4HB3_4pVJ+6KH36_w@mail.gmail.com> (raw)
In-Reply-To: <86ziekygnu.fsf@gmail.com>

This too has confused me so perhaps an update of the manual is in order. Like
others I too followed the instructions in the manual
(https://www.gnu.org/software/guix/manual/guix.html#Invoking-guix-package)
and have the following
in my .bashrc (my system (a foreign distro - Trisquel 7) doesn't have a
.bash_profile but only a .profile which sources .bashrc):


GUIX_PROFILE=$HOME/.guix-profile \
source $HOME/.guix-profile/etc/profile


(Note I removed the quotes as given in the manually as I believe they are only
necessary if there is whitespace.)

The problem is this duplicates an entry in my PATH, as follows:

$HOME/.guix-profile/bin
$HOME/bin
$HOME/.guix-profile/bin
/usr/local/sbin
/usr/local/bin
/usr/sbin
/usr/bin
/sbin
/bin
/usr/games
/usr/local/games

Removing the definition of GUIX_PROFILE from my .bashrc and only keeping the
`source' line does not resolve this duplication. It merely replaces
$HOME/.guix-profile in the path with the /gnu/store pathname if that makes
sense.

Now, the contents of $HOME/.guix_profile/etc/profile is as follows:


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

export PATH="${GUIX_PROFILE:-/gnu/store/dvnb3dz37zlzm2yxivlm90kbfdzqyb25-profile}/bin${PATH:+:}$PATH"
export GIT_SSL_CAINFO="${GUIX_PROFILE:-/gnu/store/dvnb3dz37zlzm2yxivlm90kbfdzqyb25-profile}/etc/ssl/certs/ca-certificates.crt${GIT_SSL_CAINFO:+:}$GIT_SSL_CAINFO"
export INFOPATH="${GUIX_PROFILE:-/gnu/store/dvnb3dz37zlzm2yxivlm90kbfdzqyb25-profile}/share/info${INFOPATH:+:}$INFOPATH"


I suspect this duplication comes from the definition here of the PATH. Is
that correct?

To me at least the instructions in the manual and the advise from both ng0
and Ludo in this thread conflict? Or am I misunderstanding something obvious.

Thanks in advance.

On 10 May 2017 at 14:39, myglc2 <myglc2@gmail.com> wrote:
> On 05/10/2017 at 14:01 Ludovic Courtès writes:
>
>> Hi!
>>
>> Chris Marusich <cmmarusich@gmail.com> skribis:
>>
>>> This leads to my question: If I'm using GuixSD (or a foreign distro in
>>> which $GUIX_PROFILE/etc/profile is automatically sourced), do I need to
>>> add these recommended export statements to my ~/.bashrc or
>>> ~/.bash_profile?
>>
>> No.
>>
>>> My suspicion is that the answer is "no".  The next time I reboot or log
>>> out and back in, the environment variables will be set correctly even if
>>> I don't add them to my ~/.bashrc or ~/.bash_profile.  In fact, by adding
>>> them there, I would be adding redundant entries.  I am hoping that
>>> someone can confirm that my understanding is correct.
>>
>> Confirmed!
>>
>> I think the recommendations that ‘guix package’ produces are still
>> useful though, precisely because $GUIX_PROFILE/etc/profile won’t be
>> re-sourced until you log in again.
>
> These messages were a source of confusion for me.  It is really great to
> see this clarified.
>
> What if we change the message from ...
>
> The following environment variable definitions may be needed:
>    export PATH="test-profile/bin${PATH:+:}$PATH"
>
> ... to ...
>
> If you need the package before the next login, do:
>    export PATH="test-profile/bin${PATH:+:}$PATH"
>
>> Exercise for the reader: extend Bash with Guile-Bash such that the new
>> environment variable settings are automatically effected when ‘guix
>> package’ is run.  :-)
>
> This sounds cool. Could you please expand on it a bit?
>

  reply	other threads:[~2017-05-10 21:50 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-05-10  5:53 "The following environment variable definitions may be needed" Chris Marusich
2017-05-10  9:19 ` ng0
2017-05-10 12:01 ` Ludovic Courtès
2017-05-10 13:39   ` myglc2
2017-05-10 21:49     ` Niall Dooley [this message]
2017-05-11  8:55       ` Ludovic Courtès
2017-05-11 19:55         ` Niall Dooley

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://guix.gnu.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CADS3Lq6dPNqFVq1o1BFUgAFxR1FDBzvUu4HB3_4pVJ+6KH36_w@mail.gmail.com \
    --to=dooleyn@gmail.com \
    --cc=help-guix@gnu.org \
    --cc=myglc2@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).