[Nix-dev] Boost and Locale issues

Lluís Batlle i Rossell viriketo at gmail.com
Fri Mar 25 10:31:15 CET 2011


On Thu, Mar 24, 2011 at 10:15:28PM -0400, roconnor at theorem.ca wrote:
> I've almost completed a package for bitcoin, but I'm having a locale issue
> 
> $ result/bin/bitcoin
> terminate called after throwing an instance of 'std::runtime_error'
>   what():  locale::facet::_S_create_c_locale name not valid
> Aborted
> 
> However the programs run correctly in an environment where LANG=C or
> LC_ALL=C.
> 
> I *think* this is a boost related issue.
> 
> I can probably work around this by wrapping the executable to set
> the environment beforehand, but I'd rather fix the actual problem
> rather than hiding it.  This might mean patching boost?
> 
> Anyhow, I know next to nothing about locale issues and absolutely
> nothing about how locale issues interact with NixOS.  Any tips?

The glibc offers two kind of filesystem places for locale information. Raw
locale files (text files, difficult to process, with somehow higher load time)
and the locale archive (some kind of binary compiled archive, different for each
glibc and even architecture, I imagine).

In NixOS we only have the 2nd kind of file. Both kinds of locale storage should
be totally transparent through the glibc API, but maybe Boost wants to do
something 'beyond' the glibc API, and thus fails.

Or maybe our patches for the archive to work do not cover completely the glibc
locale API, and we see a sympthom of this only through boost.

So, we have the issue open; I've even not done an 'strace -e open'; if someone
can bring some light on this (maybe through mentioning simple programs using
the boost locale API), it would be great.

> viric claims that freecad has the same problem.

Right. I start it with LANG=C.

Regards,
Lluís.



More information about the nix-dev mailing list