all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* [bug#34480] [PATCH 0/2] Ensure Guix always has 'glibc-utf8-locales'
@ 2019-02-14 22:17 Ludovic Courtès
  2019-02-14 22:21 ` [bug#34480] [PATCH 1/2] self: Bundle 'glibc-utf8-locales' Ludovic Courtès
  2019-02-15 16:25 ` [bug#34480] [PATCH 0/2] Ensure Guix always has 'glibc-utf8-locales' Leo Famulari
  0 siblings, 2 replies; 6+ messages in thread
From: Ludovic Courtès @ 2019-02-14 22:17 UTC (permalink / raw)
  To: 34480

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

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

* [bug#34480] [PATCH 1/2] self: Bundle 'glibc-utf8-locales'.
  2019-02-14 22:17 [bug#34480] [PATCH 0/2] Ensure Guix always has 'glibc-utf8-locales' Ludovic Courtès
@ 2019-02-14 22:21 ` Ludovic Courtès
  2019-02-14 22:21   ` [bug#34480] [PATCH 2/2] gnu: guix: Embed 'glibc-utf8-locales' Ludovic Courtès
  2019-02-15 16:25 ` [bug#34480] [PATCH 0/2] Ensure Guix always has 'glibc-utf8-locales' Leo Famulari
  1 sibling, 1 reply; 6+ messages in thread
From: Ludovic Courtès @ 2019-02-14 22:21 UTC (permalink / raw)
  To: 34480

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

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

* [bug#34480] [PATCH 2/2] gnu: guix: Embed 'glibc-utf8-locales'.
  2019-02-14 22:21 ` [bug#34480] [PATCH 1/2] self: Bundle 'glibc-utf8-locales' Ludovic Courtès
@ 2019-02-14 22:21   ` Ludovic Courtès
  0 siblings, 0 replies; 6+ messages in thread
From: Ludovic Courtès @ 2019-02-14 22:21 UTC (permalink / raw)
  To: 34480

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

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

* [bug#34480] [PATCH 0/2] Ensure Guix always has 'glibc-utf8-locales'
  2019-02-14 22:17 [bug#34480] [PATCH 0/2] Ensure Guix always has 'glibc-utf8-locales' Ludovic Courtès
  2019-02-14 22:21 ` [bug#34480] [PATCH 1/2] self: Bundle 'glibc-utf8-locales' Ludovic Courtès
@ 2019-02-15 16:25 ` Leo Famulari
  2019-02-15 16:30   ` Ricardo Wurmus
  1 sibling, 1 reply; 6+ messages in thread
From: Leo Famulari @ 2019-02-15 16:25 UTC (permalink / raw)
  To: Ludovic Courtès; +Cc: 34480

[-- Attachment #1: Type: text/plain, Size: 962 bytes --]

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.

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

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

* [bug#34480] [PATCH 0/2] Ensure Guix always has 'glibc-utf8-locales'
  2019-02-15 16:25 ` [bug#34480] [PATCH 0/2] Ensure Guix always has 'glibc-utf8-locales' Leo Famulari
@ 2019-02-15 16:30   ` Ricardo Wurmus
  2019-02-16  0:07     ` bug#34480: " Ludovic Courtès
  0 siblings, 1 reply; 6+ messages in thread
From: Ricardo Wurmus @ 2019-02-15 16:30 UTC (permalink / raw)
  To: Leo Famulari; +Cc: 34480


Leo Famulari <leo@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

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

* bug#34480: [PATCH 0/2] Ensure Guix always has 'glibc-utf8-locales'
  2019-02-15 16:30   ` Ricardo Wurmus
@ 2019-02-16  0:07     ` Ludovic Courtès
  0 siblings, 0 replies; 6+ messages in thread
From: Ludovic Courtès @ 2019-02-16  0:07 UTC (permalink / raw)
  To: Ricardo Wurmus; +Cc: 34480-done

Ricardo Wurmus <rekado@elephly.net> skribis:

> Leo Famulari <leo@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’.

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

end of thread, other threads:[~2019-02-16  0:08 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-02-14 22:17 [bug#34480] [PATCH 0/2] Ensure Guix always has 'glibc-utf8-locales' Ludovic Courtès
2019-02-14 22:21 ` [bug#34480] [PATCH 1/2] self: Bundle 'glibc-utf8-locales' Ludovic Courtès
2019-02-14 22:21   ` [bug#34480] [PATCH 2/2] gnu: guix: Embed 'glibc-utf8-locales' Ludovic Courtès
2019-02-15 16:25 ` [bug#34480] [PATCH 0/2] Ensure Guix always has 'glibc-utf8-locales' Leo Famulari
2019-02-15 16:30   ` Ricardo Wurmus
2019-02-16  0:07     ` bug#34480: " Ludovic Courtès

Code repositories for project(s) associated with this external index

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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.