unofficial mirror of bug-guix@gnu.org 
 help / color / mirror / code / Atom feed
From: "Ludovic Courtès" <ludo@gnu.org>
To: Adam Griffiths <adam.lw.griffiths@gmail.com>
Cc: 43039-done@debbugs.gnu.org
Subject: bug#43039: Vanilla GUIX 1.1.0 reconfigure fails on nss-certs
Date: Wed, 02 Sep 2020 17:21:28 +0200	[thread overview]
Message-ID: <87d034432f.fsf@gnu.org> (raw)
In-Reply-To: <CAFgA=J6bETsaRYBNX9_GRqfGuRPeDezqScq0VZdYY3aAdz6MPA@mail.gmail.com> (Adam Griffiths's message of "Sat, 29 Aug 2020 13:10:00 +1000")

Hi Adam,

Adam Griffiths <adam.lw.griffiths@gmail.com> skribis:

>> > $ sudo guix system reconfigure /etc/config.scm
>> > <sudo warning snipped>
>> > guile: warning: failed to install locale
>> > hint: Consider installing the `glibc-utf8-locales' or `glibc-locales'
>> > package and defining
>> > `GUIX_LOCPATH', along these lines:
>> >
>> >      guix package -i glibc-utf8-locales
>> >      export GUIX_LOCPATH="$HOME/.guix-profile/lib/locale"
>> >
>> > See the "Application Setup" section in the manual, for more info.
>> >
>> > guix system: warning: cannot determine provenance for current system
>> > substitute: updating substitutes from 'https://ci.guix.gnu.org'... 100.0%
>>
>> That, I don’t understand.  I tried to reproduce it by downloading
>> <https://ftp.gnu.org/gnu/guix/guix-system-vm-image-1.1.0.x86_64-linux.xz>
>> (which is essentially the result of installing Guix System from 1.1.0).
>> I ran ‘guix pull’ (which took a lot of time…) and then ‘guix system
>> reconfigure’.  ‘guix system reconfigure’ would only emit the one-liner:
>>
>>   warning: failed to install locale
>>
>> and not the hint about GUIX_LOCPATH, and then it just went ahead.
>>
>> What locale does your system use?  You can type “env | grep LC_” to see.
>>
>
> I'm using en_AU

[...]

>> (The ‘guix’ command provided by ‘guix pull’ comes with
>> ‘glibc-utf8-locales’ since commit
>> ba48895899a117d6ace2209c3f54411a4a989133, but the locale you’re using
>> could be missing from that.)
>>
>> > downloading from
>> > https://ci.guix.gnu.org/nar/lzip/0llx3y194278l5ksr4xh9kc64mh8nn8d-nss-certs-3.52.1
>> > ...
>> >  nss-certs-3.52.1  133KiB                                    186KiB/s 00:00
>> > [########          ]  48.3%
>> > Backtrace:
>> >            3 (apply-smob/1 #<catch-closure 7f10d4c80120>)
>> > In ice-9/boot-9.scm:
>> >     705:2  2 (call-with-prompt _ _ #<procedure default-prompt-handle?>)
>> > In ice-9/eval.scm:
>> >     619:8  1 (_ #(#(#<directory (guile-user) 7f10d490e140>)))
>> > In guix/ui.scm:
>> >   1936:12  0 (run-guix-command _ . _)
>> >
>> > guix/ui.scm:1936:12: In procedure run-guix-command:
>> > Throw to key `encoding-error' with args `("scm_to_stringn" "cannot convert
>> > wide string to output locale" 84 #f #f)'.
>> > substitution of
>> > /gnu/store/0llx3y194278l5ksr4xh9kc64mh8nn8d-nss-certs-3.52.1 failed
>>
>> This is really puzzling: guix-daemon is always running in a valid UTF-8
>> locale, as can be seen like this:

Not quite true; I understand what was going on, details below.

The workaround for you in the meantime is to run:

  guix build nss-certs --no-substitutes

before you run ‘sudo guix system reconfigure’.


The client ‘guix system’ in this case was running in the “C” locale
because “en_AU.utf8” is not among the locales in ‘glibc-utf8-locales’,
which is what’s bundled with ‘guix’.

Thus, ‘set-build-options’ in (guix store) would send “C” as the “locale”
property.  Then, ‘guix substitute’ would do (setlocale LC_ALL "C"), from
this code:

  ;; Attempt to install the client's locale, mostly so that messages are
  ;; suitably translated.
  (match (or (find-daemon-option "untrusted-locale")
             (find-daemon-option "locale"))
    (#f     #f)
    (locale (false-if-exception (setlocale LC_ALL locale))))

Consequently, it would run in a ASCII locale and would thus fail to
decode non-ASCII file names that appear in nss-certs.

Similar problems could occur anytime someone runs a client in a
non-UTF-8 locale.  One way to reproduce it for me is this (I use
‘time-machine’ to get a version of ‘nss-certs’ not already available on
my disk):

--8<---------------cut here---------------start------------->8---
$ LC_ALL=C guix time-machine --commit=8aeef3c7bdf278003892e608842200d3a35211c7 -- build nss-certs 
Updating channel 'guix' from Git repository at 'https://git.savannah.gnu.org/git/guix.git'...
0.1 MB will be downloaded:
   /gnu/store/igklwlj1j60kdgrhcn6m2p2iqp87qrrs-nss-certs-3.52
substituting /gnu/store/igklwlj1j60kdgrhcn6m2p2iqp87qrrs-nss-certs-3.52...
downloading from https://ci.guix.gnu.org/nar/lzip/igklwlj1j60kdgrhcn6m2p2iqp87qrrs-nss-certs-3.52 ...
 nss-certs-3.52  133KiB                                                   1.9MiB/s 00:00 [########          ]  48.3%Backtrace:
In ice-9/boot-9.scm:
  1736:10  4 (with-exception-handler _ _ #:unwind? _ # _)
In unknown file:
           3 (apply-smob/0 #<thunk 7fd27a60c200>)
In ice-9/boot-9.scm:
    718:2  2 (call-with-prompt _ _ #<procedure default-prompt-handle?>)
In ice-9/eval.scm:
    619:8  1 (_ #(#(#<directory (guile-user) 7fd27a230f00>)))
In guix/ui.scm:
  2046:12  0 (run-guix-command _ . _)

guix/ui.scm:2046:12: In procedure run-guix-command:
Throw to key `encoding-error' with args `("scm_to_stringn" "cannot convert wide string to output locale" 84 #f #f)'.
substitution of /gnu/store/igklwlj1j60kdgrhcn6m2p2iqp87qrrs-nss-certs-3.52 failed
guix build: error: some substitutes for the outputs of derivation `/gnu/store/mzrh9ad4sqqg88ym9c1x1vv2lqjyxbrv-nss-certs-3.52.drv' failed (usually happens due to networking issues); try `--fallback' to build derivation from source 
--8<---------------cut here---------------end--------------->8---

This is fixed by commit 739f6309478d8ab8501bb653ceb2f634c8560f55, with
two additional improvements:

  fe4e770fc1 ui: Attempt to fall back to "en_US.utf8" rather than "C".
  739f630947 store: 'set-build-options' sends LC_MESSAGES, not LC_ALL.
  aba8def46d substitute: Set LC_MESSAGES to the client's locale, not LC_ALL.

I’ll update the ‘guix’ package so that the changes to ‘guix substitute’
take effect.

Thanks again for reporting the issue!

Ludo’.




  reply	other threads:[~2020-09-02 15:22 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-08-25 10:43 bug#43039: Vanilla GUIX 1.1.0 reconfigure fails on nss-certs Adam Griffiths
2020-08-27  1:21 ` conjaroy
2020-08-28 14:05 ` Ludovic Courtès
2020-08-29  3:10   ` Adam Griffiths
2020-09-02 15:21     ` Ludovic Courtès [this message]
     [not found] ` <handler.43039.D43039.159906009821340.notifdone@debbugs.gnu.org>
2020-09-02 23:57   ` bug#43039: closed (Re: bug#43039: Vanilla GUIX 1.1.0 reconfigure fails on nss-certs) Adam Griffiths

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=87d034432f.fsf@gnu.org \
    --to=ludo@gnu.org \
    --cc=43039-done@debbugs.gnu.org \
    --cc=adam.lw.griffiths@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).