all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* Package recommended environment variables
@ 2019-05-16  9:25 Tk
  2019-05-16 11:11 ` Amirouche
                   ` (2 more replies)
  0 siblings, 3 replies; 8+ messages in thread
From: Tk @ 2019-05-16  9:25 UTC (permalink / raw)
  To: help-guix@gnu.org

When installing packages, I often get warnings about adding variables to .profile .
These warnings, however, get easily lost when installing bunch of stuff automatically. Is there a way of extracting this info again? Should I grep through package definitions?

Tk

Sent with [ProtonMail](https://protonmail.com) Secure Email.

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

* Re: Package recommended environment variables
  2019-05-16  9:25 Package recommended environment variables Tk
@ 2019-05-16 11:11 ` Amirouche
  2019-05-18  3:41   ` Ricardo Wurmus
  2019-05-16 11:21 ` Tobias Geerinckx-Rice
  2019-05-18  0:52 ` ison
  2 siblings, 1 reply; 8+ messages in thread
From: Amirouche @ 2019-05-16 11:11 UTC (permalink / raw)
  To: Tk; +Cc: Help-Guix, help-guix

On 2019-05-16 11:25, Tk wrote:
> When installing packages, I often get warnings about adding variables
> to .profile .
> These warnings, however, get easily lost when installing bunch of
> stuff automatically. Is there a way of extracting this info again?
> Should I grep through package definitions?
> 

$ guix package --search-paths

export 
PATH="/home/amirouche/.guix-profile/bin:/home/amirouche/.guix-profile/sbin"
export 
GUILE_LOAD_PATH="/home/amirouche/.guix-profile/share/guile/site/2.2"
export 
GUILE_LOAD_COMPILED_PATH="/home/amirouche/.guix-profile/lib/guile/2.2/site-ccache"
export INFOPATH="/home/amirouche/.guix-profile/share/info"

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

* Re: Package recommended environment variables
  2019-05-16  9:25 Package recommended environment variables Tk
  2019-05-16 11:11 ` Amirouche
@ 2019-05-16 11:21 ` Tobias Geerinckx-Rice
  2019-05-16 13:13   ` Tk
  2019-05-16 13:27   ` Jeff Bauer
  2019-05-18  0:52 ` ison
  2 siblings, 2 replies; 8+ messages in thread
From: Tobias Geerinckx-Rice @ 2019-05-16 11:21 UTC (permalink / raw)
  To: Tk; +Cc: help-guix@gnu.org

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

Tk,

Tk wrote:
> When installing packages, I often get warnings about adding 
> variables to .profile .

Which warnings are these?  Are you sure that's what they mean?

Something like ‘the following variable definitions might be 
needed’ doesn't mean you should go edit your .profile, but you're 
far from the first to do so.  They are printed because guix cannot 
change the environment of the shell that invoked it, so ‘guix 
install foo; foo’ won't work if foo needs a certain environment 
variable to be set.  It will work if you open a new shell.  That's 
a Unix limitation¹.

There was some talk about rephrasing that warning, but IIRC that 
was difficult to do without making other assumptions.  I don't 
know if anything came of it.

> These warnings, however, get easily lost when installing bunch 
> of stuff automatically. Is there a way of extracting this info 
> again? Should I grep through package definitions?

Grepping won't help since these variables (‘search paths’) are 
almost always propagated from dependencies, such as glib.  Take a 
look at the ‘--search-paths’ argument to ‘guix package’.  It will 
probably do what you want.  Note that it's not limited to a single 
package.

However, why are you interested in this information?

- If it's because you're manually adding variables to .profile: 
  don't; Guix already takes care of this automatically, you should 
  simply source <guix-profile>/etc/profile if you aren't already.

- If it's because you're using an incompatible shell and are 
  maintaining your own ‘port’ of that file: you're *probably* 
  better off with a simple ‘bash -c ". guix-profile/etc/profile && 
  exec myshell"’ wrapper.

- If it's because Guix's …/etc/profile is otherwise lacking for 
  you, please let us know why.

Kind regards,

T G-R

[1]: There are horrible ways to fake this but let's not.

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

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

* Re: Package recommended environment variables
  2019-05-16 11:21 ` Tobias Geerinckx-Rice
@ 2019-05-16 13:13   ` Tk
  2019-05-18  3:40     ` Ricardo Wurmus
  2019-05-16 13:27   ` Jeff Bauer
  1 sibling, 1 reply; 8+ messages in thread
From: Tk @ 2019-05-16 13:13 UTC (permalink / raw)
  To: help-guix@gnu.org

‐‐‐‐‐‐‐ Original Message ‐‐‐‐‐‐‐
On Thursday, 16 May 2019 13:21, Tobias Geerinckx-Rice <me@tobias.gr> wrote:

> Tk,
>
> Tk wrote:
>
> > When installing packages, I often get warnings about adding > variables to .profile .
>
> Which warnings are these? Are you sure that's what they mean?
>
> Something like ‘the following variable definitions might be needed’ doesn't mean you should go edit your .profile, but you're far from the first to do so. They are printed because guix cannot change the environment of the shell that invoked it, so ‘guix install foo; foo’ won't work if foo needs a certain environment variable to be set. It will work if you open a new shell. That's a Unix limitation¹.
>
> There was some talk about rephrasing that warning, but IIRC that was difficult to do without making other assumptions. I don't know if anything came of it.
>
> > These warnings, however, get easily lost when installing bunch > of stuff automatically. Is there a way of extracting this info > again? Should I grep through package definitions?
>
> Grepping won't help since these variables (‘search paths’) are almost always propagated from dependencies, such as glib. Take a look at the ‘--search-paths’ argument to ‘guix package’. It will probably do what you want. Note that it's not limited to a single package.
>
> However, why are you interested in this information?
>
> -   If it's because you're manually adding variables to .profile: don't; Guix already takes care of this automatically, you should simply source <guix-profile>/etc/profile if you aren't already.
>
> -   If it's because you're using an incompatible shell and are maintaining your own ‘port’ of that file: you're probably better off with a simple ‘bash -c ". guix-profile/etc/profile && exec myshell"’ wrapper.
> -   If it's because Guix's …/etc/profile is otherwise lacking for you, please let us know why.
>
>     Kind regards,
>
>     T G-R
>
>     [1]: There are horrible ways to fake this but let's not.
>

Hi Tobias and others,

Thanks for the responses. First of all, I am using the Guix distro, not guix inside 3rd party GNU\Linux distribution.

At first, it looked to me like I do not need to touch anything, however there were few times when I had to export those variables manually, probably because of the Unix limitation that you  mentioned. Unfortunately I do not remember where I hit this and if I ever executed a login shell to check this.

Except PATH, there are other environment variables needed by, for example, R, or Python, or Git. These also get mentioned in the warnings. Are they also automatically set and sourced once I enter another login shell?

Cheers,

Todor

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

* Re: Package recommended environment variables
  2019-05-16 11:21 ` Tobias Geerinckx-Rice
  2019-05-16 13:13   ` Tk
@ 2019-05-16 13:27   ` Jeff Bauer
  1 sibling, 0 replies; 8+ messages in thread
From: Jeff Bauer @ 2019-05-16 13:27 UTC (permalink / raw)
  To: Tobias Geerinckx-Rice; +Cc: help-guix@gnu.org

I've put the following in my .profile:

GUIX_PROFILE="$HOME/.guix-profile"
if [ -d $GUIX_PROFILE ] || [ -h $GUIX_PROFILE ] ; then
    export GUIX_PROFILE
    export GUIX_LOCPATH=$GUIX_PROFILE/lib/locale/
    source $GUIX_PROFILE/etc/profile
fi

I have it set up this way so my .profile is portable
between guix and non-guix systems.  GUIX_LOCPATH was
added to get rid of warning messages.

Any suggestions for improvements are welcome.  Thanks.

-Jeff

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

* Re: Package recommended environment variables
  2019-05-16  9:25 Package recommended environment variables Tk
  2019-05-16 11:11 ` Amirouche
  2019-05-16 11:21 ` Tobias Geerinckx-Rice
@ 2019-05-18  0:52 ` ison
  2 siblings, 0 replies; 8+ messages in thread
From: ison @ 2019-05-18  0:52 UTC (permalink / raw)
  To: Tk; +Cc: help-guix

Somebody correct me if I'm wrong, but don't these always get placed into
~/.guix-profile/etc/profile
Right now mine seems almost identical to the output of
guix package --search-paths
with the only difference being that the values in that file are prepended to the
existing ones. Therefore all you should have to do to ensure you always have the
right vars is to just source that file.

I have this in my ~/.profile and as far as I can tell it always gives me any
vars that guix tells me to set

[[ -f /etc/profile ]] && source /etc/profile
[[ -f ${HOME}/.guix-profile/etc/profile ]] && source ${HOME}/.guix-profile/etc/profile

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

* Re: Package recommended environment variables
  2019-05-16 13:13   ` Tk
@ 2019-05-18  3:40     ` Ricardo Wurmus
  0 siblings, 0 replies; 8+ messages in thread
From: Ricardo Wurmus @ 2019-05-18  3:40 UTC (permalink / raw)
  To: Tk; +Cc: help-guix@gnu.org


Tk <tk.code@protonmail.com> writes:

> Except PATH, there are other environment variables needed by, for
> example, R, or Python, or Git. These also get mentioned in the
> warnings. Are they also automatically set and sourced once I enter
> another login shell?

Those that are mentioned by Guix: yes.

There are other variables that are mentioned in the application setup
section of the manual that may be required e.g. for SSL when using R.
Due to limitations in Guix they may not necessarily be automatically
set.

--
Ricardo

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

* Re: Package recommended environment variables
  2019-05-16 11:11 ` Amirouche
@ 2019-05-18  3:41   ` Ricardo Wurmus
  0 siblings, 0 replies; 8+ messages in thread
From: Ricardo Wurmus @ 2019-05-18  3:41 UTC (permalink / raw)
  To: Amirouche; +Cc: help-guix


Amirouche <amirouche@hyper.dev> writes:

> On 2019-05-16 11:25, Tk wrote:
>> When installing packages, I often get warnings about adding variables
>> to .profile .
>> These warnings, however, get easily lost when installing bunch of
>> stuff automatically. Is there a way of extracting this info again?
>> Should I grep through package definitions?
>>
>
> $ guix package --search-paths
>
> export
> PATH="/home/amirouche/.guix-profile/bin:/home/amirouche/.guix-profile/sbin"
> export
> GUILE_LOAD_PATH="/home/amirouche/.guix-profile/share/guile/site/2.2"
> export
> GUILE_LOAD_COMPILED_PATH="/home/amirouche/.guix-profile/lib/guile/2.2/site-ccache"
> export INFOPATH="/home/amirouche/.guix-profile/share/info"

That’s one way.  Another is to look at the Guix profile’s “etc/profile” file.

-- 
Ricardo

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

end of thread, other threads:[~2019-05-18  3:42 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-05-16  9:25 Package recommended environment variables Tk
2019-05-16 11:11 ` Amirouche
2019-05-18  3:41   ` Ricardo Wurmus
2019-05-16 11:21 ` Tobias Geerinckx-Rice
2019-05-16 13:13   ` Tk
2019-05-18  3:40     ` Ricardo Wurmus
2019-05-16 13:27   ` Jeff Bauer
2019-05-18  0:52 ` ison

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/guix.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.