GNU bug report logs - #70280
[PATCH 0/5] Reducing system size: locales and initrd

Previous Next

Package: guix-patches;

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

Date: Mon, 8 Apr 2024 14:24:01 UTC

Severity: normal

Tags: patch

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

To reply to this bug, email your comments to 70280 AT debbugs.gnu.org.
There is no need to reopen the bug first.

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

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


Report forwarded to ludo <at> gnu.org, guix-patches <at> gnu.org:
bug#70280; Package guix-patches. (Mon, 08 Apr 2024 14:24: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 ludo <at> gnu.org, guix-patches <at> gnu.org. (Mon, 08 Apr 2024 14:24: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/5] Reducing system size: locales and initrd
Date: Mon,  8 Apr 2024 16:22:38 +0200
Hello Guix,

I noticed¹ that ‘bare-bones.tmpl’ now leads to instances around
1.5 GiB, which I think is totally unreasonable, to say the least.

This patch series does the easy changes to get it to ~1.1 GiB,
which is still unreasonable, but at least should allow our installation
tests to run without having to increase the disk size again.

Thoughts?

The next but more difficult steps will be stripping Guix and Linux:

--8<---------------cut here---------------start------------->8---
$ guix size $(./pre-inst-env guix system build gnu/system/examples/bare-bones.tmpl) | head
store item                                                       total    self
/gnu/store/c650m9hh6zydh5nvnm4nk0m9y17y81cp-guix-1.4.0-18.4c94b9e   706.0   400.6  30.9%
/gnu/store/4z12nyxz5vc4r2hds08p2sfm0yjhlcka-linux-libre-6.7.11     119.6   119.6   9.2%
/gnu/store/1gd9nsy4cps8fnrd1avkc9l01l7ywiai-guile-3.0.9            135.0    53.1   4.1%
/gnu/store/bhynhk0c6ssq3fqqc59fvhxjzwywsjbb-guile-3.0.9            135.0    53.1   4.1%
/gnu/store/zh8ggd9z115agdx7yllvbr6vlg4zlis8-guile-static-initrd-3.0.9    46.0    46.0   3.6%
/gnu/store/lcygm0p2d59acvwi12lwldg5c0d4czpr-git-minimal-2.41.0     148.1    41.2   3.2%
/gnu/store/ln6hxqjvz6m9gdd9s97pivlqck7hzs99-glibc-2.35              40.6    38.8   3.0%
/gnu/store/6ncav55lbk5kqvwwflrzcr41hp5jbq0c-gcc-11.3.0-lib          75.3    34.7   2.7%
/gnu/store/b8wdz91p43s4kw26b300g4k3ap561fyk-locale-2.35             28.3    28.3   2.2%
--8<---------------cut here---------------end--------------->8---

Ludo’.

¹ https://ci.guix.gnu.org/build/3708442/details

Ludovic Courtès (5):
  system: Remove ‘glibc-2.33’ from ‘%default-locale-libcs’.
  system: ‘operating-system-locale-definitions’ includes the OS’ locale.
  locale: Shrink ‘%default-locale-definitions’ from 34 to 10 locales.
  services: build-vm: Provide only one locale.
  linux-initrd: Further strip the static Guile.

 doc/guix.texi                   |  5 +--
 gnu/packages/make-bootstrap.scm | 37 ++++++++++++++++++---
 gnu/services/virtualization.scm |  9 +++++
 gnu/system.scm                  | 28 ++++++++--------
 gnu/system/linux-initrd.scm     |  4 +--
 gnu/system/locale.scm           | 58 +++++++++------------------------
 6 files changed, 77 insertions(+), 64 deletions(-)


base-commit: cd45294d576975a3bff2f755764a3f46f09ea6f9
-- 
2.41.0





Information forwarded to guix-patches <at> gnu.org:
bug#70280; Package guix-patches. (Mon, 08 Apr 2024 14:26:03 GMT) Full text and rfc822 format available.

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

From: Ludovic Courtès <ludo <at> gnu.org>
To: 70280 <at> debbugs.gnu.org
Cc: Ludovic Courtès <ludo <at> gnu.org>
Subject: [PATCH 1/5] system: Remove ‘glibc-2.33’ from ‘%default-locale-libcs’.
Date: Mon,  8 Apr 2024 16:24:31 +0200
The transition from glibc 2.33 to 2.35 was done in
c919bfefd98bf2e29549539b4e28e6dc2a8a6f32 (one year ago), so we can
assume that the backward-compatible locales are no longer needed by
default.

This removes 92 MiB from the system closure.

* gnu/system/locale.scm (%default-locale-libcs): Remove GLIBC-2.33.

Change-Id: I85948bbe6b2d424f9f158eeafdb5543688c66c6b
---
 gnu/system/locale.scm | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/gnu/system/locale.scm b/gnu/system/locale.scm
