all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: ludo@gnu.org (Ludovic Courtès)
To: Mark H Weaver <mhw@netris.org>
Cc: guix-devel@gnu.org
Subject: Re: Locale of build environments
Date: Sun, 01 Mar 2015 17:48:49 +0100	[thread overview]
Message-ID: <877fv0br4e.fsf@gnu.org> (raw)
In-Reply-To: <87385rsaqz.fsf@gnu.org> ("Ludovic \=\?utf-8\?Q\?Court\=C3\=A8s\=22'\?\= \=\?utf-8\?Q\?s\?\= message of "Fri, 27 Feb 2015 15:13:40 +0100")

ludo@gnu.org (Ludovic Courtès) skribis:

> Besides, commit e8c9f04 is interesting: ‘substitute*’ will now break
> non-UTF-8 files by defaults (replacing invalid UTF-8 sequences with
> question marks in the output.)

Based on that observation, commit dd0a8ef forced the ‘patch-*’
procedures to treat files as if they were ISO-8859-1–i.e., leaving their
byte sequence uninterpreted, and thus avoiding multibyte sequence
decoding errors.

Then, as Mark suggested, commit 4db8716 forces strict encoding/decoding
errors.

The problem then is that we’re getting things like
<http://hydra.gnu.org/build/263170/nixlog/1/raw>:

--8<---------------cut here---------------start------------->8---
phase `unpack' succeeded after 0 seconds
starting phase `patch-usr-bin-file'
patch-/usr/bin/file: ./configure: changing `/usr/bin/file' to `/gnu/store/a31g38iykai59jqmcwknxyjddc5zxm9b-file-5.22/bin/file'
patch-/usr/bin/file: ./configure: changing `/usr/bin/file' to `/gnu/store/a31g38iykai59jqmcwknxyjddc5zxm9b-file-5.22/bin/file'
patch-/usr/bin/file: ./configure: changing `/usr/bin/file' to `/gnu/store/a31g38iykai59jqmcwknxyjddc5zxm9b-file-5.22/bin/file'
patch-/usr/bin/file: ./configure: changing `/usr/bin/file' to `/gnu/store/a31g38iykai59jqmcwknxyjddc5zxm9b-file-5.22/bin/file'
patch-/usr/bin/file: ./configure: changing `/usr/bin/file' to `/gnu/store/a31g38iykai59jqmcwknxyjddc5zxm9b-file-5.22/bin/file'
patch-/usr/bin/file: ./configure: changing `/usr/bin/file' to `/gnu/store/a31g38iykai59jqmcwknxyjddc5zxm9b-file-5.22/bin/file'
patch-/usr/bin/file: ./configure: changing `/usr/bin/file' to `/gnu/store/a31g38iykai59jqmcwknxyjddc5zxm9b-file-5.22/bin/file'
patch-/usr/bin/file: ./configure: changing `/usr/bin/file' to `/gnu/store/a31g38iykai59jqmcwknxyjddc5zxm9b-file-5.22/bin/file'
patch-/usr/bin/file: ./configure: changing `/usr/bin/file' to `/gnu/store/a31g38iykai59jqmcwknxyjddc5zxm9b-file-5.22/bin/file'
Backtrace:

[...]

 745: 10 [patch-/usr/bin/file "./configure" #:file-command ...]
In ice-9/boot-9.scm:
 171: 9 [with-throw-handler #t ...]
 867: 8 [call-with-input-file "./configure" ...]
In /gnu/store/wcrp88qjv5bfhwcsxhbiqfh29da8pg81-module-import/guix/build/utils.scm:
 474: 7 [#<procedure 1998e80 at /gnu/store/wcrp88qjv5bfhwcsxhbiqfh29da8pg81-module-import/guix/build/utils.scm:473:10 (in)> #<input: ./configure 11>]
 500: 6 [#<procedure 1a092c0 at /gnu/store/wcrp88qjv5bfhwcsxhbiqfh29da8pg81-module-import/guix/build/utils.scm:496:6 (in out)> #<input: ./configure 11> ...]
In srfi/srfi-1.scm:
 465: 5 [fold #<procedure 17b41c0 at /gnu/store/wcrp88qjv5bfhwcsxhbiqfh29da8pg81-module-import/guix/build/utils.scm:500:32 (r+p line)> ...]
In /gnu/store/wcrp88qjv5bfhwcsxhbiqfh29da8pg81-module-import/guix/build/utils.scm:
 503: 4 [#<procedure 17b41c0 at /gnu/store/wcrp88qjv5bfhwcsxhbiqfh29da8pg81-module-import/guix/build/utils.scm:500:32 (r+p line)> # ...]
In ice-9/regex.scm:
 189: 3 [list-matches # ...]
 176: 2 [fold-matches # ...]
In unknown file:
   ?: 1 [regexp-exec # ...]
In ice-9/boot-9.scm:
 106: 0 [#<procedure 1998ec0 at ice-9/boot-9.scm:97:6 (thrown-k . args)> encoding-error ...]

ice-9/boot-9.scm:106:20: In procedure #<procedure 1998ec0 at ice-9/boot-9.scm:97:6 (thrown-k . args)>:
ice-9/boot-9.scm:106:20: Throw to key `encoding-error' with args `("scm_to_stringn" "cannot convert narrow string to output locale" 84 #f #f)'.
--8<---------------cut here---------------end--------------->8---

The failure here occurs when using ‘guile-final’ (which has full iconv
support.)  When it stumbles upon the © sign in ‘configure’, it reads it,
with ‘read-line’, as the sequence #\302 #\251.

However, when passing that line back to ‘regexp-exec’, ‘regex-exec’
calls ‘scm_to_locale_string’ on it, which fails with the error above:
this is because, in this build, we’re running on the C locale and #\302
aka. #\Â cannot be represented in ASCII (the encoding of the C locale.)

To solve that problem, commit 87c8b92 makes UTF-8 locales available
right after ‘guile-final’ is built.  That way, calls to
‘scm_to_locale_string’ actually convert to UTF-8, which always work.

(Note that the bootstrap Guile doesn’t have this problem because it uses
UTF-8 for everything and ignores locale settings.)

Hopefully we can enable full builds of ‘core-updates’ very soon now.

Ludo’.

  reply	other threads:[~2015-03-01 16:49 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-02-10 20:14 CA certificates Andreas Enge
2015-02-12 16:44 ` Andreas Enge
2015-02-12 17:26 ` Mark H Weaver
2015-02-12 19:48   ` Andreas Enge
2015-02-12 20:20   ` Locale of build environments Ludovic Courtès
2015-02-12 20:28     ` Andreas Enge
2015-02-15  0:12     ` Mark H Weaver
2015-02-26 23:16     ` Ludovic Courtès
2015-02-26 23:45       ` Mark H Weaver
2015-02-27 10:36         ` Ludovic Courtès
2015-02-27 14:13           ` Ludovic Courtès
2015-03-01 16:48             ` Ludovic Courtès [this message]
2015-02-13  7:28   ` CA certificates Mark H Weaver
2015-02-13 10:23     ` Andreas Enge
2015-02-12 20:30 ` Ludovic Courtès

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=877fv0br4e.fsf@gnu.org \
    --to=ludo@gnu.org \
    --cc=guix-devel@gnu.org \
    --cc=mhw@netris.org \
    /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.