[PATCH 0/5] Reducing system size: locales and initrd

  • Done
  • quality assurance status badge
Details
2 participants
  • Ludovic Courtès
  • pelzflorian (Florian Pelz)
Owner
unassigned
Submitted by
Ludovic Courtès
Severity
normal
L
L
Ludovic Courtès wrote on 8 Apr 16:22 +0200
(address . guix-patches@gnu.org)(name . Ludovic Courtès)(address . ludo@gnu.org)
cover.1712585810.git.ludo@gnu.org
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:

Toggle snippet (13 lines)
$ 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%

Ludo’.


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
L
L
Ludovic Courtès wrote on 8 Apr 16:24 +0200
[PATCH 1/5] system: Remove ‘glibc-2.33 ’ from ‘%default-locale-libcs’.
(address . 70280@debbugs.gnu.org)(name . Ludovic Courtès)(address . ludo@gnu.org)
41f0a119e008fff73ae97faa3f55e5b8faf4ba2d.1712585810.git.ludo@gnu.org
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(-)

Toggle diff (15 lines)
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
L
L
Ludovic Courtès wrote on 8 Apr 16:24 +0200
[PATCH 2/5] system: ‘operating-system-locale- definitions’ includes the OS’ locale.
(address . 70280@debbugs.gnu.org)(name . Ludovic Courtès)(address . ludo@gnu.org)
184c38bf07d985a8831f60024a2ae94e2fd6804d.1712585810.git.ludo@gnu.org
* 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(-)

Toggle diff (66 lines)
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
L
L
Ludovic Courtès wrote on 8 Apr 16:24 +0200
[PATCH 3/5] locale: Shrink ‘%default-locale -definitions’ from 34 to 10 locales.
(address . 70280@debbugs.gnu.org)(name . Ludovic Courtès)(address . ludo@gnu.org)
c3d39296e091348f32ccfee671cf2918b5752424.1712585810.git.ludo@gnu.org
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(-)

Toggle diff (76 lines)
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
L
L
Ludovic Courtès wrote on 8 Apr 16:24 +0200
[PATCH 5/5] linux-initrd: Further strip the static Guile.
(address . 70280@debbugs.gnu.org)(name . Ludovic Courtès)(address . ludo@gnu.org)
021746eea10ffcc41b5b870816210628f3685f99.1712585810.git.ludo@gnu.org
‘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(-)

Toggle diff (113 lines)
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@gnu.org>
+;;; Copyright © 2012-2021, 2023-2024 Ludovic Courtès <ludo@gnu.org>
;;; Copyright © 2017, 2021 Efraim Flashner <efraim@flashner.co.il>
;;; Copyright © 2018 Tobias Geerinckx-Rice <me@tobias.gr>
;;; Copyright © 2018, 2019 Mark H Weaver <mhw@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
L
L
Ludovic Courtès wrote on 8 Apr 16:24 +0200
[PATCH 4/5] services: build-vm: Provide only one locale.
(address . 70280@debbugs.gnu.org)(name . Ludovic Courtès)(address . ludo@gnu.org)
782fcd725ad7a8e576f6ee24259697d8aff714dd.1712585810.git.ludo@gnu.org
* 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(+)

