Patchwork locales gone

login
register
mail settings
Submitter Ludovic Courtès
Date Oct. 17, 2016, 9 a.m.
Message ID <87r37fe4eu.fsf@gnu.org>
Download mbox | patch
Permalink /patch/16571/
State New
Headers show

Comments

Ludovic Courtès - Oct. 17, 2016, 9 a.m.
Danny Milosavljevic <dannym@scratchpost.org> skribis:

> And if I strace postgres service I get
>
> [pid  6184] open("/gnu/store/m9vxvhdj691bq1f85lpflvnhcvrdilih-glibc-2.23/lib/locale/locale-archive", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
> [pid  6184] open("/gnu/store/m9vxvhdj691bq1f85lpflvnhcvrdilih-glibc-2.23/share/locale/locale.alias", O_RDONLY|O_CLOEXEC) = 3
> [pid  6184] fstat(3, {st_mode=S_IFREG|0444, st_size=2997, ...}) = 0
> [pid  6184] read(3, "# Locale name alias data base.\n#"..., 4096) = 2997
> [pid  6184] read(3, "", 4096)           = 0
> [pid  6184] close(3)                    = 0
> [pid  6184] open("/gnu/store/m9vxvhdj691bq1f85lpflvnhcvrdilih-glibc-2.23/lib/locale/en_US.UTF-8/LC_COLLATE", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
> [pid  6184] open("/gnu/store/m9vxvhdj691bq1f85lpflvnhcvrdilih-glibc-2.23/lib/locale/en_US.utf8/LC_COLLATE", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
> [pid  6184] open("/gnu/store/m9vxvhdj691bq1f85lpflvnhcvrdilih-glibc-2.23/lib/locale/en_US/LC_COLLATE", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
> [pid  6184] open("/gnu/store/m9vxvhdj691bq1f85lpflvnhcvrdilih-glibc-2.23/lib/locale/en.UTF-8/LC_COLLATE", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
> [pid  6184] open("/gnu/store/m9vxvhdj691bq1f85lpflvnhcvrdilih-glibc-2.23/lib/locale/en.utf8/LC_COLLATE", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
> [pid  6184] open("/gnu/store/m9vxvhdj691bq1f85lpflvnhcvrdilih-glibc-2.23/lib/locale/en/LC_COLLATE", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
>
> And indeed those don't exist.

Ooh, I see.  To work around an issue in our glibc 2.23 package (that I
forgot to fix in 2.24), whereby glibc does not look for locale data in
/run/current-system/locale, commit
ab3a64507a792e4da0527b423fbc28f8768e736a sets GUIX_LOCPATH in
/etc/environment.

However, that doesn’t help with daemons, because those do not honor that
file.

I suppose the untested patch below would work around it.  Could you try
and report back?  (Will require a reboot or testing with ‘guix system
vm’.)

Thanks,
Ludo’.
Leo Famulari - Oct. 17, 2016, 7:24 p.m.
On Mon, Oct 17, 2016 at 11:00:25AM +0200, Ludovic Courtès wrote:
> Danny Milosavljevic <dannym@scratchpost.org> skribis:
> 
> > And if I strace postgres service I get
> >
> > [pid  6184] open("/gnu/store/m9vxvhdj691bq1f85lpflvnhcvrdilih-glibc-2.23/lib/locale/locale-archive", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
> > [pid  6184] open("/gnu/store/m9vxvhdj691bq1f85lpflvnhcvrdilih-glibc-2.23/share/locale/locale.alias", O_RDONLY|O_CLOEXEC) = 3
> > [pid  6184] fstat(3, {st_mode=S_IFREG|0444, st_size=2997, ...}) = 0
> > [pid  6184] read(3, "# Locale name alias data base.\n#"..., 4096) = 2997
> > [pid  6184] read(3, "", 4096)           = 0
> > [pid  6184] close(3)                    = 0
> > [pid  6184] open("/gnu/store/m9vxvhdj691bq1f85lpflvnhcvrdilih-glibc-2.23/lib/locale/en_US.UTF-8/LC_COLLATE", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
> > [pid  6184] open("/gnu/store/m9vxvhdj691bq1f85lpflvnhcvrdilih-glibc-2.23/lib/locale/en_US.utf8/LC_COLLATE", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
> > [pid  6184] open("/gnu/store/m9vxvhdj691bq1f85lpflvnhcvrdilih-glibc-2.23/lib/locale/en_US/LC_COLLATE", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
> > [pid  6184] open("/gnu/store/m9vxvhdj691bq1f85lpflvnhcvrdilih-glibc-2.23/lib/locale/en.UTF-8/LC_COLLATE", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
> > [pid  6184] open("/gnu/store/m9vxvhdj691bq1f85lpflvnhcvrdilih-glibc-2.23/lib/locale/en.utf8/LC_COLLATE", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
> > [pid  6184] open("/gnu/store/m9vxvhdj691bq1f85lpflvnhcvrdilih-glibc-2.23/lib/locale/en/LC_COLLATE", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
> >
> > And indeed those don't exist.
> 
> Ooh, I see.  To work around an issue in our glibc 2.23 package (that I
> forgot to fix in 2.24), whereby glibc does not look for locale data in
> /run/current-system/locale, commit
> ab3a64507a792e4da0527b423fbc28f8768e736a sets GUIX_LOCPATH in
> /etc/environment.

Did commit 9f58fe3d1c not fix that issue?
Ludovic Courtès - Oct. 18, 2016, 12:24 p.m.
Leo Famulari <leo@famulari.name> skribis:

> On Mon, Oct 17, 2016 at 11:00:25AM +0200, Ludovic Courtès wrote:
>> Danny Milosavljevic <dannym@scratchpost.org> skribis:
>> 
>> > And if I strace postgres service I get
>> >
>> > [pid  6184] open("/gnu/store/m9vxvhdj691bq1f85lpflvnhcvrdilih-glibc-2.23/lib/locale/locale-archive", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
>> > [pid  6184] open("/gnu/store/m9vxvhdj691bq1f85lpflvnhcvrdilih-glibc-2.23/share/locale/locale.alias", O_RDONLY|O_CLOEXEC) = 3
>> > [pid  6184] fstat(3, {st_mode=S_IFREG|0444, st_size=2997, ...}) = 0
>> > [pid  6184] read(3, "# Locale name alias data base.\n#"..., 4096) = 2997
>> > [pid  6184] read(3, "", 4096)           = 0
>> > [pid  6184] close(3)                    = 0
>> > [pid  6184] open("/gnu/store/m9vxvhdj691bq1f85lpflvnhcvrdilih-glibc-2.23/lib/locale/en_US.UTF-8/LC_COLLATE", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
>> > [pid  6184] open("/gnu/store/m9vxvhdj691bq1f85lpflvnhcvrdilih-glibc-2.23/lib/locale/en_US.utf8/LC_COLLATE", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
>> > [pid  6184] open("/gnu/store/m9vxvhdj691bq1f85lpflvnhcvrdilih-glibc-2.23/lib/locale/en_US/LC_COLLATE", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
>> > [pid  6184] open("/gnu/store/m9vxvhdj691bq1f85lpflvnhcvrdilih-glibc-2.23/lib/locale/en.UTF-8/LC_COLLATE", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
>> > [pid  6184] open("/gnu/store/m9vxvhdj691bq1f85lpflvnhcvrdilih-glibc-2.23/lib/locale/en.utf8/LC_COLLATE", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
>> > [pid  6184] open("/gnu/store/m9vxvhdj691bq1f85lpflvnhcvrdilih-glibc-2.23/lib/locale/en/LC_COLLATE", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
>> >
>> > And indeed those don't exist.
>> 
>> Ooh, I see.  To work around an issue in our glibc 2.23 package (that I
>> forgot to fix in 2.24), whereby glibc does not look for locale data in
>> /run/current-system/locale, commit
>> ab3a64507a792e4da0527b423fbc28f8768e736a sets GUIX_LOCPATH in
>> /etc/environment.
>
> Did commit 9f58fe3d1c not fix that issue?

Oh you’re right, it’s fixed in ‘core-updates’:

--8<---------------cut here---------------start------------->8---
$ ./pre-inst-env guix build -e '(@@ (gnu packages commencement) glibc-final)'

[...]

/gnu/store/1qpfjj4rk11wm6ix098hqbai9wrwb24c-glibc-2.24-debug
/gnu/store/iwgi9001dmmihrjg4rqhd6pa6788prjw-glibc-2.24
$ strings /gnu/store/iwgi9001dmmihrjg4rqhd6pa6788prjw-glibc-2.24/lib/libc.so.6 | grep /run/current-system
/run/current-system/locale/2.24
/run/current-system/locale/2.24/locale-archive
--8<---------------cut here---------------end--------------->8---

For current master the patch might still be helpful.

Thanks Leo!

Ludo’.
Danny Milosavljevic - Nov. 6, 2016, 12:36 a.m.
Hi Ludo,

On Mon, 17 Oct 2016 11:00:25 +0200
ludo@gnu.org (Ludovic Courtès) wrote:
> I suppose the untested patch below would work around it.  Could you try
> and report back?  (Will require a reboot or testing with ‘guix system
> vm’.)

First I tried whether it's still broken with current (~5 min ago) Guix master: yes, it is.

Then I applied the patch on my physical computer (not VM), reconfigured and rebooted. It works now. Thanks :)

Patch

diff --git a/gnu/services/shepherd.scm b/gnu/services/shepherd.scm
index 3273184..4dbf7e3 100644
--- a/gnu/services/shepherd.scm
+++ b/gnu/services/shepherd.scm
@@ -81,6 +81,11 @@ 
                     (false-if-exception (close-fdes fd))
                     (loop (+ 1 fd))))
 
+                ;; Our glibc package currently looks for locale data in
+                ;; PREFIX/lib/locale instead of /run/current-system/locale.
+                ;; Work around it.
+                (setenv "GUIX_LOCPATH" "/run/current-system/locale")
+
                 ;; Start shepherd.
                 (execl (string-append #$shepherd "/bin/shepherd")
                        "shepherd" "--config" #$shepherd-conf)))))