From patchwork Fri Sep 22 12:54:06 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: 54153 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 9B6D427BBE2; Fri, 22 Sep 2023 13:55:20 +0100 (BST) 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 B5E2527BBE9 for ; Fri, 22 Sep 2023 13:55:18 +0100 (BST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qjfgO-00014a-12; Fri, 22 Sep 2023 08:54:56 -0400 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 1qjfgL-00012i-QE for guix-patches@gnu.org; Fri, 22 Sep 2023 08:54:53 -0400 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 1qjfgL-0007pv-I8 for guix-patches@gnu.org; Fri, 22 Sep 2023 08:54:53 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1qjfgW-0005gn-3x for guix-patches@gnu.org; Fri, 22 Sep 2023 08:55:04 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#66156] [PATCH 05/12] services: guix: Use the right locale package on GNU/Hurd. Resent-From: Ludovic =?utf-8?q?Court=C3=A8s?= Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Fri, 22 Sep 2023 12:55:04 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 66156 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 66156@debbugs.gnu.org Cc: Ludovic =?utf-8?q?Court=C3=A8s?= Received: via spool by 66156-submit@debbugs.gnu.org id=B66156.169538729721797 (code B ref 66156); Fri, 22 Sep 2023 12:55:04 +0000 Received: (at 66156) by debbugs.gnu.org; 22 Sep 2023 12:54:57 +0000 Received: from localhost ([127.0.0.1]:35574 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qjfgO-0005fO-Kn for submit@debbugs.gnu.org; Fri, 22 Sep 2023 08:54:57 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:41080) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qjfgK-0005e6-Cl for 66156@debbugs.gnu.org; Fri, 22 Sep 2023 08:54:52 -0400 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 1qjfg4-0007lk-Fy; Fri, 22 Sep 2023 08:54:36 -0400 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=Y8E+4zulALqHL3vEakC0nXvIb5r/vVsKAsv9l64DTvQ=; b=rk3sBHK1QqFgusxG9jMn vr/M4z0AnXcMUV+RmezpmTq4yncDF4eGJrIOrrksx1ZtSnMTj8deDfJAtw1ra/r9nopKTg4YO0fL3 6xma3JCoL9Nv4xqu0D7P59vZqAMEuy0PxjxBlAC2crwNjPQyza8llcvPsUbF1Z/7Q0QG7KNVDmEy3 PGJa2++U6ebodacCjUrVzsUoC2YrAXPkV5g94CIivnhre4nl42GniOGWTjnd/TbWlFORc9LiOjDqi jFwxRsQSbdub1Ortx2rMh8b9mhXAPx8tMMM1U6sYebpXkabX2oLys65aLWD579/9F/r7nOKzML14Z Fp5TkHXbGJefcg==; From: Ludovic =?utf-8?q?Court=C3=A8s?= Date: Fri, 22 Sep 2023 14:54:06 +0200 Message-ID: <7646a159c95b899d0d0008d63e1eb98b6b07a218.1695386493.git.ludo@gnu.org> 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 Fixes a bug introduced in 0dd293b4d9095137c9952e16ca951f887b7e7018 whereby guix-daemon on GNU/Hurd would have ‘GUIX_LOCPATH’ set to the “wrong” locale data (2.35 instead of 2.37). Consequently, it would fail to setlocale(3) and calls to ‘std::stoi’ (when reading the output of ‘guix authenticate’) would throw, leading to this error message of guix-daemon: unexpected build daemon error: stoi This would manifest when sending store items to a childhurd: $ guix copy --to=localhost:10022 sed guix copy: sending 1 store item (1 MiB) to 'localhost'... guix copy: error: unknown error while sending files over SSH The “unknown error” is the ‘stoi’ exception. This commit fixes that, but for the ‘guix-daemon’ service only. * gnu/services/base.scm (guix-shepherd-service)[locales]: New variable. Use it instead of ‘glibc-utf8-locales’. --- gnu/services/base.scm | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/gnu/services/base.scm b/gnu/services/base.scm index b3f2d2e8b8..10e0d4cf9d 100644 --- a/gnu/services/base.scm +++ b/gnu/services/base.scm @@ -62,8 +62,9 @@ (define-module (gnu services base) util-linux xfsprogs)) #:use-module (gnu packages bash) #:use-module ((gnu packages base) - #:select (coreutils glibc glibc-utf8-locales tar - canonical-package)) + #:select (coreutils glibc glibc/hurd + glibc-utf8-locales make-glibc-utf8-locales + tar canonical-package)) #:use-module ((gnu packages compression) #:select (gzip)) #:use-module (gnu packages fonts) #:autoload (gnu packages guile-xyz) (guile-netlink) @@ -87,6 +88,7 @@ (define-module (gnu services base) #:use-module ((guix self) #:select (make-config.scm)) #:use-module (guix diagnostics) #:use-module (guix i18n) + #:autoload (guix utils) (target-hurd?) #:use-module (srfi srfi-1) #:use-module (srfi srfi-26) #:use-module (srfi srfi-34) @@ -1831,6 +1833,12 @@ (define shepherd-discover-action (define (guix-shepherd-service config) "Return a for the Guix daemon service with CONFIG." + (define locales + (let-system (system target) + (if (target-hurd? (or target system)) + (make-glibc-utf8-locales glibc/hurd) + glibc-utf8-locales))) + (match-record config (guix build-group build-accounts authorize-key? authorized-keys use-substitutes? substitute-urls max-silent-time timeout @@ -1912,8 +1920,7 @@ (define (guix-shepherd-service config) ;; 'nss-certs'. See ;; . (string-append "GUIX_LOCPATH=" - #$glibc-utf8-locales - "/lib/locale") + #$locales "/lib/locale") "LC_ALL=en_US.utf8" ;; Make 'tar' and 'gzip' available so ;; that 'guix perform-download' can use