Toggle diff (29 lines)
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
P
P
pelzflorian (Florian Pelz) wrote on 9 Apr 21:38 +0200
Re: [bug#70280] [PATCH 3/5] locale: Shrink ‘%default-locale-definitions’ from 34 to 10 locales.
(name . Ludovic Courtès)(address . ludo@gnu.org)(address . 70280@debbugs.gnu.org)
87frvus4wr.fsf@pelzflorian.de
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
P
P
pelzflorian (Florian Pelz) wrote on 10 Apr 11:09 +0200
Re: [bug#70280] [PATCH 2/5] system: ‘operating-system-locale-definitions’ includes the OS’ locale.
(name . Ludovic Courtès)(address . ludo@gnu.org)(address . 70280@debbugs.gnu.org)
871q7dshxr.fsf@pelzflorian.de
Hello Ludo, with a clearer mind now:

Ludovic Courtès <ludo@gnu.org> writes:
Toggle quote (8 lines)
> * 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
P
P
pelzflorian (Florian Pelz) wrote on 10 Apr 11:52 +0200
(name . Ludovic Courtès)(address . ludo@gnu.org)(address . 70280@debbugs.gnu.org)
87msq1h7db.fsf@pelzflorian.de
"pelzflorian (Florian Pelz)" <pelzflorian@pelzflorian.de> writes:
Toggle quote (29 lines)
> 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
L
L
Ludovic Courtès wrote on 15 Apr 18:22 +0200
Re: [bug#70280] [PATCH 3/5] locale: Shrink ‘%default-locale-definitions’ from 34 to 10 locales.
(name . pelzflorian (Florian Pelz))(address . pelzflorian@pelzflorian.de)(address . 70280@debbugs.gnu.org)
87y19ezjdb.fsf@gnu.org
Guten Tag Florian,

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

Toggle quote (4 lines)
> 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).

Toggle quote (6 lines)
> 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’.
L
L
Ludovic Courtès wrote on 15 Apr 18:23 +0200
Re: [bug#70280] [PATCH 2/5] system: ‘operating-system-locale-definitions’ includes the OS’ locale.
(name . pelzflorian (Florian Pelz))(address . pelzflorian@pelzflorian.de)(address . 70280@debbugs.gnu.org)
87ttk2zjai.fsf@gnu.org
"pelzflorian (Florian Pelz)" <pelzflorian@pelzflorian.de> skribis:

Toggle quote (38 lines)
> Ludovic Courtès <ludo@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’.
P
P
pelzflorian (Florian Pelz) wrote on 16 Apr 00:32 +0200
Re: [bug#70280] [PATCH 3/5] locale: Shrink ‘%default-locale-definitions’ from 34 to 10 locales.
(name . Ludovic Courtès)(address . ludo@gnu.org)(address . 70280@debbugs.gnu.org)
87a5lunto9.fsf@pelzflorian.de
Bonjour Ludo. :)

Ludovic Courtès <ludo@gnu.org> writes:
Toggle quote (11 lines)
> Guten Tag Florian,
>
> "pelzflorian (Florian Pelz)" <pelzflorian@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.


Toggle quote (20 lines)
> 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]

[2]
P
P
pelzflorian (Florian Pelz) wrote on 16 Apr 00:51 +0200
Re: [bug#70280] [PATCH 2/5] system: ‘operating-system-locale-definitions’ includes the OS’ locale.
(name . Ludovic Courtès)(address . ludo@gnu.org)(address . 70280@debbugs.gnu.org)
875xwinssl.fsf@pelzflorian.de
Ludovic Courtès <ludo@gnu.org> writes:
Toggle quote (40 lines)
> "pelzflorian (Florian Pelz)" <pelzflorian@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.

Toggle quote (4 lines)
> 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
L
L
Ludovic Courtès wrote on 17 Apr 17:16 +0200
(name . pelzflorian (Florian Pelz))(address . pelzflorian@pelzflorian.de)(address . 70280@debbugs.gnu.org)
87v84gggud.fsf@gnu.org
"pelzflorian (Florian Pelz)" <pelzflorian@pelzflorian.de> skribis:

Toggle quote (2 lines)
> Ludovic Courtès <ludo@gnu.org> writes:

[...]

Toggle quote (14 lines)
>> 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’.
L
L
Ludovic Courtès wrote on 17 Apr 17:20 +0200
Re: [bug#70280] [PATCH 3/5] locale: Shrink ‘%default-locale-definitions’ from 34 to 10 locales.
(name . pelzflorian (Florian Pelz))(address . pelzflorian@pelzflorian.de)(address . 70280@debbugs.gnu.org)
87mspsggme.fsf@gnu.org
"pelzflorian (Florian Pelz)" <pelzflorian@pelzflorian.de> skribis:

Toggle quote (2 lines)
> Ludovic Courtès <ludo@gnu.org> writes:

[...]

Toggle quote (5 lines)
>> 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

Toggle quote (6 lines)
> 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.

Toggle quote (3 lines)
> 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’.
L
L
Ludovic Courtès wrote on 30 Apr 00:30 +0200
(name . pelzflorian (Florian Pelz))(address . pelzflorian@pelzflorian.de)(address . 70280-done@debbugs.gnu.org)
87a5lbztrz.fsf@gnu.org
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’.
Closed
?
Your comment

This issue is archived.

To comment on this conversation send an email to 70280@debbugs.gnu.org

To respond to this issue using the mumi CLI, first switch to it
mumi current 70280
Then, you may apply the latest patchset in this issue (with sign off)
mumi am -- -s
Or, compose a reply to this issue
mumi compose
Or, send patches to this issue
mumi send-email *.patch