all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Mathieu Othacehe <othacehe@gnu.org>
To: Leo Famulari <leo@famulari.name>
Cc: 52831@debbugs.gnu.org
Subject: bug#52831: [installer] Locale problems with nss-certs
Date: Wed, 29 Dec 2021 18:26:05 +0100	[thread overview]
Message-ID: <878rw3l3v6.fsf@gnu.org> (raw)
In-Reply-To: <YcoZfztDWn8a7cYJ@jasmine.lan> (Leo Famulari's message of "Mon, 27 Dec 2021 14:52:31 -0500")


Hello Leo,

> While testing the Guix System installer, I noticed that installation of
> nss-certs has some problems that seem related to locales.

What locale did you pick in the installer?

I think the issue lies in the (gnu installer utils) module, run-command
procedure:

--8<---------------cut here---------------start------------->8---
  (when locale
    (let ((supported? (false-if-exception
                       (setlocale LC_ALL locale))))
      ;; If LOCALE is not supported, then set LANGUAGE, which might at
      ;; least give us translated messages.
      (if supported?
          (setenv "LC_ALL" locale)
          (setenv "LANGUAGE"
                  (string-take locale
                               (or (string-index locale #\_)
                                   (string-length locale)))))))
--8<---------------cut here---------------end--------------->8---

If you pick a locale such as en_AG.utf8 which is not supported by the
glibc-utf8-locales package, then supported? is #f, which means that
LC_ALL is never set.

The following patch fixes it for me.

--8<---------------cut here---------------start------------->8---
diff --git a/gnu/installer/utils.scm b/gnu/installer/utils.scm
index bb97bc5560..d745996a3a 100644
--- a/gnu/installer/utils.scm
+++ b/gnu/installer/utils.scm
@@ -97,10 +97,12 @@ (define (pause)
       ;; least give us translated messages.
       (if supported?
           (setenv "LC_ALL" locale)
-          (setenv "LANGUAGE"
-                  (string-take locale
-                               (or (string-index locale #\_)
-                                   (string-length locale)))))))
+          (begin
+            (setlocale LC_ALL "en_US.utf8")
+            (setenv "LANGUAGE"
+                    (string-take locale
+                                 (or (string-index locale #\_)
+                                     (string-length locale))))))))
 
   (guard (c ((invoke-error? c)
              (newline)
--8<---------------cut here---------------end--------------->8---

WDYT?

Thanks,

Mathieu




  reply	other threads:[~2021-12-29 17:27 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-12-27 19:52 bug#52831: [installer] Locale problems with nss-certs Leo Famulari
2021-12-29 17:26 ` Mathieu Othacehe [this message]
2021-12-29 18:47   ` Leo Famulari
2021-12-29 22:02     ` Mathieu Othacehe
2021-12-30  0:11       ` Leo Famulari
2021-12-30  9:37         ` Mathieu Othacehe
2021-12-30 11:21           ` Mathieu Othacehe
2021-12-30 18:11             ` Leo Famulari
2021-12-30 19:34               ` Mathieu Othacehe

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

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=878rw3l3v6.fsf@gnu.org \
    --to=othacehe@gnu.org \
    --cc=52831@debbugs.gnu.org \
    --cc=leo@famulari.name \
    /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 external index

	https://git.savannah.gnu.org/cgit/guix.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.