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

elixir: Fix locale problem on NixOS #30064

Merged
merged 1 commit into from
Oct 4, 2017
Merged

elixir: Fix locale problem on NixOS #30064

merged 1 commit into from
Oct 4, 2017

Conversation

gleber
Copy link
Contributor

@gleber gleber commented Oct 3, 2017

It looks like Erlang/OTP requires access to LOCALE_ARCHIVE for locales to correctly work. Elixir depends on this here:
https://github.com/elixir-lang/elixir/blob/7a556b8f26f42f6b7510dc1d2351564d91ab746c/lib/elixir/src/elixir.erl#L76

Fixes #30047

Things done
  • Tested using sandboxing (nix.useSandbox on NixOS, or option build-use-sandbox in nix.conf on non-NixOS)
  • Built on platform(s)
  • Tested via one or more NixOS test(s) if existing and applicable for the change (look inside nixos/tests)
  • Tested compilation of all pkgs that depend on this change using nix-shell -p nox --run "nox-review wip"
  • Tested execution of all binary files (usually in ./result/bin/)
  • Fits CONTRIBUTING.md.

@gleber
Copy link
Contributor Author

gleber commented Oct 3, 2017

/cc @ankhers @LnL7 for review

@@ -22,6 +22,7 @@ in

buildInputs = [ erlang rebar makeWrapper ];

LOCALE_ARCHIVE = "${pkgs.glibcLocales}/lib/locale/locale-archive";
Copy link
Member

Choose a reason for hiding this comment

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

glibcLocales is linux only

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Any ideas on a solution which would work both on Linux and on Mac osx?

Copy link
Member

Choose a reason for hiding this comment

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

I don't think it's necessary there

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Build without this line: http://ix.io/AHh
Build with this line: http://ix.io/AHl

It definitely removes the warnings. I also inserted calls to locale in preBuild step and without this line the locale command were printout out warnings too. Can you suggest an alternative solution to get rid of the warnings?

Copy link
Member

Choose a reason for hiding this comment

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

You can make add conditionally depending on the platform using stdenv.isLinux.

Copy link
Member

Choose a reason for hiding this comment

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

@gleber sorry for the confusion, I was just suggesting to make it conditional with eg. stdenv.lib.optionalString stdenv.isLinux to avoid breaking the darwin build

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done!

@gleber
Copy link
Contributor Author

gleber commented Oct 4, 2017 via email

It looks like Erlang/OTP requires access to LOCALE_ARCHIVE for locales to correctly work. Elixir depends on this here:
https://github.com/elixir-lang/elixir/blob/7a556b8f26f42f6b7510dc1d2351564d91ab746c/lib/elixir/src/elixir.erl#L76

Fixes NixOS#30047
@gleber
Copy link
Contributor Author

gleber commented Oct 4, 2017

Please take another look

@LnL7 LnL7 merged commit 18d2119 into NixOS:master Oct 4, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants