GNU bug report logs - #34480
[PATCH 0/2] Ensure Guix always has 'glibc-utf8-locales'

Previous Next

Package: guix-patches;

Reported by: Ludovic Courtès <ludo <at> gnu.org>

Date: Thu, 14 Feb 2019 22:18:01 UTC

Severity: normal

Tags: patch

Done: Ludovic Courtès <ludo <at> gnu.org>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 34480 in the body.
You can then email your comments to 34480 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to guix-patches <at> gnu.org:
bug#34480; Package guix-patches. (Thu, 14 Feb 2019 22:18:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Ludovic Courtès <ludo <at> gnu.org>:
New bug report received and forwarded. Copy sent to guix-patches <at> gnu.org. (Thu, 14 Feb 2019 22:18:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Ludovic Courtès <ludo <at> gnu.org>
To: guix-patches <at> gnu.org
Cc: Ludovic Courtès <ludo <at> gnu.org>
Subject: [PATCH 0/2] Ensure Guix always has 'glibc-utf8-locales'
Date: Thu, 14 Feb 2019 23:17:15 +0100
Hello Guix,

After hearing about so many bad first impressions due to missing locales,
I decided to bite the bullet.  I still don’t consider the approach
really satisfying, in particular due to the arbitrary locale selection
in ‘glibc-utf8-locales’, but the benefits are worth it IMO (I feel like
I’ve been too obtuse on this topic, and I’m sorry about that!).

The closure size of the ‘guix’ package increases like this:

--8<---------------cut here---------------start------------->8---
$ guix size guix | tail -1
total: 354.2 MiB
$ guix size guix glibc-utf8-locales | tail -1
total: 368.0 MiB
--8<---------------cut here---------------end--------------->8---

That’s a 4% increase, not that bad.

Something that would be worth looking into is how much space it would take
to have all the supported UTF-8 locales in that package.

Thoughts?

Ludo’.

Ludovic Courtès (2):
  self: Bundle 'glibc-utf8-locales'.
  gnu: guix: Embed 'glibc-utf8-locales'.

 gnu/packages/package-management.scm | 12 +++++++++---
 guix/self.scm                       | 14 ++++++++++++++
 2 files changed, 23 insertions(+), 3 deletions(-)

-- 
2.20.1





Information forwarded to guix-patches <at> gnu.org:
bug#34480; Package guix-patches. (Thu, 14 Feb 2019 22:22:01 GMT) Full text and rfc822 format available.

Message #8 received at 34480 <at> debbugs.gnu.org (full text, mbox):

From: Ludovic Courtès <ludo <at> gnu.org>
To: 34480 <at> debbugs.gnu.org
Cc: Ludovic Courtès <ludo <at> gnu.org>
Subject: [PATCH 1/2] self: Bundle 'glibc-utf8-locales'.
Date: Thu, 14 Feb 2019 23:21:19 +0100
This minimizes the risk of locale-related warnings, at least for those
who use one of the bundled UTF-8 locales.

* guix/self.scm (guix-command)[glibc-utf8-locales]: New variable.
In program body, set GUIX_LOCPATH.
---
 guix/self.scm | 14 ++++++++++++++
 1 file changed, 14 insertions(+)

diff --git a/guix/self.scm b/guix/self.scm
index a45470a0a6..bcf04a1b28 100644
--- a/guix/self.scm
+++ b/guix/self.scm
@@ -390,6 +390,10 @@ that provide Guile modules."
                        guile (guile-version (effective-version)))
   "Return the 'guix' command such that it adds MODULES and DEPENDENCIES in its
 load path."
