all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* Environment variables in Guix and GuixSD
@ 2018-11-04  7:13 swedebugia
  2018-11-06 11:32 ` Ludovic Courtès
  0 siblings, 1 reply; 7+ messages in thread
From: swedebugia @ 2018-11-04  7:13 UTC (permalink / raw)
  To: guix-devel

Hi

I noticed during my years of reading this list that difficulties 
stemming from wrong environment variables or lack of knowledge of the 
importance of these is VERY common among (new) guix users.

To help everyone I wonder if it is possible for Guix to automatically 
register all these suggested changes to variables that happen after 
installing a package and check whether the user did his job of managing 
this correctly and help if not.

What do you think?

E.g.:

$ guix check

Found 10 needed environment variables in the database.

Checking current user environment...

Found 1 potential problem:

"/user/.guix-profile/bin" is missing from $PATH

This is needed to find binaries bla bla.

See how to set this variable in the manual section.

-- 
Cheers
Swedebugia

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

* Re: Environment variables in Guix and GuixSD
  2018-11-04  7:13 Environment variables in Guix and GuixSD swedebugia
@ 2018-11-06 11:32 ` Ludovic Courtès
  2018-11-06 11:38   ` Gábor Boskovits
  0 siblings, 1 reply; 7+ messages in thread
From: Ludovic Courtès @ 2018-11-06 11:32 UTC (permalink / raw)
  To: swedebugia; +Cc: guix-devel

Hello,

swedebugia <swedebugia@riseup.net> skribis:

> I noticed during my years of reading this list that difficulties
> stemming from wrong environment variables or lack of knowledge of the
> importance of these is VERY common among (new) guix users.
>
> To help everyone I wonder if it is possible for Guix to automatically
> register all these suggested changes to variables that happen after
> installing a package and check whether the user did his job of
> managing this correctly and help if not.

Upon completion, ‘guix package’ tells which additional environment
variables may need to be defined.  There’s also ‘guix package
--search-paths’ and the generated ‘etc/profile’ file.

Do you think we need something in addition to this?

I was under the impression that Guix does better than the alternatives
when it comes to environment variable settings, but of course, I’m
biased.  ;-)

Thank you,
Ludo’.

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

* Re: Environment variables in Guix and GuixSD
  2018-11-06 11:32 ` Ludovic Courtès
@ 2018-11-06 11:38   ` Gábor Boskovits
  2018-11-07 21:55     ` Ludovic Courtès
  0 siblings, 1 reply; 7+ messages in thread
From: Gábor Boskovits @ 2018-11-06 11:38 UTC (permalink / raw)
  To: Ludovic Courtès; +Cc: Guix-devel

Hello Ludo,

Ludovic Courtès <ludo@gnu.org> ezt írta (időpont: 2018. nov. 6., K, 12:32):
>
> Hello,
>
> swedebugia <swedebugia@riseup.net> skribis:
>
> > I noticed during my years of reading this list that difficulties
> > stemming from wrong environment variables or lack of knowledge of the
> > importance of these is VERY common among (new) guix users.
> >
> > To help everyone I wonder if it is possible for Guix to automatically
> > register all these suggested changes to variables that happen after
> > installing a package and check whether the user did his job of
> > managing this correctly and help if not.
>
> Upon completion, ‘guix package’ tells which additional environment
> variables may need to be defined.  There’s also ‘guix package
> --search-paths’ and the generated ‘etc/profile’ file.
>

I have seen in the /etc/profile file that it suggest you to do something like

source $GUIX_PROFILE/etc/profile.

This causes problems on systems where the startup file is executed by
a posix /bin/sh, as this is bash specific.

Any reason not to use

. $GUIX_PROFILE/etc/sh

instead in that hint?

(I noticed this on debian, .xsessionrc is using /bin/sh to interpret
this when starting up the x session, and that defaults to dash
on debian and derivatives.)

> Do you think we need something in addition to this?
>
> I was under the impression that Guix does better than the alternatives
> when it comes to environment variable settings, but of course, I’m
> biased.  ;-)
>
> Thank you,
> Ludo’.
>
Best regards,
g_bor

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

* Re: Environment variables in Guix and GuixSD
  2018-11-06 11:38   ` Gábor Boskovits
@ 2018-11-07 21:55     ` Ludovic Courtès
  2018-11-08  7:02       ` Gábor Boskovits
  0 siblings, 1 reply; 7+ messages in thread
From: Ludovic Courtès @ 2018-11-07 21:55 UTC (permalink / raw)
  To: Gábor Boskovits; +Cc: Guix-devel

Hi,

Gábor Boskovits <boskovits@gmail.com> skribis:

> I have seen in the /etc/profile file that it suggest you to do something like
>
> source $GUIX_PROFILE/etc/profile.

Right, you see this advice in $GUIX_PROFILE/etc/profile itself.

> This causes problems on systems where the startup file is executed by
> a posix /bin/sh, as this is bash specific.

$GUIX_PROFILE/etc/profile is not honored by any shell.  One has to
specifically put the ‘source’ line above in whichever file is
appropriate (~/.bash_profile, ~/.profile, /etc/profile, etc.)

On GuixSD this happens automatically but on a foreign distro users have
to add the ‘source’ line somewhere.

Does that make sense?

Thanks,
Ludo’.

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

* Re: Environment variables in Guix and GuixSD
  2018-11-07 21:55     ` Ludovic Courtès
