Subject: [bug#67686] bug#67044: C.utf8 locale cannot be built

From: Tomas Volf <[email-masked]>
Date: Thu, 7 Dec 2023 23:09:40 +0100

Hi :)

On 2023-12-07 11:27:04 +0100, Ludovic Courtès wrote:
> [..]
>
> I decided to give it a go:
>
>   https://issues.guix.gnu.org/67686
>
> Please do chime in and let me know what you think!

Thanks to the detailed cover letter, now I understand the benefit, so I agree it
would make sense.  I looked over the implementation, and it looks fine to me (I
am not sure if I am qualified to do the review though :) ).

I just have few notes:

1.

> (glibc-2.35)[arguments]: Delete ‘install-utf8-c-locale’ phase.

I do think 2.35 should install the locale as well.  That would require to change

    (invoke (string-append bin "/localedef")
            "--no-archive" "--prefix" locale
            "-i" "C" "-f" "UTF-8"
            (string-append locale "/C.UTF-8")))))

into

    (invoke (string-append bin "/localedef")
            "-c" "--no-archive" "--prefix" locale
            "-i" "C" "-f" "UTF-8"
            (string-append locale "/C.UTF-8")))))

however I think that is fine.  I am using locale built like that and it works
well.  What is more, from the discussion under the other issue[0], that is
exactly what is done during normal glibc build:

> It turns out we ignore errors during the glibc build (--quiet -c).

After that the drop of 'install-utf8-c-locale can be moved into some other
version < 2.35.

2.

I still believe it makes sense to add the -c also into the locale builder,
because my understanding is that this change will not allow using (locale
"C.utf8") in the operating-system definition (since that would still try to
build it, and fail).

If you are not opposed to the idea, I can send a patch if you would prefer not
to do it yourself.

3.

> I suspect libc builds an additional ‘localedef’ for the build machine but I’m
> not sure where it is, hmm…

I looked around a bit, and I am not sure that is true.  There seems to be only
./locale/localedef created.  However, there is localedef inside gcc-toolchain's
bin directory, and, of course, in the build glibc.  I am not sure what are the
version requirements here, but I would expect at least the one provided by glibc
to be usable.

Have a nice day,
Tomas

0: https://sourceware.org/bugzilla/show_bug.cgi?id=28845

--
There are only two hard things in Computer Science:
cache invalidation, naming things and off-by-one errors.