From patchwork Thu Dec 14 13:37:40 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Ludovic_Court=C3=A8s?= X-Patchwork-Id: 20642 Return-Path: X-Original-To: patchwork@mira.cbaines.net Delivered-To: patchwork@mira.cbaines.net Received: by mira.cbaines.net (Postfix, from userid 113) id E0CB527BBEB; Thu, 14 Dec 2023 13:40:05 +0000 (GMT) X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-2.7 required=5.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,MAILING_LIST_MULTI,SPF_HELO_PASS,URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.6 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTPS id 8028027BBE2 for ; Thu, 14 Dec 2023 13:40:02 +0000 (GMT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rDlvh-0005Ye-0c; Thu, 14 Dec 2023 08:39:09 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rDlve-0005XC-Kw for guix-patches@gnu.org; Thu, 14 Dec 2023 08:39:06 -0500 Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rDlve-0003Y2-C0; Thu, 14 Dec 2023 08:39:06 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1rDlvb-0007H4-Nu; Thu, 14 Dec 2023 08:39:03 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#67824] [PATCH core-updates 4/6] profiles: Use C.UTF-8 instead of =?utf-8?b?4oCYZ2xpYmMtdXRmOC1sb2NhbGVz4oCZ?= where possible. Resent-From: Ludovic =?utf-8?q?Court=C3=A8s?= Original-Sender: "Debbugs-submit" Resent-CC: guix@cbaines.net, dev@jpoiret.xyz, ludo@gnu.org, othacehe@gnu.org, rekado@elephly.net, zimon.toutoune@gmail.com, me@tobias.gr, guix-patches@gnu.org Resent-Date: Thu, 14 Dec 2023 13:39:03 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 67824 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 67824@debbugs.gnu.org Cc: Ludovic =?utf-8?q?Court=C3=A8s?= , Christopher Baines , Josselin Poiret , Ludovic =?utf-8?q?Court=C3=A8s?= , Mathieu Othacehe , Ricardo Wurmus , Simon Tournier , Tobias Geerinckx-Rice X-Debbugs-Original-Xcc: Christopher Baines , Josselin Poiret , Ludovic =?utf-8?q?Court=C3=A8s?= , Mathieu Othacehe , Ricardo Wurmus , Simon Tournier , Tobias Geerinckx-Rice Received: via spool by 67824-submit@debbugs.gnu.org id=B67824.170256110927865 (code B ref 67824); Thu, 14 Dec 2023 13:39:03 +0000 Received: (at 67824) by debbugs.gnu.org; 14 Dec 2023 13:38:29 +0000 Received: from localhost ([127.0.0.1]:48963 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rDlv2-0007FF-8X for submit@debbugs.gnu.org; Thu, 14 Dec 2023 08:38:29 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:43044) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rDluz-0007Eh-KY for 67824@debbugs.gnu.org; Thu, 14 Dec 2023 08:38:26 -0500 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rDluu-0002yf-TK; Thu, 14 Dec 2023 08:38:20 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-Version:References:In-Reply-To:Date:Subject:To: From; bh=TwvTpdL8/xMKO5FWaa90V1adDxfqVe8ftAvsBI051cA=; b=ihjtVFc4hTCdn7wJaOYR 868oUujS4J+8UNYFrL6iVKqAWRIw+hFnj55tlcUWYSiUB1jBl7tMAccRRKGuRVLpaVzRLEG+ou1UC LT46z8CMKU3+tl0JFm7IHM37qbBMQ5XyoM2jzf4fgeHVyBpqnsWDOvPkcKoY19UvW5KDZkvjlps8S ZPbfostr6XAeBQpVQ51A8Gc+XelmAc0I3oVK3xjToIwg/9J3yh8tvf1NJ3rO5PAHUvpnmAp5dMtFy 601RTa3HPAfao1W9l3VudwBMcITSukS1IpBi0AYYpFtv283psa6o3/9gqvjXZQ/gc26PIcydrvVRc QMQ8pHtDYN2C9Q==; From: Ludovic =?utf-8?q?Court=C3=A8s?= Date: Thu, 14 Dec 2023 14:37:40 +0100 Message-ID: X-Mailer: git-send-email 2.41.0 In-Reply-To: References: MIME-Version: 1.0 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org Sender: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org X-getmail-retrieved-from-mailbox: Patches 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 ;; 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)))