index bc572baeb9..4ea82e24d5 100644
--- a/gnu/system/locale.scm
+++ b/gnu/system/locale.scm
@@ -150,7 +150,7 @@ (define %default-locale-libcs
   ;; The libcs for which we build locales by default.
   (if (system-hurd?)
       (list glibc/hurd)
-      (list glibc-2.33 glibc)))
+      (list glibc)))
 
 (define %default-locale-definitions
   ;; Arbitrary set of locales that are built by default.  They are here mostly
-- 
2.41.0





Information forwarded to guix-patches <at> gnu.org:
bug#70280; Package guix-patches. (Mon, 08 Apr 2024 14:26:04 GMT) Full text and rfc822 format available.

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

From: Ludovic Courtès <ludo <at> gnu.org>
To: 70280 <at> debbugs.gnu.org
Cc: Ludovic Courtès <ludo <at> gnu.org>
Subject: [PATCH 2/5] system: ‘operating-system-locale-definitions’ includes the OS’ locale.
Date: Mon,  8 Apr 2024 16:24:32 +0200
* gnu/system.scm (<operating-system>)[locale-definitions]: Mark as
thunked.  Default to (operating-system-default-locale-definitions os).
(operating-system-default-locale-definitions): New procedure.
(operating-system-locale-directory): Remove logic to add the OS
‘locale’, instead assuming (operating-system-locale-directory os) has
everything.
* doc/guix.texi (operating-system Reference): Adjust accordingly.

Change-Id: I8798fa0de7421e0bfc07870cc3cae6b7f99fa47d
---
 doc/guix.texi  |  3 ++-
 gnu/system.scm | 28 +++++++++++++++-------------
 2 files changed, 17 insertions(+), 14 deletions(-)

diff --git a/doc/guix.texi b/doc/guix.texi
index 5827e0de14..7ca06046ba 100644
--- a/doc/guix.texi
+++ b/doc/guix.texi
@@ -17502,7 +17502,8 @@ operating-system Reference
 The name of the default locale (@pxref{Locale Names,,, libc, The GNU C
 Library Reference Manual}).  @xref{Locales}, for more information.
 
-@item @code{locale-definitions} (default: @code{%default-locale-definitions})
+@item @code{locale-definitions} (default: @
+  @code{(operating-system-default-locale-definitions os)})
 The list of locale definitions to be compiled and that may be used at
 run time.  @xref{Locales}.
 
diff --git a/gnu/system.scm b/gnu/system.scm
index aef81d8ccf..94d734b014 100644
--- a/gnu/system.scm
+++ b/gnu/system.scm
@@ -282,7 +282,9 @@ (define-record-type* <operating-system> operating-system
   (locale   operating-system-locale               ; string
             (default "en_US.utf8"))
   (locale-definitions operating-system-locale-definitions ; list of <locale-definition>
-                      (default %default-locale-definitions))
+                      (thunked)
+                      (default (operating-system-default-locale-definitions
+                                this-operating-system)))
   (locale-libcs operating-system-locale-libcs     ; list of <packages>
                 (default %default-locale-libcs))
   (name-service-switch operating-system-name-service-switch ; <name-service-switch>
@@ -1397,22 +1399,22 @@ (define (locale-name->definition* name)
      (raise (formatted-message (G_ "~a: invalid locale name") name)))
     (def def)))
 
