-
-
Notifications
You must be signed in to change notification settings - Fork 15.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
glibc: C.UTF-8 locales #54485
glibc: C.UTF-8 locales #54485
Conversation
@@ -0,0 +1,3236 @@ | |||
C.utf-8 locales from https://salsa.debian.org/glibc-team/glibc/blob/49767c9f7de4828220b691b29de0baf60d8a54ec/debian/patches/localedata/locale-C.diff | |||
--- /dev/null | |||
+++ b/localedata/locales/C |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe I can outsource this rather large file.
Since fetchpatch
is not available while stdenv bootstrapping maybe fetchurl works.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fetchurl
certainly does work. All sources are fetched that way even during bootstrapping.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah. I just switched over.
This pull request has been mentioned on Nix community. There might be relevant details there: https://discourse.nixos.org/t/nixos-19-03-feature-freeze/1950/3 |
Since we now install a sane default this should be no longer necessary. If it is still needed, it should be easy enough to do this in an overlay.
Does this mean we can also get rid of glibcLocales? |
No, many people want something else instead of the |
@matthewbauer inside of nixpkgs we can get rid of |
@GrahamcOfBorg build glibc |
LGTM 👍 |
Next step is to activate this in our stdenv. |
Right, that sounds like a relatively safe change, too. |
I was running
|
Thanks. I think it's a good change, but please don't merge changes to fundamental parts like |
@ivegotasthma: I'm not sure what got wrong, but the resulting commit b7ad5e9 evaluates fine for me. |
I'm of the opinion this will resolve NixOS/nix#318 & #20192, right? |
Only the first step. An |
- make it easy to switch python 2/3 - add glibcLocales dep (not sure it is still required after NixOS#54485 but manual is also used by users of Nixpkgs versions <19.03) - use `mkShell` - use `libffi`, as it is required for Python3 `cryptography` (in my setup it worked with Python2 without this dep) - set PYTHONPATH. Either this or `source venv/bin/activate` was missing. Closes NixOS#46909
@cw789 yes, but we also need it on macOS. I looked into that. The package is built in Then we can set |
I'm using nixpkgs on a non nixos operating system and having various problems due to locales (including crashes using boost::filesystem). My workaround is to undo part of this PR and enable all locales by commenting out the I know I could set LOCALE_ARCHIVE=... but that's impure and makes things flaky when e.g. running jobs that don't source my bashrc. Happy to open a separate issue to track the idea. |
@cdyson37 we never had all locales enabled in glibc. There is an extra package called |
Okay - I don't know how things were before :) But I'd like to be able to run applications that depend on locales without having to set an environment variable. I don't mind having to compile everything as I have to do that anyway. Perhaps we could introduce an option to the glibc derivation? I'm happy to have a go, might need some advice on writing a test for it though. |
Apps that "Depend on locales" is pretty rare. Usually they just depend on just one locale, or perhaps just UTF-8 support. Where this usually becomes an issue is when the locale-archive on the host system is a different version than the Glibc version we are using. Otherwise detection by Glibc should be automatic. |
In your case I'd use a |
In this case (at least) you'd have to wrap every program that used
#include <boost/filesystem.hpp>
int main ()
{
boost::filesystem::unique_path ("/somewhere"); // does not need to exist
} Then
Note that unsetting Backtrace:
It's a bit worrying that setting |
Throwing such an exception seems a correct way to handle unusable |
Some background here: https://www.boost.org/doc/libs/1_70_0/libs/filesystem/doc/reference.html Search for "POSIX concerns". |
Motivation for this change
This makes it possible to switch from C to C.utf-8 locales in stdenv and our glibc package as many applications now expect unicode locales (i.e. python). Debian and Fedora are already on board with this. Also systemd has now support for this.
Current status: works!
cc @FRidh
Things done
sandbox
innix.conf
on non-NixOS)nix-shell -p nox --run "nox-review wip"
./result/bin/
)nix path-info -S
before and after)