[Nix-dev] Re: perl: warning: Setting locale failed.

Ludovic Courtès ludo at gnu.org
Sun May 31 14:49:02 CEST 2009


Saluton!  ;-)

Lluís Batlle <viriketo at gmail.com> writes:

> Since the stdenv merge, I think, you have to explicitly install your locales.
> In nixos, you can add in your configuration:
>   environment = {
>     extraPackages = [ pkgs.glibcLocales ];
>   }

Hmm, right.

> Further then, the locale system expects the locale archive (where all
> the locales are compiled) in the path pointed by the env var
> LOCALE_ARCHIVE (Nix-only feature of glibc). In my .bashrc I have:
> export LOCALE_ARCHIVE=/var/run/current-system/sw/lib/locale/locale-archive

But strangely enough:

--8<---------------cut here---------------start------------->8---
$ du -ms /var/run/current-system/sw/lib/locale/locale-archive
77      /var/run/current-system/sw/lib/locale/locale-archive

$ LOCALE_ARCHIVE=/var/run/current-system/sw/lib/locale/locale-archive locale -a
C
POSIX
--8<---------------cut here---------------end--------------->8---

And:

--8<---------------cut here---------------start------------->8---
$ guile
Guile Scheme interpreter 0.5 on Guile 1.9.0
Copyright (C) 2001-2008 Free Software Foundation, Inc.

Enter `,help' for help.
scheme@(guile-user)> (setlocale LC_ALL "ru_RU")
$1 = "ru_RU"
scheme@(guile-user)> (setlocale LC_ALL "fr_BE")
$2 = "fr_BE"
scheme@(guile-user)> (setlocale LC_ALL "ca_ES")
$3 = "ca_ES"
--8<---------------cut here---------------end--------------->8---

which basically shows that setlocale(3) succeeds with all these locales
that locale(1) doesn't even see.

What am I missing?

> Btw, I vote for adding that export line into the boot stage 2 script,
> if the file exists. And I vote for having the glibcLocales package
> installed *by default*.

I agree (but I think it should still be easy to disable it).

Thanks,
Ludo'.




More information about the nix-dev mailing list