From mboxrd@z Thu Jan 1 00:00:00 1970 From: Giovanni Biscuolo Subject: bug#36076: Manual should clarify that glibc-utf8-locales is needed by default on foreign distros Date: Thu, 06 Jun 2019 11:03:48 +0200 Message-ID: <87imtjt79n.fsf@roquette.mug.biscuolo.net> References: <87o93ct006.fsf@roquette.mug.biscuolo.net> Mime-Version: 1.0 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha512; protocol="application/pgp-signature" Return-path: Received: from eggs.gnu.org ([209.51.188.92]:33629) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hYoKV-0006hJ-GM for bug-guix@gnu.org; Thu, 06 Jun 2019 05:05:04 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hYoKU-0001hl-15 for bug-guix@gnu.org; Thu, 06 Jun 2019 05:05:03 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:35409) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1hYoKT-0001hc-Tz for bug-guix@gnu.org; Thu, 06 Jun 2019 05:05:01 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1hYoKT-00007A-Kt for bug-guix@gnu.org; Thu, 06 Jun 2019 05:05:01 -0400 Sender: "Debbugs-submit" Resent-Message-ID: In-Reply-To: List-Id: Bug reports for GNU Guix List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-guix-bounces+gcggb-bug-guix=m.gmane.org@gnu.org Sender: "bug-Guix" To: Jack Hill Cc: 36076@debbugs.gnu.org --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Hello Jack, AFAIU you have found a bug, but not in the manual :-) The manual states that glibc-utf8-locales is an alternative to glibc-locales, limited to a few UTF-8 locales; this is how it should be. The issue is that glibc-locales package does not create symlinks to the "normalized codeset" like glibc-utf8-locales does (see below for details): **all* normalized codes like en_US.utf8 are missing. If I'm right we should change the issue subject to something like "glibc-locales does not generate normalized codesets", but I'm not used to debbugs so I'll let this part to others **if applicable** As a temporary (or permanent :-) ) workaround you could add this in the env of guix-daemon adding this line to "/etc/systemd/system/guix-daemon.service": =2D-8<---------------cut here---------------start------------->8--- Environment=3DLC_ALL=3Den_US.UTF-8 =2D-8<---------------cut here---------------end--------------->8--- You should also use en_US.UTF-8 instead of en_US.utf8 in your user env. Jack Hill writes: [...] >> --8<---------------cut here---------------start------------->8--- >> $ ls -lah /var/guix/profiles/per-user/giovanni/guix-profile/lib/locale/2= .28/ | grep en_US >> lrwxrwxrwx 33 root root 84 Jan 1 1970 en_US -> /gnu/store/acl2wxzzkk= cjv74rlqswdf9p8pwddlmk-glibc-locales-2.28/lib/locale/2.28/en_US >> lrwxrwxrwx 33 root root 94 Jan 1 1970 en_US.utf8 -> /gnu/store/94k5w= 17z54w25lgp90czdqfv9m4hwzhq-glibc-utf8-locales-2.28/lib/locale/2.28/en_US.u= tf8 >> dr-xr-xr-x 3 root root 4.0K Jan 1 1970 en_US.UTF-8 >> --8<---------------cut here---------------end--------------->8--- >> >> So AFAIU glibc-locales provides both en_US.UTF-8 and en_US.utf8 that is >> used by guix-daemon. > > That's not how I read the above lines. It looks like en_US.utf8 is a link= =20 > to the 94k5=E2=80=A6glib-utf8-locales-2.28 store item. You are right, I overlooked that: I removed glibc-utf8-locales from my user profile, I just have glibc-locales now: =2D-8<---------------cut here---------------start------------->8--- ~$ ls -lah /var/guix/profiles/per-user/giovanni/guix-profile/lib/locale/2.2= 8/ | grep en_US dr-xr-xr-x 3 root root 4.0K Jan 1 1970 en_US dr-xr-xr-x 3 root root 4.0K Jan 1 1970 en_US.UTF-8 =2D-8<---------------cut here---------------end--------------->8--- "en_US.utf8" is missing; that "incidentally" is also the default locale of my user, so: =2D-8<---------------cut here---------------start------------->8--- ~$ guix package -I guile: warning: failed to install locale =2D-8<---------------cut here---------------end--------------->8--- Setting "LANG=3Den_US.UTF-8" fixes the problem. In fact make-glibc-locales in base.scm "just" installs all locales in "not normalized codeset" with: =2D-8<---------------cut here---------------start------------->8--- [...] (replace 'build (lambda _ (invoke "make" "localedata/install-locales" "-j" (number->string (parallel-job-count))))) [...] =2D-8<---------------cut here---------------end--------------->8--- while make-glibc-utf8-locales generates a limited list locales via localede= f in "normalized codeset" and creates symlinks for "not normalized codeset" =2D-8<---------------cut here---------------start------------->8--- (for-each (lambda (locale) (define file ;; Use the "normalized codeset" by ;; default--e.g., "en_US.utf8". (string-append localedir "/" locale ".ut= f8")) (invoke "localedef" "--no-archive" "--prefix" localedir "-i" locale "-f" "UTF-8" file) ;; For backward compatibility with Guix ;; <=3D 0.8.3, add "xx_YY.UTF-8". (symlink (string-append locale ".utf8") (string-append localedir "/" locale ".UTF-8"))) ;; These are the locales commonly used for ;; tests---e.g., in Guile's i18n tests. '("de_DE" "el_GR" "en_US" "fr_FR" "tr_TR")) =2D-8<---------------cut here---------------end--------------->8--- I don't understand if "normalized codeset" are mandatory or facultative (see info guix "Locales"), but AFAIU are missing from the making of glibc localedata/install-locales; for sure they are used by default by a lot of users in their locale env, and in the default locale of guix-daemon. AFAIU one possible workaround is to write a patch that normalizes [1] all the codesets =2D-8<---------------cut here---------------start------------->8--- by applying the following rules: 1. Remove all characters besides numbers and letters. 2. Fold letters to lowercase. 3. If the same only contains digits prepend the string "iso". =2D-8<---------------cut here---------------end--------------->8--- and creates a symlink to not normalized ones An alternative could be to create share/locale/locale.alias with "normalized codes" aliases Sorry I'm still not able to propose such patch for make-glibc-locales. To deprecate "normalized codeset" is not an alternative IMHO HTH! Gio'. [...] [1] https://www.gnu.org/software/libc/manual/html_node/Using-gettextized-so= ftware.html#Using-gettextized-software =2D-=20 Giovanni Biscuolo Xelera IT Infrastructures --=-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAEBCgAdFiEERcxjuFJYydVfNLI5030Op87MORIFAlz41vQACgkQ030Op87M ORKBJg//ba4IV+TqE5JG/SoFXlpT8AXyXIHx+yrpBeY+UWx4mZPNKJo4FzduC8Eg He7qA4nTuDWwSxuNNmMT6bdWhRtjsFaLgriqMXD+0WNYTVZ3bT3DbfDY+JONW3Ld x5ik9O92CuFThUqKJhGZ3m1EuJt87IvGFzLFKor1scS9hUbC7xiKamDjrWHhSRkI pGM8SZQaCK6I91RV1t19weSLb9u/EVEY/MeuS/SrQpTEz2OzrQ+fHuBXz1W9O0yY 5Wz/ldXuQubd18mLrWE2BkfKju1osu6eoKmwBgOpG+UPaHxz6vtOMRJrKS/LjqN/ Cr+ZEt4+gkZGEoHYCeMjH6pce6dfxNsYsoG0dIfsSQYLpTx12k2qg86SkLY6711x LFW4ZymaYmdE545mHXIaSEZutcaMPRDuxWyALgEoWrpznuR7zwJaCzVdKscm3DNQ zCokGCZipld6cIdSoCfHaM8TuLpYCL5A5+pqgRQUlUeqV8yzZyTgjQZGQP3rpaB+ QID/OM0FmkN2O+npkybz5WjTak6RDfa1/l3Hhs1SZzfC0BTczqlFFGpC1KFZiam6 o8AeV/jJXDP+2AZ7/yxjl3DP0ihc0YksYwptky+85KkirRrTNkPDFY6v/h5bxaRn EASIPNjbEMe9rrgF0N0x2cl3qhJd9CWwSUMi4Mnum3+Nawho5Es= =ZM7Q -----END PGP SIGNATURE----- --=-=-=--