+  (define glibc-utf8-locales
+    (module-ref (resolve-interface '(gnu packages base))
+                'glibc-utf8-locales))
+
   (define module-directory
     ;; To minimize the number of 'stat' calls needed to locate a module,
     ;; create the union of all the module directories.
@@ -410,6 +414,16 @@ load path."
                                            "/site-ccache")
                             %load-compiled-path))
 
+                    ;; To maximize the chances that locales are set up right
+                    ;; out-of-the-box, bundle "common" UTF-8 locales.
+                    (let ((locpath (getenv "GUIX_LOCPATH")))
+                      (setenv "GUIX_LOCPATH"
+                              (string-append (if locpath
+                                                 (string-append locpath ":")
+                                                 "")
+                                             #$(file-append glibc-utf8-locales
+                                                            "/lib/locale"))))
+
                     (let ((guix-main (module-ref (resolve-interface '(guix ui))
                                                  'guix-main)))
                       #$(if source
-- 
2.20.1





Information forwarded to guix-patches <at> gnu.org:
bug#34480; Package guix-patches. (Thu, 14 Feb 2019 22:22:02 GMT) Full text and rfc822 format available.

Message #11 received at 34480 <at> debbugs.gnu.org (full text, mbox):

From: Ludovic Courtès <ludo <at> gnu.org>
To: 34480 <at> debbugs.gnu.org
Cc: Ludovic Courtès <ludo <at> gnu.org>
Subject: [PATCH 2/2] gnu: guix: Embed 'glibc-utf8-locales'.
Date: Thu, 14 Feb 2019 23:21:20 +0100
This will ensure people who download the binary installation tarball
do not get locale-related warnings, provided they use one of the
selected UTF-8 locales.

* gnu/packages/package-management.scm (guix)[arguments]: In
'wrap-program' phase, set GUIX_LOCPATH.
[inputs]: Add GLIBC-UTF8-LOCALES.
---
 gnu/packages/package-management.scm | 12 +++++++++---
 1 file changed, 9 insertions(+), 3 deletions(-)

diff --git a/gnu/packages/package-management.scm b/gnu/packages/package-management.scm
index af9667cd91..e283df65f8 100644
--- a/gnu/packages/package-management.scm
+++ b/gnu/packages/package-management.scm
@@ -33,6 +33,7 @@
   #:use-module (gnu packages avahi)
   #:use-module (gnu packages autotools)
   #:use-module (gnu packages backup)
+  #:use-module (gnu packages base)
   #:use-module (gnu packages bdw-gc)
   #:use-module (gnu packages bison)
   #:use-module (gnu packages bootstrap)          ;for 'bootstrap-guile-origin'
@@ -227,6 +228,7 @@
                                                   "guile-bytestructures"))
                                (ssh    (assoc-ref inputs "guile-ssh"))
                                (gnutls (assoc-ref inputs "gnutls"))
+                               (locales (assoc-ref inputs "glibc-utf8-locales"))
                                (deps   (list gcrypt json sqlite gnutls
                                              git bs ssh))
                                (effective
@@ -245,11 +247,13 @@
                                                   "/lib/guile/" effective
                                                   "/site-ccache")
                                              (delete #f deps))
-                                        ":")))
+                                        ":"))
+                               (locpath (string-append locales "/lib/locale")))
 
                           (wrap-program (string-append out "/bin/guix")
                             `("GUILE_LOAD_PATH" ":" prefix (,path))
-                            `("GUILE_LOAD_COMPILED_PATH" ":" prefix (,gopath)))
+                            `("GUILE_LOAD_COMPILED_PATH" ":" prefix (,gopath))
+                            `("GUIX_LOCPATH" ":" suffix (,locpath)))
 
                           #t))))))
       (native-inputs `(("pkg-config" ,pkg-config)
@@ -282,7 +286,9 @@
          ,@(if (and (not (%current-target-system))
                     (string=? (%current-system) "x86_64-linux"))
                `(("boot-guile/i686" ,(bootstrap-guile-origin "i686-linux")))
-               '())))
+               '())
+
+         ("glibc-utf8-locales" ,glibc-utf8-locales)))
       (propagated-inputs
        `(("gnutls" ,gnutls)
          ("guile-gcrypt" ,guile-gcrypt)
-- 
2.20.1





Information forwarded to guix-patches <at> gnu.org:
bug#34480; Package guix-patches. (Fri, 15 Feb 2019 16:26:01 GMT) Full text and rfc822 format available.

Message #14 received at 34480 <at> debbugs.gnu.org (full text, mbox):

From: Leo Famulari <leo <at> famulari.name>
To: Ludovic Courtès <ludo <at> gnu.org>
Cc: 34480 <at> debbugs.gnu.org
Subject: Re: [bug#34480] [PATCH 0/2] Ensure Guix always has
 'glibc-utf8-locales'
Date: Fri, 15 Feb 2019 11:25:33 -0500
[Message part 1 (text/plain, inline)]
On Thu, Feb 14, 2019 at 11:17:15PM +0100, Ludovic Courtès wrote:
> Hello Guix,
> 
> After hearing about so many bad first impressions due to missing locales,
> I decided to bite the bullet.  I still don’t consider the approach
> really satisfying, in particular due to the arbitrary locale selection
> in ‘glibc-utf8-locales’, but the benefits are worth it IMO (I feel like
> I’ve been too obtuse on this topic, and I’m sorry about that!).

Okay, I think it's the right thing to do. We are constantly having to
explain the locales warning on IRC.

> The closure size of the ‘guix’ package increases like this:
> 
> --8<---------------cut here---------------start------------->8---
> $ guix size guix | tail -1
> total: 354.2 MiB
> $ guix size guix glibc-utf8-locales | tail -1
> total: 368.0 MiB
> --8<---------------cut here---------------end--------------->8---
> 
> That’s a 4% increase, not that bad.

It's worth it.
[signature.asc (application/pgp-signature, inline)]

Information forwarded to guix-patches <at> gnu.org:
bug#34480; Package guix-patches. (Fri, 15 Feb 2019 16:32:01 GMT) Full text and rfc822 format available.

Message #17 received at 34480 <at> debbugs.gnu.org (full text, mbox):

From: Ricardo Wurmus <rekado <at> elephly.net>
To: Leo Famulari <leo <at> famulari.name>
Cc: Ludovic Courtès <ludo <at> gnu.org>, 34480 <at> debbugs.gnu.org
Subject: Re: [bug#34480] [PATCH 0/2] Ensure Guix always has
 'glibc-utf8-locales'
Date: Fri, 15 Feb 2019 17:30:40 +0100
Leo Famulari <leo <at> famulari.name> writes:

> On Thu, Feb 14, 2019 at 11:17:15PM +0100, Ludovic Courtès wrote:
>> Hello Guix,
>> 
>> After hearing about so many bad first impressions due to missing locales,
>> I decided to bite the bullet.  I still don’t consider the approach
>> really satisfying, in particular due to the arbitrary locale selection
>> in ‘glibc-utf8-locales’, but the benefits are worth it IMO (I feel like
>> I’ve been too obtuse on this topic, and I’m sorry about that!).
>
> Okay, I think it's the right thing to do. We are constantly having to
> explain the locales warning on IRC.

This ensures that Guix itself works without these warnings.  It doesn’t
have an effect on installed applications, though, does it?  (That’s fine.)

>> The closure size of the ‘guix’ package increases like this:
>> 
>> --8<---------------cut here---------------start------------->8---
>> $ guix size guix | tail -1
>> total: 354.2 MiB
>> $ guix size guix glibc-utf8-locales | tail -1
>> total: 368.0 MiB
>> --8<---------------cut here---------------end--------------->8---
>> 
>> That’s a 4% increase, not that bad.
>
> It's worth it.

I agree.

Thank you, Ludo, for reconsidering and implementing this!

-- 
Ricardo





Reply sent to Ludovic Courtès <ludo <at> gnu.org>:
You have taken responsibility. (Sat, 16 Feb 2019 00:08:01 GMT) Full text and rfc822 format available.

Notification sent to Ludovic Courtès <ludo <at> gnu.org>:
bug acknowledged by developer. (Sat, 16 Feb 2019 00:08:01 GMT) Full text and rfc822 format available.

Message #22 received at 34480-done <at> debbugs.gnu.org (full text, mbox):

From: Ludovic Courtès <ludo <at> gnu.org>
To: Ricardo Wurmus <rekado <at> elephly.net>
Cc: 34480-done <at> debbugs.gnu.org, Leo Famulari <leo <at> famulari.name>
Subject: Re: [bug#34480] [PATCH 0/2] Ensure Guix always has
 'glibc-utf8-locales'
Date: Sat, 16 Feb 2019 01:07:40 +0100
Ricardo Wurmus <rekado <at> elephly.net> skribis:

> Leo Famulari <leo <at> famulari.name> writes:
>
>> On Thu, Feb 14, 2019 at 11:17:15PM +0100, Ludovic Courtès wrote:
>>> Hello Guix,
>>> 
>>> After hearing about so many bad first impressions due to missing locales,
>>> I decided to bite the bullet.  I still don’t consider the approach
>>> really satisfying, in particular due to the arbitrary locale selection
>>> in ‘glibc-utf8-locales’, but the benefits are worth it IMO (I feel like
>>> I’ve been too obtuse on this topic, and I’m sorry about that!).
>>
>> Okay, I think it's the right thing to do. We are constantly having to
>> explain the locales warning on IRC.
>
> This ensures that Guix itself works without these warnings.  It doesn’t
> have an effect on installed applications, though, does it?  (That’s fine.)

No it doesn’t; users still have to install ‘glibc-utf8-locales’ or
‘glibc-locales’ and set GUIX_LOCPATH for those.

However it occurred to me that warnings by Guix itself were the most
pressing issue: that’s basically the first message Guix would print.

>>> The closure size of the ‘guix’ package increases like this:
>>> 
>>> --8<---------------cut here---------------start------------->8---
>>> $ guix size guix | tail -1
>>> total: 354.2 MiB
>>> $ guix size guix glibc-utf8-locales | tail -1
>>> total: 368.0 MiB
>>> --8<---------------cut here---------------end--------------->8---
>>> 
>>> That’s a 4% increase, not that bad.
>>
>> It's worth it.
>
> I agree.
>
> Thank you, Ludo, for reconsidering and implementing this!

Done!

  ba48895899 self: Bundle 'glibc-utf8-locales'.
  8a973abc6f gnu: guix: Embed 'glibc-utf8-locales'.

Thank you,
Ludo’.




bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Sat, 16 Mar 2019 11:24:05 GMT) Full text and rfc822 format available.

This bug report was last modified 5 years and 35 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.