Skip to content
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

glibcLocales: cleaner environment handling #4320

Closed
wants to merge 1 commit into from

Conversation

wmertens
Copy link
Contributor

A continuation/re-imagining of #4318, trying to make it cleaner.

  • make pkgs attribute null on unsupported Darwin platform
  • add setup hook to provide much-duplicated environment variable

This way, builds should find the locale archive when they add pkgs.glibcLocales to buildInputs.

My only problem is that I wasn't able to test this on Linux yet. On Darwin it works fine, since it just removes everything 😁. I mocked the glibcLocales build and it did create the proper setup-hook with the correct path.

- make pkgs attribute null on unsupported Darwin platform
- add setup hook to provide much-duplicated environment variable
@7c6f434c
Copy link
Member

Merged some part of it manually. What would be a good regular expression to grep for for the rest of NixPkgs?

@wmertens
Copy link
Contributor Author

@7c6f434c just git grep LOCALE_ARCHIVE or git grep glibcLocales should do the trick. I think everything that's on master now is properly shielded to eval only on Linux. I wonder if I should change those remaining usages, they're mostly in build helpers etc so will cause massive rebuild and I can't test some of them (e.g. Haskell).

@7c6f434c
Copy link
Member

@7c6f434c just git grep LOCALE_ARCHIVE or git grep glibcLocales should do the trick. I think everything that's on master now is properly shielded to eval only on Linux. I wonder if I should change those remaining usages, they're mostly in build helpers etc so will cause massive rebuild and I can't test some of them (e.g. Haskell).

Maybe these could be updated together with the normal updates of such
expressions then.

I don't like mass rebuilds, either.

@peti
Copy link
Member

peti commented Jan 21, 2015

The Haskell uses glibcLocales on Linux only.

@@ -5001,7 +5001,8 @@ let
installLocales = config.glibc.locales or false;
};

glibcLocales = callPackage ../development/libraries/glibc/2.19/locales.nix { };
# Not supported on Darwin
glibcLocales = if (! stdenv.isDarwin) then (callPackage ../development/libraries/glibc/2.19/locales.nix { }) else null;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's better to say if stdenv.isLinux then .../locales.nix else null.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@edolstra I was under the impression that glibc locales were supported everywhere but on Darwin - wrong?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We only use glibc on Linux.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

okidoki, done in fc8048d and e0ec38d 😊.

@vcunat
Copy link
Member

vcunat commented Jan 21, 2015

I wonder how you plan to get locales in darwin libc (in future). If such things should be handled purely, i.e. compiling them from Apple-provided sources, then we might better have a general libcLocales or something. Of course, using system-provided libc and locales might be easiest...

@domenkozar
Copy link
Member

This is now partially upstream: we have locales package only for Linux.

What is missing is the setupHook, I think it's a good addition save some typing on each package. I propose we make a separate commit to add that and remove redundant exports in packages.

@7c6f434c
Copy link
Member

This seems to have died…

@7c6f434c 7c6f434c closed this Mar 18, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

8 participants