From: "Ludovic Courtès" <ludo@gnu.org>
To: 67824@debbugs.gnu.org
Cc: "Ludovic Courtès" <ludo@gnu.org>,
"Christopher Baines" <guix@cbaines.net>,
"Josselin Poiret" <dev@jpoiret.xyz>,
"Ludovic Courtès" <ludo@gnu.org>,
"Mathieu Othacehe" <othacehe@gnu.org>,
"Ricardo Wurmus" <rekado@elephly.net>,
"Simon Tournier" <zimon.toutoune@gmail.com>,
"Tobias Geerinckx-Rice" <me@tobias.gr>
Subject: [bug#67824] [PATCH core-updates 4/6] profiles: Use C.UTF-8 instead of ‘glibc-utf8-locales’ where possible.
Date: Thu, 14 Dec 2023 14:37:40 +0100 [thread overview]
Message-ID: <f40d9b9bbe08c279eab122d2bd29db2426a45731.1702550735.git.ludo@gnu.org> (raw)
In-Reply-To: <cover.1702550735.git.ludo@gnu.org>
This is a followup to 1cebc334a77030c0c94955981652f4df7608c9e3.
* guix/profiles.scm (ca-certificate-bundle)[libc-utf8-locales-for-target]:
Remove.
[build]: Use “C.UTF-8” instead of “en_US.utf8”.
(profile-derivation)[libc-utf8-locales-for-target]: Remove.
[set-utf8-locale]: Rewrite to a gexp that calls ‘setlocale’ for “C.UTF-8”.
* tests/profiles.scm ("profile-derivation, cross-compilation"): Remove
‘locales’ variable and related check.
Change-Id: I7cb148b9149fe5fbe5b9b1b25fdce1002ad1f37e
---
guix/profiles.scm | 33 +++++----------------------------
tests/profiles.scm | 7 +------
2 files changed, 6 insertions(+), 34 deletions(-)
diff --git a/guix/profiles.scm b/guix/profiles.scm
index ce2f8337bf..da7790d819 100644
--- a/guix/profiles.scm
+++ b/guix/profiles.scm
@@ -1125,11 +1125,6 @@ (define* (ca-certificate-bundle manifest #:optional system)
MANIFEST. Single-file bundles are required by programs such as Git and Lynx."
;; See <http://lists.gnu.org/archive/html/guix-devel/2015-02/msg00429.html>
;; for a discussion.
-
- (define libc-utf8-locales-for-target ;lazy reference
- (module-ref (resolve-interface '(gnu packages base))
- 'libc-utf8-locales-for-target))
-
(define build
(with-imported-modules '((guix build utils))
#~(begin
@@ -1161,13 +1156,7 @@ (define* (ca-certificate-bundle manifest #:optional system)
;; Some file names in the NSS certificates are UTF-8 encoded so
;; install a UTF-8 locale.
- (setenv "LOCPATH"
- (string-append #+(libc-utf8-locales-for-target system)
- "/lib/locale/"
- #+(version-major+minor
- (package-version
- (libc-utf8-locales-for-target system)))))
- (setlocale LC_ALL "en_US.utf8")
+ (setlocale LC_ALL "C.UTF-8")
(match (append-map ca-files '#$(manifest-inputs manifest))
(()
@@ -1960,8 +1949,7 @@ (define* (profile-derivation manifest
or TARGET is set, raise an error if MANIFEST contains a package that does not
support SYSTEM.
-When LOCALES? is true, the build is performed under a UTF-8 locale; this adds
-a dependency on the 'glibc-utf8-locales' package.
+When LOCALES? is true, the build is performed under a UTF-8 locale.
When RELATIVE-SYMLINKS? is true, use relative file names for symlink targets.
This is one of the things to do for the result to be relocatable.
@@ -2004,21 +1992,10 @@ (define* (profile-derivation manifest
(and (derivation? drv) (gexp-input drv)))
extras))
- (define libc-utf8-locales-for-target ;lazy reference
- (module-ref (resolve-interface '(gnu packages base))
- 'libc-utf8-locales-for-target))
-
(define set-utf8-locale
- ;; Some file names (e.g., in 'nss-certs') are UTF-8 encoded so
- ;; install a UTF-8 locale.
- (let ((locales (libc-utf8-locales-for-target
- (or system (%current-system)))))
- #~(begin
- (setenv "LOCPATH"
- #$(file-append locales "/lib/locale/"
- (version-major+minor
- (package-version locales))))
- (setlocale LC_ALL "en_US.utf8"))))
+ ;; Some file names (e.g., in 'nss-certs') are UTF-8 encoded so install a
+ ;; UTF-8 locale. Assume libc comes with a copy of C.UTF-8.
+ #~(setlocale LC_ALL "C.UTF-8"))
(define builder
(with-imported-modules '((guix build profiles)
diff --git a/tests/profiles.scm b/tests/profiles.scm
index ddd6d74f3b..e448137cff 100644
--- a/tests/profiles.scm
+++ b/tests/profiles.scm
@@ -463,7 +463,6 @@ (define glibc
(target -> "arm-linux-gnueabihf")
(grep (package->cross-derivation packages:grep target))
(sed (package->cross-derivation packages:sed target))
- (locales (package->derivation (packages:libc-utf8-locales-for-target)))
(drv (profile-derivation manifest
#:hooks '()
#:locales? #t
@@ -475,15 +474,11 @@ (define glibc
(and (string-suffix? name input) input)))
(derivation-inputs drv))))
- ;; The inputs for grep and sed should be cross-build derivations, but that
- ;; for the glibc-utf8-locales should be a native build.
(return (and (string=? (derivation-system drv) (%current-system))
(string=? (find-input packages:grep)
(derivation-file-name grep))
(string=? (find-input packages:sed)
- (derivation-file-name sed))
- (string=? (find-input (packages:libc-utf8-locales-for-target))
- (derivation-file-name locales))))))
+ (derivation-file-name sed))))))
(test-assert "package->manifest-entry defaults to \"out\""
(let ((outputs (package-outputs packages:glibc)))
--
2.41.0
next prev parent reply other threads:[~2023-12-14 13:40 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-12-14 10:51 [bug#67824] [PATCH core-updates 0/6] Run builds in C.UTF-8 locale Ludovic Courtès
2023-12-14 13:37 ` [bug#67824] [PATCH core-updates 1/6] packages: Remove reference to ‘glibc-utf8-locales’ in ‘patch-and-repack’ Ludovic Courtès
2023-12-14 13:37 ` [bug#67824] [PATCH core-updates 2/6] build-system/gnu: Change default locale to C.UTF-8 Ludovic Courtès
2023-12-14 13:37 ` [bug#67824] [PATCH core-updates 3/6] gnu: commencement: Remove ‘glibc-utf8-locales’ from ‘%final-inputs’ Ludovic Courtès
2023-12-14 13:37 ` Ludovic Courtès [this message]
2023-12-14 13:37 ` [bug#67824] [PATCH core-updates 5/6] packages: Output and error ports are line-buffered in ‘patch-and-repack’ Ludovic Courtès
2023-12-14 13:37 ` [bug#67824] [PATCH core-updates 6/6] gnu: glibc-utf8-locales: Add the C.UTF-8 locale Ludovic Courtès
2023-12-16 8:49 ` [bug#67824] [PATCH core-updates 0/6] Run builds in " Janneke Nieuwenhuizen
2023-12-16 11:27 ` Ludovic Courtès
2023-12-16 16:47 ` Ludovic Courtès
2023-12-18 16:30 ` [bug#67824] [PATCH core-updates v2 0/9] " Ludovic Courtès
2023-12-18 16:30 ` [bug#67824] [PATCH core-updates v2 1/9] packages: Remove reference to ‘glibc-utf8-locales’ in ‘patch-and-repack’ Ludovic Courtès
2023-12-18 16:30 ` [bug#67824] [PATCH core-updates v2 2/9] build-system/gnu: Change default locale to C.UTF-8 Ludovic Courtès
2023-12-18 16:30 ` [bug#67824] [PATCH core-updates v2 3/9] gnu: commencement: Remove ‘glibc-utf8-locales’ from ‘%final-inputs’ Ludovic Courtès
2023-12-18 16:30 ` [bug#67824] [PATCH core-updates v2 4/9] profiles: Use C.UTF-8 instead of ‘glibc-utf8-locales’ where possible Ludovic Courtès
2023-12-18 16:30 ` [bug#67824] [PATCH core-updates v2 5/9] packages: Output and error ports are line-buffered in ‘patch-and-repack’ Ludovic Courtès
2023-12-18 16:30 ` [bug#67824] [PATCH core-updates v2 6/9] gnu: glibc-utf8-locales: Add the C.UTF-8 locale Ludovic Courtès
2023-12-18 16:30 ` [bug#67824] [PATCH core-updates v2 7/9] gnu: glibc: Add patch for ‘ucontext’ on x86_64-gnu (GNU/Hurd) Ludovic Courtès
2023-12-18 16:30 ` [bug#67824] [PATCH core-updates v2 8/9] build-system/gnu: Turn PID 1 into an “init”-style process by default Ludovic Courtès
2023-12-18 16:30 ` [bug#67824] [PATCH core-updates v2 9/9] gnu: glib: Skip test that fails with glibc 2.38 Ludovic Courtès
2023-12-19 22:54 ` bug#67824: [PATCH core-updates v2 0/9] Run builds in C.UTF-8 locale Ludovic Courtès
2023-12-20 7:20 ` [bug#67824] " Janneke Nieuwenhuizen
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://guix.gnu.org/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=f40d9b9bbe08c279eab122d2bd29db2426a45731.1702550735.git.ludo@gnu.org \
--to=ludo@gnu.org \
--cc=67824@debbugs.gnu.org \
--cc=dev@jpoiret.xyz \
--cc=guix@cbaines.net \
--cc=me@tobias.gr \
--cc=othacehe@gnu.org \
--cc=rekado@elephly.net \
--cc=zimon.toutoune@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/guix.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).