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

Set the stream locale to "C" locally #724

Open
wants to merge 2 commits into
base: master
from

Conversation

@sbarzowski
Copy link
Collaborator

sbarzowski commented Oct 30, 2019

So that even if there is a global locale
set by the library user, Jsonnet output
is still the same.

So that even if there is a global locale
set by the library user, Jsonnet output
is still the same.
@googlebot googlebot added the cla: yes label Oct 30, 2019
@sbarzowski
Copy link
Collaborator Author

sbarzowski commented Oct 30, 2019

Fixes #722.

It makes sense to add a regression test and check that we don't have the same problem in other places. Perhaps we can have a helper function to create stringstreams and clear the locale?

@sparkprime
Copy link
Member

sparkprime commented Dec 10, 2019

The test failed on mac gcc. It looked like a legitimate failure with the locale stuff but I didn't understand the error. I ran it again anyway, just in case.

@sparkprime
Copy link
Member

sparkprime commented Dec 10, 2019

Same thing:

terminate called after throwing an instance of 'std::runtime_error'
  what():  locale::facet::_S_create_c_locale name not valid
@sparkprime
Copy link
Member

sparkprime commented Dec 12, 2019

My guess would be that it needs some packaged installed to get the right locale files. However I'm not sure why it works on clang but not gcc? Maybe they use different standard libraries and the clang library bundles it.

@sbarzowski
Copy link
Collaborator Author

sbarzowski commented Dec 17, 2019

I tried getting to the bottom of this again, but I'm still very confused. One idea that I haven't checked yet is that the locale is just not there, but clang-compiled-version falls back to something "gracefully" and gcc-compiled-version crashes.

@sbarzowski sbarzowski force-pushed the sbarzowski:fix-locale-dependence branch from a793333 to d2aed19 Feb 2, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

3 participants
You can’t perform that action at this time.