unofficial mirror of guix-devel@gnu.org 
 help / color / mirror / code / Atom feed
* Foreign distro GUIX_LOCPATH errors when installing from manual
@ 2016-07-05 17:07 sbaugh
  2016-07-11 10:07 ` Ludovic Courtès
  0 siblings, 1 reply; 4+ messages in thread
From: sbaugh @ 2016-07-05 17:07 UTC (permalink / raw)
  To: guix-devel


Hi,

I was just getting started with Guix by installing it on my regular
distro, Debian Jessie, by following the manual (which is really great -
I tried installing Nix first but couldn't get it to work, the Guix
manual is much better).

The install was successful but I noticed two errors related to
GUIX_LOCPATH which I had to fix by asking others for advice. Both happen
when running guix package commands as a regular user, by running
/usr/local/bin/guix.

- substitute: warning: failed to install locale: Invalid argument

This was a result of the daemon, running as root, not having
GUIX_LOCPATH set in its environment.

My solution was installing glibc-locale in root's profile, and adding:

    Environment=GUIX_LOCPATH=/root/.guix_profile/lib/locale

to the [Service] section of the systemd unit file used to start the
daemon. I suggest that this line should be added to the unit file
shipped with guix, and that the installation instructions say to install
glibc-locale (or some other locale package) in root's profile.

- warning: failed to install locale: Invalid argument

This was a result of the user running guix not having GUIX_LOCPATH set
in their current environment. But, keep in mind, the user is running
guix through /usr/local/bin/guix, which is in fact a symlink to root's
guix.

I suggest that the appropriate solution is to instead of symlinking
/usr/local/bin/guix to
/var/guix/profiles/per-user/root/guix-profile/bin/guix, we should
replace /usr/local/bin/guix with the following shell script:

    #!/bin/sh
    export GUIX_LOCPATH=/var/guix/profiles/per-user/root/guix-profile/lib/locale
    /var/guix/profiles/per-user/root/guix-profile/bin/guix $*

That is, root's guix should be run with root's locales.


Hopefully these can be fixed!

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

* Re: Foreign distro GUIX_LOCPATH errors when installing from manual
  2016-07-05 17:07 Foreign distro GUIX_LOCPATH errors when installing from manual sbaugh
@ 2016-07-11 10:07 ` Ludovic Courtès
  2016-07-11 10:48   ` Thomas Danckaert
  2016-07-11 18:26   ` Spencer Baugh
  0 siblings, 2 replies; 4+ messages in thread
From: Ludovic Courtès @ 2016-07-11 10:07 UTC (permalink / raw)
  To: sbaugh; +Cc: guix-devel

Hello!

sbaugh@catern.com skribis:

> I was just getting started with Guix by installing it on my regular
> distro, Debian Jessie, by following the manual (which is really great -
> I tried installing Nix first but couldn't get it to work, the Guix
> manual is much better).
>
> The install was successful but I noticed two errors related to
> GUIX_LOCPATH which I had to fix by asking others for advice. Both happen
> when running guix package commands as a regular user, by running
> /usr/local/bin/guix.
>
> - substitute: warning: failed to install locale: Invalid argument
>
> This was a result of the daemon, running as root, not having
> GUIX_LOCPATH set in its environment.
>
> My solution was installing glibc-locale in root's profile, and adding:
>
>     Environment=GUIX_LOCPATH=/root/.guix_profile/lib/locale
>
> to the [Service] section of the systemd unit file used to start the
> daemon. I suggest that this line should be added to the unit file
> shipped with guix,

Agreed.  Someone else made a similar suggestion and the patch is being
committed:

  https://lists.gnu.org/archive/html/guix-devel/2016-07/msg00223.html

> and that the installation instructions say to install glibc-locale (or
> some other locale package) in root's profile.

They already say so under “Application Setup”, but maybe that should be
made more prominent?

  https://www.gnu.org/software/guix/manual/html_node/Application-Setup.html#Locales

