Subject: Re: bug#36076: Manual should clarify that glibc-utf8-locales is needed by default on foreign distros

From: Jack Hill <[email-masked]>
Date: Thu, 6 Jun 2019 00:32:32 -0400 (EDT)

On Wed, 5 Jun 2019, Giovanni Biscuolo wrote:

> Hello Jack,
>
> I'm also on foreign distro so maybe I could help to clarify what's
> missing here

Thanks for helping

> Did you use the last shell installer script [1] you or did it
> "manually" using the last binary tarball?
>
> [1] https://git.savannah.gnu.org/cgit/guix.git/plain/etc/guix-install.sh

I used the shell install script.

> Jack Hill <[email-masked]> writes:
>
> [...]
>
>> application setup. I installed the glibc-locales package in both my user's
>> profile and root's so that the locales would be available to
>> guix-daemon.
>
> I installed glibc-utf8-locales in the root profile:
>
> --8<---------------cut here---------------start------------->8---
> glibc-utf8-locales	2.28	out	/gnu/store/94k5w17z54w25lgp90czdqfv9m4hwzhq-glibc-utf8-locales-2.28
> --8<---------------cut here---------------end--------------->8---
>
> and both in my user profile:
>
> --8<---------------cut here---------------start------------->8---
> glibc-utf8-locales	2.28	out	/gnu/store/94k5w17z54w25lgp90czdqfv9m4hwzhq-glibc-utf8-locales-2.28
> glibc-locales	2.28	out	/gnu/store/acl2wxzzkkcjv74rlqswdf9p8pwddlmk-glibc-locales-2.28
> --8<---------------cut here---------------end--------------->8---
>
>> However, I was surprised that even though I had the full set of locales
>> available guix-daemon couldn't find the locale it was looking for.
>
> Please are you able to reproduce the error you got from guix-daemon?
> What's the error message?

I have been able to reproduce this with on a fresh CentOS 7 host with a 
freshly installed Guix from the installation script.

I see two error messages. The first occurs anytime a substitute is requested:

```
substitute: /gnu/store/q19l04vd2za80mk1845pz7r8cz29qk43-bash-minimal-4.4.23/bin/bash: warning: setlocale: LC_ALL: cannot change locale (en_US.utf8)
```

The second is in the guix-daemon logs:

```
guix-daemon[37753]: guile: warning: failed to install locale
```

I have included a full terminal session that I believe demonstrates the 
problem at the end of this message.

>> This is
>> because the default systemd unit for guix-daemon configures it to use the
>> en_US.utf8 locale which is provided by glibc-utf8-locales (en_US.UTF-8 is
>> in glibc-locales).
>
> Well, actually both en_US.utf8 and en_US.UTF-8 are both in
> glibc-utf8-locales:
>
> --8<---------------cut here---------------start------------->8---
> ~$ ls -lah /var/guix/profiles/per-user/root/guix-profile/lib/locale/2.28/ | grep en_US
> dr-xr-xr-x 3 root root 4.0K Jan  1  1970 en_US.utf8
> lrwxrwxrwx 3 root root   10 Jan  1  1970 en_US.UTF-8 -> en_US.utf8
> --8<---------------cut here---------------end--------------->8---

ah :)

> and glibc-locales
>
> --8<---------------cut here---------------start------------->8---
> $ ls -lah /var/guix/profiles/per-user/giovanni/guix-profile/lib/locale/2.28/ | grep en_US
> lrwxrwxrwx 33 root root   84 Jan  1  1970 en_US -> /gnu/store/acl2wxzzkkcjv74rlqswdf9p8pwddlmk-glibc-locales-2.28/lib/locale/2.28/en_US
> lrwxrwxrwx 33 root root   94 Jan  1  1970 en_US.utf8 -> /gnu/store/94k5w17z54w25lgp90czdqfv9m4hwzhq-glibc-utf8-locales-2.28/lib/locale/2.28/en_US.utf8
> dr-xr-xr-x  3 root root 4.0K Jan  1  1970 en_US.UTF-8
> --8<---------------cut here---------------end--------------->8---
>
> So AFAIU glibc-locales provides both en_US.UTF-8 and en_US.utf8 that is
> used by guix-daemon.

That's not how I read the above lines. It looks like en_US.utf8 is a link 
to the 94k5…glib-utf8-locales-2.28 store item.

On my system acl2wxzzkkcjv74rlqswdf9p8pwddlmk-glibc-locales-2.28 does not 
contain en_US.utf8

