From patchwork Mon Dec 18 16:30:15 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: 57681 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 ECDF527BBEB; Mon, 18 Dec 2023 16:32:40 +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 5E36327BBE9 for ; Mon, 18 Dec 2023 16:32:40 +0000 (GMT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rFGXO-0001my-T1; Mon, 18 Dec 2023 11:32:14 -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 1rFGXD-0001kX-09 for guix-patches@gnu.org; Mon, 18 Dec 2023 11:32:04 -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 1rFGXC-0007eq-5u; Mon, 18 Dec 2023 11:32:02 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1rFGXC-00074v-JB; Mon, 18 Dec 2023 11:32:02 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#67824] [PATCH core-updates v2 4/9] 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: Mon, 18 Dec 2023 16:32:02 +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.170291706626061 (code B ref 67824); Mon, 18 Dec 2023 16:32:02 +0000 Received: (at 67824) by debbugs.gnu.org; 18 Dec 2023 16:31:06 +0000 Received: from localhost ([127.0.0.1]:33378 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rFGWH-0006lS-HU for submit@debbugs.gnu.org; Mon, 18 Dec 2023 11:31:06 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:44526) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rFGW7-0006Qo-Ak for 67824@debbugs.gnu.org; Mon, 18 Dec 2023 11:30:56 -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 1rFGW0-0007UN-1l; Mon, 18 Dec 2023 11:30:48 -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=fp+z3oil6ne74o7cmiu4 z0EIg153fM5Zy2qSfsisxYi0VMa2lBcTHlKKGoQGllF9xlyUSRNcE0k7ytBYzwC9NLEtiSpHAqTCk Ph5k+Onhlr5icgWu6ufLzjoyejAj1BsukXZmkZ1JqCDOBnGdZ5PAOlU7nkUhTvBS2yZzOcJOE4NUA QTyu0l+n3HqNX33+xo5IuVvAmYXEzVvE/h/gK3EZVABHO3ZyhO7S+JFCFHlbyNm1Xe9RdzkkYWFQs zWSQI2b50CLYyrC8ZoB6+C1b9b14NIFCtzVpgYAccEc5WCF6sGT64/XE6Lok6Zsyt2MwYPj7vJtDm g+l5Tu5zjCvtVQ==; From: Ludovic =?utf-8?q?Court=C3=A8s?= Date: Mon, 18 Dec 2023 17:30:15 +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)))