From mboxrd@z Thu Jan 1 00:00:00 1970 From: Wiktor =?utf-8?Q?=C5=BBelazny?= Subject: Locales in a Guix container (somewhat related to r-readr)? Date: Thu, 20 Feb 2020 16:39:34 +0100 Message-ID: <20200220153934.uqftcxvs4wv25bbh@wzguix> Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="piyeffq7j24wpkon" Return-path: Received: from eggs.gnu.org ([2001:470:142:3::10]:50712) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1j4nxy-0005or-Cy for help-guix@gnu.org; Thu, 20 Feb 2020 10:42:19 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1j4nxw-0002Au-Jz for help-guix@gnu.org; Thu, 20 Feb 2020 10:42:18 -0500 Received: from freeshell.de ([2a01:360:106::2]:47170) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1j4nxw-00027Y-DN for help-guix@gnu.org; Thu, 20 Feb 2020 10:42:16 -0500 Content-Disposition: inline List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-guix-bounces+gcggh-help-guix=m.gmane-mx.org@gnu.org Sender: "Help-Guix" To: help-guix@gnu.org --piyeffq7j24wpkon Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Dear list, I don=E2=80=99t know if it=E2=80=99s some recent change in the Guix behavio= r, but I noticed that I=E2=80=99m getting no utf-8 locales in a container. I discove= red it while reading a utf-8 csv file using readr::read_csv(). Outside of a container, I can do this: ~$ echo $LC_ALL ~$ LC_ALL=3D"en_US.utf8" ~$ echo $LC_ALL en_US.utf8 But inside: ~$ guix environment -C --pure ~ [env]$ echo $LC_ALL ~ [env]$ LC_ALL=3D"en_US.utf8" sh: warning: setlocale: LC_ALL: cannot change locale (en_US.utf8): No su= ch file or directory ~ [env]$ exit exit Naively adding a locales input does not help: ~$ guix environment -C --pure --ad-hoc glibc-utf8-locales substitute: updating substitutes from 'https://ci.guix.gnu.org'... 100.0% The following derivation will be built: /gnu/store/h68sy9r0zhkwv5iqmdhd4wrgflnjb6fk-profile.drv The following profile hooks will be built: /gnu/store/dcnhapdj613zrfjk683sqzyg49psdcya-ca-certificate-bundle.drv /gnu/store/g64qmp941a4jf0qdm7zxfcb965gvgr44-fonts-dir.drv /gnu/store/hi07h3l1rsgkmjhykx9pxw01ywl8vmyk-manual-database.drv /gnu/store/k504y06y3pgav5hi6b5vzmy1wqlgq452-info-dir.drv building CA certificate bundle... building fonts directory... building directory of Info manuals... building database for manual pages... building /gnu/store/h68sy9r0zhkwv5iqmdhd4wrgflnjb6fk-profile.drv... ~ [env]$ echo $LC_ALL ~ [env]$ LC_ALL=3D"en_US.utf8" sh: warning: setlocale: LC_ALL: cannot change locale (en_US.utf8): No su= ch file or directory Similarly as in the bug #39665, a solution, inspired by [1], comes with a hack: ~ [env]$ export GUIX_LOCPATH=3D/gnu/store/$(ls -F /gnu/store | grep glib= c-utf8-locales.*/ | tail -n 1)lib/locale ~ [env]$ LC_ALL=3Den_US.utf8 (for some reason, this has to be issued twice; the first time it throws an error). With this, at least readr::read_csv() seems to work as expected. Are locales intentionally set to =E2=80=9CC=E2=80=9D in a container by defa= ult (or are they unset, perhaps)? I guess so, and consequently, I=E2=80=99m not treating this as a bug. But I would like to ask: Is there an official, elegant way to get utf-8 locales in a container? W=C5=BB [1]: https://github.com/pjotrp/guix-notes --piyeffq7j24wpkon Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQKTBAABCgB9FiEEvcl0zdnJun12Glc9xzWoxqtgedUFAl5OqDZfFIAAAAAALgAo aXNzdWVyLWZwckBub3RhdGlvbnMub3BlbnBncC5maWZ0aGhvcnNlbWFuLm5ldEJE Qzk3NENERDlDOUJBN0Q3NjFBNTczREM3MzVBOEM2QUI2MDc5RDUACgkQxzWoxqtg edWcQw//e3qoonLcB2WTgLAOO8ae3QE+Zfnn3aLMCjKb/c7CK8H3RRapoP1TNQLP gxg0bm6gxSESCf2CmbpksCkPjSFB1gmHPxPm6CsjpA/AwD03XOiRAzUPiOYUcwC3 4fVjpZivt5dWJmLwGlqGY4DfyNf8vk52vbjPj1b7pi+DiBZnqxT1j1IBKlICOBEX +4/Qx658oClhg+LTQztFnPJbuFWmzrYmoIrl2zshwNbUMpOpKqqGoBZl0Io3bpyN vMrcfJN5MRdPLqHaEXF8+bDMzBu419wfbn5vaMhtFnmtaHn4Q2xgWswCsfx3r4GQ xbSj5wC7He92UJOlS4mHgO5l4j7x2ykQWZhMKHjli6vpz9Ts8/z9au5FDeruDZ/0 msOtZJn2zEqTy1lFOUgTzWVbmSpDK/7Ka9K1/Gpb1CkDEwifoF7mT8ILOBHdEgdL M/LLssJPGpYNzP5L+sDSrQwK9O3850KfK3Gc/37SYYnmT3X8qVAtKlnSa281nDU0 L68Mn/uTIFjburB5E44ldEjKrDC7BDwFSm23AgtEbTnlgPzUq0uXRe0CGYKXuvN6 p0klULezYNO0kVPSAmm4gbKn/Ehhdtl/b51qNDaChlwIdphfsX8G3qNQ6LuF5Mio /b+d/0Nxjr91Dq1ASlfhcPdJElTDzNYP3CYZsGVzxGlAhCKjpTg= =G7pL -----END PGP SIGNATURE----- --piyeffq7j24wpkon--