```
$ pwd
/gnu/store/acl2wxzzkkcjv74rlqswdf9p8pwddlmk-glibc-locales-2.28/lib/locale/2.28
$ find -iname '*en_US*'
./en_US
./en_US.UTF-8

Best,
Jack

[root@guix-jackhill-dev-01 ~]# type guix
guix is hashed (/root/.config/guix/current/bin/guix)
[root@guix-jackhill-dev-01 ~]# guix describe
Generation 2    Jun 05 2019 16:52:04    (current)
   guix c0f6eeb
     repository URL: https://git.savannah.gnu.org/git/guix.git
     branch: master
     commit: c0f6eebb6d9f6ca9b62344f32ce5f82dab601d53
[root@guix-jackhill-dev-01 ~]# guix package -l
Generation 4    Jun 05 2019 16:53:10    (current)
   hello 2.10    out     /gnu/store/md2plii4g5sk66wg9cgwc964l3xwhrm9-hello-2.10
   glibc-locales 2.28    out     /gnu/store/acl2wxzzkkcjv74rlqswdf9p8pwddlmk-glibc-locales-2.28

[root@guix-jackhill-dev-01 ~]# systemctl stop guix-daemon
[root@guix-jackhill-dev-01 ~]# systemctl start guix-daemon
[root@guix-jackhill-dev-01 ~]# systemctl status -l guix-daemon
● guix-daemon.service - Build daemon for GNU Guix
    Loaded: loaded (/etc/systemd/system/guix-daemon.service; enabled; vendor preset: disabled)
    Active: active (running) since Wed 2019-06-05 16:54:24 EDT; 4s ago
  Main PID: 37753 (guix-daemon)
     Tasks: 1 (limit: 8192)
    CGroup: /system.slice/guix-daemon.service
            └─37753 guix-daemon --build-users-group=guixbuild

Jun 05 16:54:24 guix-jackhill-dev-01.lib.duke.edu systemd[1]: Started Build daemon for GNU Guix.
Jun 05 16:54:24 guix-jackhill-dev-01.lib.duke.edu guix-daemon[37753]: guile: warning: failed to install locale
[root@guix-jackhill-dev-01 ~]# guix package -i recutils
substitute: /gnu/store/q19l04vd2za80mk1845pz7r8cz29qk43-bash-minimal-4.4.23/bin/bash: warning: setlocale: LC_ALL: cannot change locale (en_US.utf8)
substitute: guile: warning: failed to install locale
substitute: updating substitutes from 'https://ci.guix.gnu.org'... 100.0%
The following package will be installed:
    recutils     1.8     /gnu/store/163pczynvjfq4l6p7nam5sx9wbz07bgz-recutils-1.8

[unrelated lines elided]

    /gnu/store/xa0bg9kq6nn82fzssz0wjsw5gnrl8z00-ca-certificate-bundle.drv
/gnu/store/q19l04vd2za80mk1845pz7r8cz29qk43-bash-minimal-4.4.23/bin/bash: warning: setlocale: LC_ALL: cannot change locale (en_US.utf8)
guile: warning: failed to install locale
downloading from https://ci.guix.gnu.org/nar/gzip/ism9qw00d9gdhlhiankg72cik02bpnfm-module-import-compiled...
  module-import-compiled  121KiB                                                                   4.2MiB/s 00:00 [##################] 100.0%

/gnu/store/q19l04vd2za80mk1845pz7r8cz29qk43-bash-minimal-4.4.23/bin/bash: warning: setlocale: LC_ALL: cannot change locale (en_US.utf8)
guile: warning: failed to install locale
downloading from https://ci.guix.gnu.org/nar/gzip/f4kalkw0p9ifyiiwvvkd7isrxg8c1qck-attr-2.4.47...
  attr-2.4.47  92KiB                                                                               3.0MiB/s 00:00 [##################] 100.0%

[more similar lines elided]

/gnu/store/q19l04vd2za80mk1845pz7r8cz29qk43-bash-minimal-4.4.23/bin/bash: warning: setlocale: LC_ALL: cannot change locale (en_US.utf8)
guile: warning: failed to install locale
downloading from https://ci.guix.gnu.org/nar/gzip/x412nw28z7swg4zcbb29clgmqzbwp0k6-recutils-1.8...
  recutils-1.8  1.1MiB                                                                             1.9MiB/s 00:01 [##################] 100.0%

[unrelated lines elided]

building /gnu/store/63hrmvk6rp7bw0iz530ya4a02s14ld6q-profile.drv...
3 packages in profile
[root@guix-jackhill-dev-01 ~]# guix package -i glibc-utf8-locales
The following package will be installed:
    glibc-utf8-locales   2.28    /gnu/store/94k5w17z54w25lgp90czdqfv9m4hwzhq-glibc-utf8-locales-2.28

substitute: /gnu/store/q19l04vd2za80mk1845pz7r8cz29qk43-bash-minimal-4.4.23/bin/bash: warning: setlocale: LC_ALL: cannot change locale (en_US.utf8)
substitute: guile: warning: failed to install locale
substitute: updating substitutes from 'https://ci.guix.gnu.org'... 100.0%
The following derivation will be built:
    /gnu/store/xb5inry74xm915f5pbynp3i1q3qjj6h5-profile.drv
The following profile hooks will be built:
    /gnu/store/2dw212srwmqc23qgp44dvsipr9z729rq-manual-database.drv
    /gnu/store/d92npn7xlj4dkkl7mk1jirsn1bnf6rlb-ca-certificate-bundle.drv
    /gnu/store/fmcbxm998xr40hnpdzs2wizq17zhwgml-info-dir.drv
    /gnu/store/rdwrrznp57467vza8d2x079zrf4clxmk-fonts-dir.drv
building CA certificate bundle...
building fonts directory...
building directory of Info manuals...
building database for manual pages...
building /gnu/store/xb5inry74xm915f5pbynp3i1q3qjj6h5-profile.drv...
4 packages in profile
[root@guix-jackhill-dev-01 ~]# systemctl stop guix-daemon
(reverse-i-search)`sta': systemctl ^Catus -l guix-daemon
[root@guix-jackhill-dev-01 ~]# systemctl start guix-daemon
[root@guix-jackhill-dev-01 ~]# systemctl status -l guix-daemon
● guix-daemon.service - Build daemon for GNU Guix
    Loaded: loaded (/etc/systemd/system/guix-daemon.service; enabled; vendor preset: disabled)
    Active: active (running) since Wed 2019-06-05 16:56:06 EDT; 1s ago
  Main PID: 38352 (guix-daemon)
     Tasks: 1 (limit: 8192)
    CGroup: /system.slice/guix-daemon.service
            └─38352 guix-daemon --build-users-group=guixbuild

