help-guix
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Package recommended environment variables


From: Tk
Subject: Re: Package recommended environment variables
Date: Thu, 16 May 2019 13:13:13 +0000

‐‐‐‐‐‐‐ Original Message ‐‐‐‐‐‐‐
On Thursday, 16 May 2019 13:21, Tobias Geerinckx-Rice <address@hidden> 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



reply via email to

[Prev in Thread] Current Thread [Next in Thread]