> - warning: failed to install locale: Invalid argument
>
> This was a result of the user running guix not having GUIX_LOCPATH set
> in their current environment. But, keep in mind, the user is running
> guix through /usr/local/bin/guix, which is in fact a symlink to root's
> guix.
>
> I suggest that the appropriate solution is to instead of symlinking
> /usr/local/bin/guix to
> /var/guix/profiles/per-user/root/guix-profile/bin/guix, we should
> replace /usr/local/bin/guix with the following shell script:
>
>     #!/bin/sh
>     export GUIX_LOCPATH=/var/guix/profiles/per-user/root/guix-profile/lib/locale
>     /var/guix/profiles/per-user/root/guix-profile/bin/guix $*
>
> That is, root's guix should be run with root's locales.

I think we should do that only when GUIX_LOCPATH is unset, but yes, this
is a good idea.

I’m not sure how to implement it exactly; it seems cumbersome to ask
users to write such a script.  Thoughts?

Maybe the binary tarball should provide a short, readable ‘install.sh’
script that would do everything the “Binary Installation” section
describes, including this extra step?

Thanks,
Ludo’.

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

* Re: Foreign distro GUIX_LOCPATH errors when installing from manual
  2016-07-11 10:07 ` Ludovic Courtès
@ 2016-07-11 10:48   ` Thomas Danckaert
  2016-07-11 18:26   ` Spencer Baugh
  1 sibling, 0 replies; 4+ messages in thread
From: Thomas Danckaert @ 2016-07-11 10:48 UTC (permalink / raw)
  To: ludo; +Cc: guix-devel, sbaugh

From: ludo@gnu.org (Ludovic Courtès)
Subject: Re: Foreign distro GUIX_LOCPATH errors when installing from 
manual
Date: Mon, 11 Jul 2016 12:07:56 +0200

>> and that the installation instructions say to install glibc-locale 
>> (or
>> some other locale package) in root's profile.
>
> They already say so under “Application Setup”, but maybe that 
> should be
> made more prominent?

The section does not explicitly tell to install these locales also 
for root.

Perhaps the daemon systemd configuration could be expanded to set a 
specific locale for the Guix build-daemon (currently it uses the host 
systems default locale settings), and a package for only that 
specific locale could be included in the binary tarball, installed in 
root's profile?  I'm not really familiar with the build daemon or 
locales, but I think that it doesn't matter so much which locale is 
set for the build daemon, as long as it is properly configured? (This 
is also related to your question about including glibc-utf8-locales 
in the binary tarball in the parallel thread)

Thomas

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

* Re: Foreign distro GUIX_LOCPATH errors when installing from manual
  2016-07-11 10:07 ` Ludovic Courtès
  2016-07-11 10:48   ` Thomas Danckaert
@ 2016-07-11 18:26   ` Spencer Baugh
  1 sibling, 0 replies; 4+ messages in thread
From: Spencer Baugh @ 2016-07-11 18:26 UTC (permalink / raw)
  To: Ludovic Courtès; +Cc: guix-devel

Ludovic Courtès <ludo@gnu.org> writes:
> I think we should do that only when GUIX_LOCPATH is unset, but yes, this
> is a good idea.
>
> I’m not sure how to implement it exactly; it seems cumbersome to ask
> users to write such a script.  Thoughts?

I think such a script should come with the tarball, and the manual
should direct users to copy it into place instead of making a symlink.

> Maybe the binary tarball should provide a short, readable ‘install.sh’
> script that would do everything the “Binary Installation” section
> describes, including this extra step?

This would be nice. But I would caution against a script eventually
becoming the primary means of installation of Guix on foreign
distros. If that happens, eventually I think the documentation will
become out of date and manual installation will become much harder.

Maybe that section of the documentation could be written in a literate
programming style which can be used to generate the install.sh? That
would be a nice way to keep both the documentation and the install.sh in
sync and up to date with changes.

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

end of thread, other threads:[~2016-07-11 18:27 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-07-05 17:07 Foreign distro GUIX_LOCPATH errors when installing from manual sbaugh
2016-07-11 10:07 ` Ludovic Courtès
2016-07-11 10:48   ` Thomas Danckaert
2016-07-11 18:26   ` Spencer Baugh

Code repositories for project(s) associated with this public inbox

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

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