Jun 05 16:56:06 guix-jackhill-dev-01.lib.duke.edu systemd[1]: Started Build daemon for GNU Guix.
[root@guix-jackhill-dev-01 ~]# guix package -i units
[n.b. no local errors this time]
updating substitutes from 'https://ci.guix.gnu.org'... 100.0%
substitute: updating substitutes from 'https://ci.guix.gnu.org'... 100.0%
substitute: updating substitutes from 'https://ci.guix.gnu.org'... 100.0%
substitute: updating substitutes from 'https://ci.guix.gnu.org'... 100.0%
The following package will be installed:
    units        2.18    /gnu/store/iqkf11sld63f8f3rs57qlivlgisvrvjj-units-2.18

substitute: updating substitutes from 'https://ci.guix.gnu.org'... 100.0%
The following derivation will be built:
    /gnu/store/ws08mnazgqsbqs0ib2m96vvj2h7cpb2d-profile.drv
52.2 MB will be downloaded:
    /gnu/store/b7fqhszxl02g6pfm3vw6b3cjz472qrly-python-3.7.0

[unrelated lines elided]

    /gnu/store/zzhq9wv0ikfh7s01a036xivn2b0z42aa-info-dir.drv
downloading from https://ci.guix.gnu.org/nar/gzip/saxpxrr2xw6p426lbvis65bxdrxp1rb7-python-asn1crypto-0.24.0...
  python-asn1crypto-0.24.0  204KiB                                                                 3.1MiB/s 00:00 [##################] 100.0%

[more similar lines elided]

applying 1 graft for /gnu/store/vs5m35vyskvdg94xk4g42gd9jrc7hczz-python-cffi-1.11.5.drv...
downloading from https://ci.guix.gnu.org/nar/gzip/i1w25703mj54c66m422m3iqbl2bybr81-units-2.18...
  units-2.18  250KiB                                                                               740KiB/s 00:00 [##################] 100.0%

[unrelated lines elided]

building /gnu/store/ws08mnazgqsbqs0ib2m96vvj2h7cpb2d-profile.drv...
5 packages in profile