From mboxrd@z Thu Jan 1 00:00:00 1970 From: Meiyo Peng Subject: bug#35671: 'glibc-utf8-locales' should include C.UTF-8 locale Date: Tue, 14 May 2019 10:10:51 +0800 Message-ID: <87a7fp23bo.fsf@riseup.net> References: <877eayz2x0.fsf@inria.fr> <87o946ozj3.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Return-path: Received: from eggs.gnu.org ([209.51.188.92]:60016) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hQMvI-0000nv-Vv for bug-guix@gnu.org; Mon, 13 May 2019 22:12:10 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hQMvH-0003o6-5x for bug-guix@gnu.org; Mon, 13 May 2019 22:12:08 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:33245) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1hQMvC-0003j2-L2 for bug-guix@gnu.org; Mon, 13 May 2019 22:12:05 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1hQMvC-00064X-Fu for bug-guix@gnu.org; Mon, 13 May 2019 22:12:02 -0400 Sender: "Debbugs-submit" Resent-Message-ID: In-reply-to: <87o946ozj3.fsf@gnu.org> 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: Ludovic =?UTF-8?Q?Court=C3=A8s?= Cc: 35671@debbugs.gnu.org Hi Ludovic, Ludovic Court=C3=A8s writes: > But anyway, I think we should just set =E2=80=9CLC_ALL=3Den_US.utf8=E2=80= =9D in the > .service file: that=E2=80=99s what we do on Guix System, and the choice o= f a > locale doesn=E2=80=99t matter since =E2=80=98guix substitute=E2=80=99 hon= ors the client=E2=80=99s > locale. That's what I did to my guix-daemon.service and guix-publish.service files on a foreign distro after getting locale warnings. > Meiyo Peng skribis: > >> Ludovic Court=C3=A8s writes: > > [...] > >>> Thus, I think =E2=80=98glibc-utf8-locales=E2=80=99 should provide that = locale. >> >> And the zh_CN.UTF-8, zh_TW.UTF-8 please. > > =E2=80=98glibc-utf8-locales=E2=80=99 has always been described as an *arb= itrary* sample > of UTF-8 locales (info "(guix) Application Setup"). Initially its main > purpose was to use it in build processes, but we=E2=80=99ve come to more = or less > recommend it for users, which is not great because we know it only works > for some users. I was surprised last week (maybe the week before that) when I found out that glibc-utf8-locales only provides locales for de_DE, el_GR, en_US, fr_FR, tr_TR. And in our manual, we tell people to install glibc-utf8-locales after installing Guix on a foreign distro in order to solve locale problems. The name "glibc-utf8-locales" indicates it provides ALL UTF-8 locales while in fact it does not. This caused me a trouble because I have to set the locale of Emacs to zh_CN.UTF-8 in order to enable the ibus input method in Emacs. (This is a known problem of Emacs. Locale has to be set to one of CJK locale in order to enable external input methods.) Since the zh_CN.UTF-8 locale is not in $GUIX_LOCPATH, ibus does not work in Emacs. I ended up installing the "glibc-locales" package and solved the problem. > I built a =E2=80=98glibc-utf8-locales=E2=80=99 package that provides all = the supported > UTF-8 locales, and only UTF-8 locales: > > --8<---------------cut here---------------start------------->8--- > $ guix size /gnu/store/rh7iq1kwma7ir96mvzvqcg1v50yi05yp-glibc-utf8-locale= s-2.28 > store item total = self > /gnu/store/rh7iq1kwma7ir96mvzvqcg1v50yi05yp-glibc-utf8-locales-2.28 855= .7 855.7 100.0% > total: 855.7 MiB > $ ls -1d /gnu/store/rh7iq1kwma7ir96mvzvqcg1v50yi05yp-glibc-utf8-locales-2= .28/lib/locale/2.28/*.utf8 |wc -l > 312 > $ guix size glibc-locales > store item total = self > /gnu/store/acl2wxzzkkcjv74rlqswdf9p8pwddlmk-glibc-locales-2.28 916.7 = 916.7 100.0% > total: 916.7 MiB > --8<---------------cut here---------------end--------------->8--- > > As you can see, it=E2=80=99s almost the same size as =E2=80=98glibc-local= es=E2=80=99, so there=E2=80=99s > no point in having such a =E2=80=98glibc-utf8-locales=E2=80=99 package. > > In Guix System, the (gnu system locale) module generates just the needed > locales. I=E2=80=99m thinking we should do the same at the =E2=80=98guix= package=E2=80=99 > level. For example, =E2=80=98guix package --install-locales=E2=80=99 wou= ld > automatically install whatever $LANG or $LC_* refers to. > > Thoughts? I think it would be better to simply tell people to install the "glibc-locales" package. There may be a case where different applications are set to different locales. For example, my system is set to the en_US.UTF-8 locale but my Emacs is set to the zh_CN.UTF-8 locale. So $LC_* only refers to en_US.UTF-8 if guix tries to detect the locale. If =E2=80=98guix package --install-locales=E2=80=99 only install w= hat $LANG or $LC_* refers to, zh_CN.UTF-8 won't be installed for me. We are unable to detect what locales a user will need later. Installing a full package like "glibc-locales" or letting the user explicitly specify what locales they need can avoid a lot of special problems. -- Meiyo Peng https://www.pengmeiyu.com/