+(define (operating-system-default-locale-definitions os)
+  "Return the default locale definitions for OS, which includes that specified
+in its 'locale' field."
+  (define name
+    (operating-system-locale os))
+
+  (if (member name (map locale-definition-name %default-locale-definitions))
+      %default-locale-definitions
+      (cons (locale-name->definition* name)
+            %default-locale-definitions)))
+
 (define (operating-system-locale-directory os)
   "Return the directory containing the locales compiled for the definitions
 listed in OS.  The C library expects to find it under
 /run/current-system/locale."
-  (define name
-    (operating-system-locale os))
-
-  (define definitions
-    ;; While we're at it, check whether NAME is defined and add it if needed.
-    (if (member name (map locale-definition-name
-                          (operating-system-locale-definitions os)))
-        (operating-system-locale-definitions os)
-        (cons (locale-name->definition* name)
-              (operating-system-locale-definitions os))))
-
-  (locale-directory definitions
+  (locale-directory (operating-system-locale-definitions os)
                     #:libcs (operating-system-locale-libcs os)))
 
 (define* (kernel->boot-label kernel #:key hurd)
-- 
2.41.0





Information forwarded to guix-patches <at> gnu.org:
bug#70280; Package guix-patches. (Mon, 08 Apr 2024 14:26:04 GMT) Full text and rfc822 format available.

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

From: Ludovic Courtès <ludo <at> gnu.org>
To: 70280 <at> debbugs.gnu.org
Cc: Ludovic Courtès <ludo <at> gnu.org>
Subject: [PATCH 3/5] locale: Shrink ‘%default-locale-definitions’ from 34 to 10 locales.
Date: Mon,  8 Apr 2024 16:24:33 +0200
This reduces the default set of locales from 92 MiB to 28 MiB.

* gnu/system/locale.scm (%default-locale-definitions): Reduce to 10
locales.

Change-Id: I3c092604301d69db591957bcfd62a062c3ac5ab0
---
 gnu/system/locale.scm | 56 ++++++++++++-------------------------------
 1 file changed, 15 insertions(+), 41 deletions(-)

diff --git a/gnu/system/locale.scm b/gnu/system/locale.scm
index 4ea82e24d5..00eb902702 100644
--- a/gnu/system/locale.scm
+++ b/gnu/system/locale.scm
@@ -153,9 +153,10 @@ (define %default-locale-libcs
       (list glibc)))
 
 (define %default-locale-definitions
-  ;; Arbitrary set of locales that are built by default.  They are here mostly
-  ;; to facilitate first-time use to some people, while others may have to add
-  ;; a specific <locale-definition>.
+  ;; Arbitrary set of locales that are built by default.  They come as a
+  ;; "bonus" in addition to that specified in the 'locale' field of the
+  ;; operating system, for the user's convenience, so they shouldn't take too
+  ;; much space.
   (letrec-syntax ((utf8-locale (syntax-rules ()
                                  ((_ name*)
                                   (locale-definition
@@ -167,44 +168,17 @@ (define %default-locale-definitions
                   (utf8-locales (syntax-rules ()
                                   ((_ name ...)
                                    (list (utf8-locale name) ...)))))
-    ;; Add "en_US.UTF-8" for compatibility with Guix 0.8.
-    (cons (locale-definition
-           (name "en_US.UTF-8")
-           (source "en_US")
-           (charset "UTF-8"))
-          (utf8-locales "ca_ES"
-                        "cs_CZ"
-                        "da_DK"
-                        "de_DE"
-                        "el_GR"
-                        "en_AU"
-                        "en_CA"
-                        "en_GB"
-                        "en_US"
-                        "es_AR"
-                        "es_CL"
-                        "es_ES"
-                        "es_MX"
-                        "fi_FI"
-                        "fr_BE"
-                        "fr_CA"
-                        "fr_CH"
-                        "fr_FR"
-                        "ga_IE"
-                        "it_IT"
-                        "ja_JP"
-                        "ko_KR"
-                        "nb_NO"
-                        "nl_NL"
-                        "pl_PL"
-                        "pt_PT"
-                        "ro_RO"
-                        "ru_RU"
-                        "sv_SE"
-                        "tr_TR"
-                        "uk_UA"
-                        "vi_VN"
-                        "zh_CN"))))
+    ;; The six UN official languages, with at most two variants per language.
+    (utf8-locales "ar_DZ"
+                  "ar_JO"
+                  "en_GB"
+                  "en_US"
+                  "es_AR"
+                  "es_ES"
+                  "fr_CA"
+                  "fr_FR"
+                  "ru_RU"
+                  "zh_CN")))
 
 
 ;;;
-- 
2.41.0





Information forwarded to ludo <at> gnu.org, guix-patches <at> gnu.org:
bug#70280; Package guix-patches. (Mon, 08 Apr 2024 14:26:05 GMT) Full text and rfc822 format available.

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

From: Ludovic Courtès <ludo <at> gnu.org>
To: 70280 <at> debbugs.gnu.org
Cc: Ludovic Courtès <ludo <at> gnu.org>
Subject: [PATCH 5/5] linux-initrd: Further strip the static Guile.
Date: Mon,  8 Apr 2024 16:24:35 +0200
‘guile-static-initrd’ weighs in at 46 MiB, compared to 54 MiB for
‘guile-static-stripped’ (15% reduction).

* gnu/packages/make-bootstrap.scm (make-guile-static-stripped): Add
‘directories-to-remove’ parameter and honor it.
(%guile-static-initrd): New variable.
* gnu/system/linux-initrd.scm (expression->initrd): Default to
‘%guile-static-initrd’.
* doc/guix.texi (Initial RAM Disk): Adjust accordingly.

Change-Id: I2baf06fed7a3698433e7c83b1d7726054a8c746e
---
 doc/guix.texi                   |  2 +-
 gnu/packages/make-bootstrap.scm | 37 ++++++++++++++++++++++++++++-----
 gnu/system/linux-initrd.scm     |  4 ++--
 3 files changed, 35 insertions(+), 8 deletions(-)

diff --git a/doc/guix.texi b/doc/guix.texi
index 7ca06046ba..705f7d7de2 100644
--- a/doc/guix.texi
+++ b/doc/guix.texi
@@ -41339,7 +41339,7 @@ Initial RAM Disk
 program to run in that initrd.
 
 @deffn {Procedure} expression->initrd exp @
-       [#:guile %guile-static-stripped] [#:name "guile-initrd"]
+       [#:guile %guile-static-initrd] [#:name "guile-initrd"]
 Return as a file-like object a Linux initrd (a gzipped cpio archive)
 containing @var{guile} and that evaluates @var{exp}, a G-expression,
 upon booting.  All the derivations referenced by @var{exp} are
diff --git a/gnu/packages/make-bootstrap.scm b/gnu/packages/make-bootstrap.scm
index 7b40f395f3..4dd45a4a27 100644
--- a/gnu/packages/make-bootstrap.scm
+++ b/gnu/packages/make-bootstrap.scm
@@ -1,5 +1,5 @@
 ;;; GNU Guix --- Functional package management for GNU
-;;; Copyright © 2012-2021, 2023 Ludovic Courtès <ludo <at> gnu.org>
+;;; Copyright © 2012-2021, 2023-2024 Ludovic Courtès <ludo <at> gnu.org>
 ;;; Copyright © 2017, 2021 Efraim Flashner <efraim <at> flashner.co.il>
 ;;; Copyright © 2018 Tobias Geerinckx-Rice <me <at> tobias.gr>
 ;;; Copyright © 2018, 2019 Mark H Weaver <mhw <at> netris.org>
@@ -55,7 +55,8 @@ (define-module (gnu packages make-bootstrap)
             %guile-bootstrap-tarball
             %bootstrap-tarballs
 
-            %guile-static-stripped))
+            %guile-static-stripped
+            %guile-static-initrd))
 
 ;;; Commentary:
 ;;;
@@ -674,7 +675,8 @@ (define %guile-static-3.0
                        "guile-3.0-linux-syscalls.patch"
                        "guile-3.0-relocatable.patch")))
 
-(define* (make-guile-static-stripped static-guile)
+(define* (make-guile-static-stripped static-guile
+                                     #:optional (directories-to-remove '()))
   (package
     (inherit static-guile)
     (name (string-append (package-name static-guile) "-stripped"))
@@ -702,6 +704,12 @@ (define* (make-guile-static-stripped static-guile)
                  (mkdir (string-append out "/bin"))
                  (copy-file guile1 guile2)
 
+                 ;; Optionally remove additional directories.
+                 (for-each (lambda (directory)
+                             (delete-file-recursively
+                              (string-append out "/" directory)))
+                           '#$directories-to-remove)
+
                  ;; Verify that the relocated Guile works.
                  #$@(if (%current-target-system)
                         '()
@@ -720,10 +728,29 @@ (define* (make-guile-static-stripped static-guile)
     (synopsis "Minimal statically-linked and relocatable Guile")))
 
 (define %guile-static-stripped
-  ;; A stripped static Guile 3.0 binary, for use in initrds
-  ;; and during bootstrap.
+  ;; A stripped static Guile 3.0 binary for use during bootstrap.
   (make-guile-static-stripped %guile-static-3.0))
 
+(define %guile-static-initrd
+  ;; A stripped static Guile 3.0 binary for use in initrds.  Remove various
+  ;; modules that are useless in an initrd.  Note: Keep most of language/
+  ;; because it is needed for Bournish.
+  (package
+    (inherit
+     (make-guile-static-stripped
+      %guile-static-3.0
+      (append-map (lambda (directory)
+                    (list (string-append "lib/guile/3.0/ccache/" directory)
+                          (string-append "share/guile/3.0/" directory)))
+                  '("language/brainfuck"
+                    "language/ecmascript"
+                    "language/elisp"
+                    "oop"
+                    "scripts"
+                    "texinfo"
+                    "web"))))
+    (name "guile-static-initrd")))
+
 (define (tarball-package pkg)
   "Return a package containing a tarball of PKG."
   (package
diff --git a/gnu/system/linux-initrd.scm b/gnu/system/linux-initrd.scm
index 561cfe2fd0..00221333da 100644
--- a/gnu/system/linux-initrd.scm
+++ b/gnu/system/linux-initrd.scm
@@ -36,7 +36,7 @@ (define-module (gnu system linux-initrd)
   #:use-module ((gnu packages xorg)
                 #:select (console-setup xkeyboard-config))
   #:use-module ((gnu packages make-bootstrap)
-                #:select (%guile-static-stripped))
+                #:select (%guile-static-initrd))
   #:use-module (gnu system file-systems)
   #:use-module (gnu system mapped-devices)
   #:use-module (gnu system keyboard)
@@ -62,7 +62,7 @@ (define-module (gnu system linux-initrd)
 
 (define* (expression->initrd exp
                              #:key
-                             (guile %guile-static-stripped)
+                             (guile %guile-static-initrd)
                              (gzip gzip)
                              (name "guile-initrd")
                              (system (%current-system)))
-- 
2.41.0





Information forwarded to guix-patches <at> gnu.org:
bug#70280; Package guix-patches. (Mon, 08 Apr 2024 14:26:05 GMT) Full text and rfc822 format available.

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

From: Ludovic Courtès <ludo <at> gnu.org>
To: 70280 <at> debbugs.gnu.org
Cc: Ludovic Courtès <ludo <at> gnu.org>
Subject: [PATCH 4/5] services: build-vm: Provide only one locale.
Date: Mon,  8 Apr 2024 16:24:34 +0200
* gnu/services/virtualization.scm (%virtual-build-machine-operating-system)
[locale, locale-definitions]: New fields.

Change-Id: Ieb24b3a0c210291d8c04412e4c263b5e377b5704
---
 gnu/services/virtualization.scm | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/gnu/services/virtualization.scm b/gnu/services/virtualization.scm
index fc5adb94d0..d87e494348 100644
--- a/gnu/services/virtualization.scm
+++ b/gnu/services/virtualization.scm
@@ -46,6 +46,7 @@ (define-module (gnu services virtualization)
   #:use-module (gnu system shadow)
   #:autoload   (gnu system vm) (linux-image-startup-command
                                 virtualized-operating-system)
+  #:autoload   (gnu system locale) (locale-definition)
   #:use-module (gnu system)
   #:use-module (guix derivations)
   #:use-module (guix gexp)
@@ -1190,6 +1191,14 @@ (define %minimal-vm-syslog-config
 (define %virtual-build-machine-operating-system
   (operating-system
     (host-name "build-machine")
+
+    (locale "en_US.utf8")
+    (locale-definitions
+     ;; Save space by providing only one locale.
+     (list (locale-definition (name "en_US.utf8")
+                              (source "en_US")
+                              (charset "UTF-8"))))
+
     (bootloader (bootloader-configuration         ;unused
                  (bootloader grub-minimal-bootloader)
                  (targets '("/dev/null"))))
-- 
2.41.0





Information forwarded to guix-patches <at> gnu.org:
bug#70280; Package guix-patches. (Tue, 09 Apr 2024 19:39:02 GMT) Full text and rfc822 format available.

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

From: "pelzflorian (Florian Pelz)" <pelzflorian <at> pelzflorian.de>
To: Ludovic Courtès <ludo <at> gnu.org>
Cc: 70280 <at> debbugs.gnu.org
Subject: Re: [bug#70280] [PATCH 3/5] locale: Shrink
 ‘%default-locale-definitions’ from 34 to 10
 locales.
Date: Tue, 09 Apr 2024 21:38:12 +0200
Hello Ludo.  Even though with my base commit I get 70MB more than you do
(from 1460.5MB down to 1296.1MB), your patches still bring good
improvement.

So (operating-system-locale-definitions os) can now be changed to
something other than operating-system-locale-definitions that does not
include locale.  Perhaps this is useful when one does not want utf8 but
EUC-JP like in the “info "(guix)Locales"”?  Okay.

I agree with shrinking default locales, but do not understand what
benefit it brings that U.N. languages are always included.  Perhaps it
would be more useful to include en_US only?  Locales like fr_CA and
ar_JO do not even have separate teams on translationproject.org.  There
are reasons for developers to include interesting locales for testing
like tr_TR or az_AZ, where capitalized i is İ and small I is ı, breaking
all kinds of programs, but few people would know.

Regards,
Florian




Information forwarded to guix-patches <at> gnu.org:
bug#70280; Package guix-patches. (Wed, 10 Apr 2024 09:10:01 GMT) Full text and rfc822 format available.

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

From: "pelzflorian (Florian Pelz)" <pelzflorian <at> pelzflorian.de>
To: Ludovic Courtès <ludo <at> gnu.org>
Cc: 70280 <at> debbugs.gnu.org
Subject: Re: [bug#70280] [PATCH 2/5] system:
 ‘operating-system-locale-definitions’ includes
 the OS’ locale.
Date: Wed, 10 Apr 2024 11:09:04 +0200
Hello Ludo, with a clearer mind now:

Ludovic Courtès <ludo <at> gnu.org> writes:
> * gnu/system.scm (<operating-system>)[locale-definitions]: Mark as
> thunked.  Default to (operating-system-default-locale-definitions os).
> (operating-system-default-locale-definitions): New procedure.
> (operating-system-locale-directory): Remove logic to add the OS
> ‘locale’, instead assuming (operating-system-locale-directory os) has
> everything.
> * doc/guix.texi (operating-system Reference): Adjust accordingly.

This is a regression.  I have in my /run/current-system/configuration.scm

 (locale "de_DE.utf8")
 (locale-definitions
  (cons* (locale-definition
          (name "ar_SY.utf8") (source "ar_SY"))
         (locale-definition
          (name "bn_BD.utf8") (source "bn_BD"))
         (locale-definition
          (name "hu_HU.utf8") (source "hu_HU"))
         (locale-definition
          (name "ka_GE.utf8") (source "ka_GE"))
         (locale-definition
          (name "lt_LT.utf8") (source "lt_LT"))
         (locale-definition
          (name "oc_FR.utf8") (source "oc_FR"))
         (locale-definition
          (name "pt_BR.utf8") (source "pt_BR"))
         (locale-definition
          (name "si_LK.utf8") (source "si_LK"))
         (locale-definition
          (name "sk_SK.utf8") (source "sk_SK"))
         (locale-definition
          (name "sr_RS.utf8") (source "sr_RS"))
         %default-locale-definitions))

but de_DE.utf8 is not available and
“export LC_ALL=de_DE.utf8” gives an error.

scheme@(guix-user)> ,use (gnu system locale)
scheme@(guix-user)> %default-locale-definitions
$1 = (#<<locale-definition> name: "ar_DZ.utf8" source: "ar_DZ" charset: "UTF-8"> #<<locale-definition> name: "ar_JO.utf8" source: "ar_JO" charset: "UTF-8"> #<<locale-definition> name: "en_GB.utf8" source: "en_GB" charset: "UTF-8"> #<<locale-definition> name: "en_US.utf8" source: "en_US" charset: "UTF-8"> #<<locale-definition> name: "es_AR.utf8" source: "es_AR" charset: "UTF-8"> #<<locale-definition> name: "es_ES.utf8" source: "es_ES" charset: "UTF-8"> #<<locale-definition> name: "fr_CA.utf8" source: "fr_CA" charset: "UTF-8"> #<<locale-definition> name: "fr_FR.utf8" source: "fr_FR" charset: "UTF-8"> #<<locale-definition> name: "ru_RU.utf8" source: "ru_RU" charset: "UTF-8"> #<<locale-definition> name: "zh_CN.utf8" source: "zh_CN" charset: "UTF-8">)

Regards,
Florian




Information forwarded to guix-patches <at> gnu.org:
bug#70280; Package guix-patches. (Wed, 10 Apr 2024 09:54:02 GMT) Full text and rfc822 format available.

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

From: "pelzflorian (Florian Pelz)" <pelzflorian <at> pelzflorian.de>
To: Ludovic Courtès <ludo <at> gnu.org>
Cc: 70280 <at> debbugs.gnu.org
Subject: Re: [bug#70280] [PATCH 2/5] system:
 ‘operating-system-locale-definitions’ includes
 the OS’ locale.
Date: Wed, 10 Apr 2024 11:52:48 +0200
"pelzflorian (Florian Pelz)" <pelzflorian <at> pelzflorian.de> writes:
> This is a regression.  I have in my /run/current-system/configuration.scm
>
>  (locale "de_DE.utf8")
>  (locale-definitions
>   (cons* (locale-definition
>           (name "ar_SY.utf8") (source "ar_SY"))
>          (locale-definition
>           (name "bn_BD.utf8") (source "bn_BD"))
>          (locale-definition
>           (name "hu_HU.utf8") (source "hu_HU"))
>          (locale-definition
>           (name "ka_GE.utf8") (source "ka_GE"))
>          (locale-definition
>           (name "lt_LT.utf8") (source "lt_LT"))
>          (locale-definition
>           (name "oc_FR.utf8") (source "oc_FR"))
>          (locale-definition
>           (name "pt_BR.utf8") (source "pt_BR"))
>          (locale-definition
>           (name "si_LK.utf8") (source "si_LK"))
>          (locale-definition
>           (name "sk_SK.utf8") (source "sk_SK"))
>          (locale-definition
>           (name "sr_RS.utf8") (source "sr_RS"))
>          %default-locale-definitions))
>
> but de_DE.utf8 is not available and
> “export LC_ALL=de_DE.utf8” gives an error.

I meant to also write:

scheme@(guix-user)> ,use (gnu system)
scheme@(guix-user)> (operating-system-locale-definitions (load "/run/current-system/configuration.scm"))
$2 = (#<<locale-definition> name: "ar_SY.utf8" source: "ar_SY" charset: "UTF-8"> #<<locale-definition> name: "bn_BD.utf8" source: "bn_BD" charset: "UTF-8"> #<<locale-definition> name: "hu_HU.utf8" source: "hu_HU" charset: "UTF-8"> #<<locale-definition> name: "ka_GE.utf8" source: "ka_GE" charset: "UTF-8"> #<<locale-definition> name: "lt_LT.utf8" source: "lt_LT" charset: "UTF-8"> #<<locale-definition> name: "oc_FR.utf8" source: "oc_FR" charset: "UTF-8"> #<<locale-definition> name: "pt_BR.utf8" source: "pt_BR" charset: "UTF-8"> #<<locale-definition> name: "si_LK.utf8" source: "si_LK" charset: "UTF-8"> #<<locale-definition> name: "sk_SK.utf8" source: "sk_SK" charset: "UTF-8"> #<<locale-definition> name: "sr_RS.utf8" source: "sr_RS" charset: "UTF-8"> #<<locale-definition> name: "ar_DZ.utf8" source: "ar_DZ" charset: "UTF-8"> #<<locale-definition> name: "ar_JO.utf8" source: "ar_JO" charset: "UTF-8"> #<<locale-definition> name: "en_GB.utf8" source: "en_GB" charset: "UTF-8"> #<<locale-definition> name: "en_US.utf8" source: "en_US" charset: "UTF-8"> #<<locale-definition> name: "es_AR.utf8" source: "es_AR" charset: "UTF-8"> #<<locale-definition> name: "es_ES.utf8" source: "es_ES" charset: "UTF-8"> #<<locale-definition> name: "fr_CA.utf8" source: "fr_CA" charset: "UTF-8"> #<<locale-definition> name: "fr_FR.utf8" source: "fr_FR" charset: "UTF-8"> #<<locale-definition> name: "ru_RU.utf8" source: "ru_RU" charset: "UTF-8"> #<<locale-definition> name: "zh_CN.utf8" source: "zh_CN" charset: "UTF-8">)

No de_DE in there, but it should be.

Regards,
Florian




Information forwarded to guix-patches <at> gnu.org:
bug#70280; Package guix-patches. (Mon, 15 Apr 2024 16:23:01 GMT) Full text and rfc822 format available.

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

From: Ludovic Courtès <ludo <at> gnu.org>
To: "pelzflorian (Florian Pelz)" <pelzflorian <at> pelzflorian.de>
Cc: 70280 <at> debbugs.gnu.org
Subject: Re: [bug#70280] [PATCH 3/5] locale: Shrink
 ‘%default-locale-definitions’ from 34 to 10
 locales.
Date: Mon, 15 Apr 2024 18:22:08 +0200
Guten Tag Florian,

"pelzflorian (Florian Pelz)" <pelzflorian <at> pelzflorian.de> skribis:

> I agree with shrinking default locales, but do not understand what
> benefit it brings that U.N. languages are always included.  Perhaps it
> would be more useful to include en_US only?

My idea was to include by default a few locales that people may
“typically” find useful, in addition to their chosen one.

Of course, it’s an arbitrary choice (choosing the six UN languages makes
it slightly less arbitrary).

> Locales like fr_CA and
> ar_JO do not even have separate teams on translationproject.org.  There
> are reasons for developers to include interesting locales for testing
> like tr_TR or az_AZ, where capitalized i is İ and small I is ı, breaking
> all kinds of programs, but few people would know.

My goal is *not* to provide a default set useful for developers
(otherwise German, Greek, Turkish, and non-UTF-8 locales would be
welcome).

Now, should we remove fr_CA and ar_JO?  Maybe!  I’m open to really any
changes in this list; I just think it should go beyond en_US.

Thoughts?

Ludo’.




Information forwarded to guix-patches <at> gnu.org:
bug#70280; Package guix-patches. (Mon, 15 Apr 2024 16:25:03 GMT) Full text and rfc822 format available.

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

From: Ludovic Courtès <ludo <at> gnu.org>
To: "pelzflorian (Florian Pelz)" <pelzflorian <at> pelzflorian.de>
Cc: 70280 <at> debbugs.gnu.org
Subject: Re: [bug#70280] [PATCH 2/5] system:
 ‘operating-system-locale-definitions’ includes
 the OS’ locale.
Date: Mon, 15 Apr 2024 18:23:49 +0200
"pelzflorian (Florian Pelz)" <pelzflorian <at> pelzflorian.de> skribis:

> Ludovic Courtès <ludo <at> gnu.org> writes:
>> * gnu/system.scm (<operating-system>)[locale-definitions]: Mark as
>> thunked.  Default to (operating-system-default-locale-definitions os).
>> (operating-system-default-locale-definitions): New procedure.
>> (operating-system-locale-directory): Remove logic to add the OS
>> ‘locale’, instead assuming (operating-system-locale-directory os) has
>> everything.
>> * doc/guix.texi (operating-system Reference): Adjust accordingly.
>
> This is a regression.  I have in my /run/current-system/configuration.scm
>
>  (locale "de_DE.utf8")
>  (locale-definitions
>   (cons* (locale-definition
>           (name "ar_SY.utf8") (source "ar_SY"))
>          (locale-definition
>           (name "bn_BD.utf8") (source "bn_BD"))
>          (locale-definition
>           (name "hu_HU.utf8") (source "hu_HU"))
>          (locale-definition
>           (name "ka_GE.utf8") (source "ka_GE"))
>          (locale-definition
>           (name "lt_LT.utf8") (source "lt_LT"))
>          (locale-definition
>           (name "oc_FR.utf8") (source "oc_FR"))
>          (locale-definition
>           (name "pt_BR.utf8") (source "pt_BR"))
>          (locale-definition
>           (name "si_LK.utf8") (source "si_LK"))
>          (locale-definition
>           (name "sk_SK.utf8") (source "sk_SK"))
>          (locale-definition
>           (name "sr_RS.utf8") (source "sr_RS"))
>          %default-locale-definitions))
>
> but de_DE.utf8 is not available and
> “export LC_ALL=de_DE.utf8” gives an error.

Right.

I would call it a semantic change rather than a regression (a feature
rather than a bug :-)).

It’s more in line with what we’re doing elsewhere: the default is to
include ‘locale’ in the locale definitions, but we let the user override
that if they wish.

Perhaps we should at least clarify the manual?

Ludo’.




Information forwarded to guix-patches <at> gnu.org:
bug#70280; Package guix-patches. (Mon, 15 Apr 2024 22:34:01 GMT) Full text and rfc822 format available.

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

From: "pelzflorian (Florian Pelz)" <pelzflorian <at> pelzflorian.de>
To: Ludovic Courtès <ludo <at> gnu.org>
Cc: 70280 <at> debbugs.gnu.org
Subject: Re: [bug#70280] [PATCH 3/5] locale: Shrink
 ‘%default-locale-definitions’ from 34 to 10
 locales.
Date: Tue, 16 Apr 2024 00:32:38 +0200
Bonjour Ludo. :)

Ludovic Courtès <ludo <at> gnu.org> writes:
> Guten Tag Florian,
>
> "pelzflorian (Florian Pelz)" <pelzflorian <at> pelzflorian.de> skribis:
>
>> I agree with shrinking default locales, but do not understand what
>> benefit it brings that U.N. languages are always included.  Perhaps it
>> would be more useful to include en_US only?
>
> My idea was to include by default a few locales that people may
> “typically” find useful, in addition to their chosen one.

Hmm but how would they use it?  Ohh I just noticed that these languages
configured here will be the options in the GNOME Settings.  I do agree
now that the six languages are a standard set, although Russian has less
speakers than Portuguese [1], which gets discussed [2] and I would tend
to also include Portuguese then, because it has translations unlike
Bengali or Hindi.


> Of course, it’s an arbitrary choice (choosing the six UN languages makes
> it slightly less arbitrary).
>
>> Locales like fr_CA and
>> ar_JO do not even have separate teams on translationproject.org.  There
>> are reasons for developers to include interesting locales for testing
>> like tr_TR or az_AZ, where capitalized i is İ and small I is ı, breaking
>> all kinds of programs, but few people would know.
>
> My goal is *not* to provide a default set useful for developers
> (otherwise German, Greek, Turkish, and non-UTF-8 locales would be
> welcome).
>
> Now, should we remove fr_CA and ar_JO?  Maybe!  I’m open to really any
> changes in this list; I just think it should go beyond en_US.
>
> Thoughts?
>
> Ludo’.

I would remove ar_JO.  Probably also remove fr_CA, because someone from
Canada will configure fr_CA during Guix installation.

Regards,
Florian

[1]
https://en.wikipedia.org/wiki/List_of_languages_by_total_number_of_speakers

[2]
https://en.wikipedia.org/wiki/Official_languages_of_the_United_Nations




Information forwarded to guix-patches <at> gnu.org:
bug#70280; Package guix-patches. (Mon, 15 Apr 2024 22:53:03 GMT) Full text and rfc822 format available.

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

From: "pelzflorian (Florian Pelz)" <pelzflorian <at> pelzflorian.de>
To: Ludovic Courtès <ludo <at> gnu.org>
Cc: 70280 <at> debbugs.gnu.org
Subject: Re: [bug#70280] [PATCH 2/5] system:
 ‘operating-system-locale-definitions’ includes
 the OS’ locale.
Date: Tue, 16 Apr 2024 00:51:38 +0200
Ludovic Courtès <ludo <at> gnu.org> writes:
> "pelzflorian (Florian Pelz)" <pelzflorian <at> pelzflorian.de> skribis:
>> This is a regression.  I have in my /run/current-system/configuration.scm
>>
>>  (locale "de_DE.utf8")
>>  (locale-definitions
>>   (cons* (locale-definition
>>           (name "ar_SY.utf8") (source "ar_SY"))
>>          (locale-definition
>>           (name "bn_BD.utf8") (source "bn_BD"))
>>          (locale-definition
>>           (name "hu_HU.utf8") (source "hu_HU"))
>>          (locale-definition
>>           (name "ka_GE.utf8") (source "ka_GE"))
>>          (locale-definition
>>           (name "lt_LT.utf8") (source "lt_LT"))
>>          (locale-definition
>>           (name "oc_FR.utf8") (source "oc_FR"))
>>          (locale-definition
>>           (name "pt_BR.utf8") (source "pt_BR"))
>>          (locale-definition
>>           (name "si_LK.utf8") (source "si_LK"))
>>          (locale-definition
>>           (name "sk_SK.utf8") (source "sk_SK"))
>>          (locale-definition
>>           (name "sr_RS.utf8") (source "sr_RS"))
>>          %default-locale-definitions))
>>
>> but de_DE.utf8 is not available and
>> “export LC_ALL=de_DE.utf8” gives an error.
>
> Right.
>
> I would call it a semantic change rather than a regression (a feature
> rather than a bug :-)).
>
> It’s more in line with what we’re doing elsewhere: the default is to
> include ‘locale’ in the locale definitions, but we let the user override
> that if they wish.


It is a regression when with the same OS config.scm, my GNOME is no
longer in German.  Perhaps I’m missing something, but the only gain from
making it configurable to not include the configured default locale in
locale-definitions would be that it becomes possible to not include the
default locale language’s utf8 encoding, but utf8 is good for everyone.

> Perhaps we should at least clarify the manual?
>
> Ludo’.

I would have expected the prior behavior, i.e. the setting in locale to
be available regardless of locale-definitions.  To me it does not seem
necessary to be documented explicitly, but maybe better be explicit.

Regards,
Florian




Information forwarded to guix-patches <at> gnu.org:
bug#70280; Package guix-patches. (Wed, 17 Apr 2024 15:17:02 GMT) Full text and rfc822 format available.

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

From: Ludovic Courtès <ludo <at> gnu.org>
To: "pelzflorian (Florian Pelz)" <pelzflorian <at> pelzflorian.de>
Cc: 70280 <at> debbugs.gnu.org
Subject: Re: [bug#70280] [PATCH 2/5] system:
 ‘operating-system-locale-definitions’ includes
 the OS’ locale.
Date: Wed, 17 Apr 2024 17:16:10 +0200
"pelzflorian (Florian Pelz)" <pelzflorian <at> pelzflorian.de> skribis:

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

[...]

>> I would call it a semantic change rather than a regression (a feature
>> rather than a bug :-)).
>>
>> It’s more in line with what we’re doing elsewhere: the default is to
>> include ‘locale’ in the locale definitions, but we let the user override
>> that if they wish.
>
>
> It is a regression when with the same OS config.scm, my GNOME is no
> longer in German.  Perhaps I’m missing something, but the only gain from
> making it configurable to not include the configured default locale in
> locale-definitions would be that it becomes possible to not include the
> default locale language’s utf8 encoding, but utf8 is good for everyone.

OK, let’s drop this patch then.

I was focusing on interface consistency but in this particular case what
you describe suggests interface consistency is a secondary concern.

Thanks,
Ludo’.




Information forwarded to guix-patches <at> gnu.org:
bug#70280; Package guix-patches. (Wed, 17 Apr 2024 15:22:07 GMT) Full text and rfc822 format available.

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

From: Ludovic Courtès <ludo <at> gnu.org>
To: "pelzflorian (Florian Pelz)" <pelzflorian <at> pelzflorian.de>
Cc: 70280 <at> debbugs.gnu.org
Subject: Re: [bug#70280] [PATCH 3/5] locale: Shrink
 ‘%default-locale-definitions’ from 34 to 10
 locales.
Date: Wed, 17 Apr 2024 17:20:57 +0200
"pelzflorian (Florian Pelz)" <pelzflorian <at> pelzflorian.de> skribis:

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

[...]

>> My idea was to include by default a few locales that people may
>> “typically” find useful, in addition to their chosen one.
>
> Hmm but how would they use it?

I don’t use a desktop environment; my use case would be:

  export LC_ALL=…

or, say:

  LANGUAGE=fr:es:en

> Ohh I just noticed that these languages configured here will be the
> options in the GNOME Settings.  I do agree now that the six languages
> are a standard set, although Russian has less speakers than Portuguese
> [1], which gets discussed [2] and I would tend to also include
> Portuguese then, because it has translations unlike Bengali or Hindi.

Yeah, the UN language choice is base on imperialism more than
popularity.

> I would remove ar_JO.  Probably also remove fr_CA, because someone from
> Canada will configure fr_CA during Guix installation.

OK, let’s drop these two and add pt_BR and pt_PT then.

Thanks!

Ludo’.




Reply sent to Ludovic Courtès <ludo <at> gnu.org>:
You have taken responsibility. (Mon, 29 Apr 2024 22:31:02 GMT) Full text and rfc822 format available.

Notification sent to Ludovic Courtès <ludo <at> gnu.org>:
bug acknowledged by developer. (Mon, 29 Apr 2024 22:31:02 GMT) Full text and rfc822 format available.

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

From: Ludovic Courtès <ludo <at> gnu.org>
To: "pelzflorian (Florian Pelz)" <pelzflorian <at> pelzflorian.de>
Cc: 70280-done <at> debbugs.gnu.org
Subject: Re: [bug#70280] [PATCH 3/5] locale: Shrink
 ‘%default-locale-definitions’ from 34 to 10
 locales.
Date: Tue, 30 Apr 2024 00:30:24 +0200
Hi Florian,

I pushed this series as 5f89f45e7465ebbdc84c925ea3cfaec5dd06ed88,
following the two suggestions you made:

  • Dropping the controversial patch that changed whether the system
    locale would be include.

  • Dropping two “redundant” locales and adding two Portuguese locales
    to the default set.

Thanks again!

Ludo’.




This bug report was last modified 4 days ago.

Previous Next


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