-
Notifications
You must be signed in to change notification settings - Fork 440
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
Set the stream locale to "C" locally #724
Conversation
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? |
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. |
Same thing:
|
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. |
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. |
a793333
to
d2aed19
Compare
This still seems worth fixing. I've rebased to master and made some adjustments to the test, see master...johnbartholomew:jsonnet:sbarzowski-fix-locale-dependence |
Re: the test failure on Mac (#724 (comment)), it might be this? https://stackoverflow.com/a/58385001 Anyway, I think it can/should be avoided by just defining a custom locale facet for the test. |
So that even if there is a global locale set by the library user, Jsonnet output is still the same.
As this PR has been open for a long time (4+ years), I'll just go ahead and rebase and merge this (with a few adjustments/additions) |
d2aed19
to
63ad7f6
Compare
This adds it to the 'all' target and also (more importantly) adds it to the list of files that are removed by 'make clean'
…fmt (google#724) * Gracefully handle encountered regular expression when running jsonnetfmt, adding tests. * Do not validate verbatim strings. * Also do not validate string blocks. * Change golden prefix for formatter tests to fmt.golden to be consistant with cpp version.
So that even if there is a global locale
set by the library user, Jsonnet output
is still the same.