@ 2018-11-08  7:02       ` Gábor Boskovits
  2018-11-09 13:49         ` Nils Gillmann
  2018-11-11 13:26         ` Ludovic Courtès
  0 siblings, 2 replies; 7+ messages in thread
From: Gábor Boskovits @ 2018-11-08  7:02 UTC (permalink / raw)
  To: Ludovic Courtès; +Cc: Guix-devel

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

Hello Ludo,

2018. nov. 7., Sze 22:55 dátummal Ludovic Courtès <ludo@gnu.org> ezt írta:

> Hi,
>
> Gábor Boskovits <boskovits@gmail.com> skribis:
>
> > I have seen in the /etc/profile file that it suggest you to do something
> like
> >
> > source $GUIX_PROFILE/etc/profile.
>
> Right, you see this advice in $GUIX_PROFILE/etc/profile itself.
>
> > This causes problems on systems where the startup file is executed by
> > a posix /bin/sh, as this is bash specific.
>
> $GUIX_PROFILE/etc/profile is not honored by any shell.  One has to
> specifically put the ‘source’ line above in whichever file is
> appropriate (~/.bash_profile, ~/.profile, /etc/profile, etc.)
>

I did not express myself cleanly. What my problem was that 'source' is bash
specific, while we can use '.' in posix shells.


> On GuixSD this happens automatically but on a foreign distro users have
> to add the ‘source’ line somewhere.
>
> Does that make sense?
>
> Thanks,
> Ludo’.
>
g_bor

>

[-- Attachment #2: Type: text/html, Size: 1839 bytes --]

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

* Re: Environment variables in Guix and GuixSD
  2018-11-08  7:02       ` Gábor Boskovits
@ 2018-11-09 13:49         ` Nils Gillmann
  2018-11-11 13:26         ` Ludovic Courtès
  1 sibling, 0 replies; 7+ messages in thread
From: Nils Gillmann @ 2018-11-09 13:49 UTC (permalink / raw)
  To: Gábor Boskovits; +Cc: Guix-devel

Gábor Boskovits transcribed 3.2K bytes:
> Hello Ludo,
> 
> 2018. nov. 7., Sze 22:55 dátummal Ludovic Courtès <ludo@gnu.org> ezt írta:
> 
> > Hi,
> >
> > Gábor Boskovits <boskovits@gmail.com> skribis:
> >
> > > I have seen in the /etc/profile file that it suggest you to do something
> > like
> > >
> > > source $GUIX_PROFILE/etc/profile.
> >
> > Right, you see this advice in $GUIX_PROFILE/etc/profile itself.
> >
> > > This causes problems on systems where the startup file is executed by
> > > a posix /bin/sh, as this is bash specific.
> >
> > $GUIX_PROFILE/etc/profile is not honored by any shell.  One has to
> > specifically put the ‘source’ line above in whichever file is
> > appropriate (~/.bash_profile, ~/.profile, /etc/profile, etc.)
> >
> 
> I did not express myself cleanly. What my problem was that 'source' is bash
> specific, while we can use '.' in posix shells.

But you are just scratching on the surface. As I noted long time ago,
the file itself is bash specific. To have bash in there makes sense as
the project was and is Bash focused. For other shells you end up
either maintaining your own codebase or constructing bash->YOUR_SHELL
translators.

If anything it makes sense to throw (part of) this into /etc/bash/,
which at least on Gentoo is the way to define systemwide data for
Bash.

> 
> > On GuixSD this happens automatically but on a foreign distro users have
> > to add the ‘source’ line somewhere.
> >
> > Does that make sense?
> >
> > Thanks,
> > Ludo’.
> >
> g_bor
> 
> >

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

* Re: Environment variables in Guix and GuixSD
  2018-11-08  7:02       ` Gábor Boskovits
  2018-11-09 13:49         ` Nils Gillmann
@ 2018-11-11 13:26         ` Ludovic Courtès
  1 sibling, 0 replies; 7+ messages in thread
From: Ludovic Courtès @ 2018-11-11 13:26 UTC (permalink / raw)
  To: Gábor Boskovits; +Cc: Guix-devel

Hello,

Gábor Boskovits <boskovits@gmail.com> skribis:

> 2018. nov. 7., Sze 22:55 dátummal Ludovic Courtès <ludo@gnu.org> ezt írta:
>
>> Hi,
>>
>> Gábor Boskovits <boskovits@gmail.com> skribis:
>>
>> > I have seen in the /etc/profile file that it suggest you to do something
>> like
>> >
>> > source $GUIX_PROFILE/etc/profile.
>>
>> Right, you see this advice in $GUIX_PROFILE/etc/profile itself.
>>
>> > This causes problems on systems where the startup file is executed by
>> > a posix /bin/sh, as this is bash specific.
>>
>> $GUIX_PROFILE/etc/profile is not honored by any shell.  One has to
>> specifically put the ‘source’ line above in whichever file is
>> appropriate (~/.bash_profile, ~/.profile, /etc/profile, etc.)
>>
>
> I did not express myself cleanly. What my problem was that 'source' is bash
> specific, while we can use '.' in posix shells.

Ah yes of course.  If there are places in the doc where we use ‘source’
instead of ‘.’, feel free to change them.

Ludo’.

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

end of thread, other threads:[~2018-11-11 13:26 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-11-04  7:13 Environment variables in Guix and GuixSD swedebugia
2018-11-06 11:32 ` Ludovic Courtès
2018-11-06 11:38   ` Gábor Boskovits
2018-11-07 21:55     ` Ludovic Courtès
2018-11-08  7:02       ` Gábor Boskovits
2018-11-09 13:49         ` Nils Gillmann
2018-11-11 13:26         ` Ludovic Courtès

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.