-
-
Notifications
You must be signed in to change notification settings - Fork 322
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
a configured locale is required to build hledger #420
Comments
Thanks for the report. It's very unfortunate, but any GHC-compiled haskell program encountering a non-ascii string, when there is no system locale configured, dies with unhelpful errors like this one. http://hledger.org/manual.html#troubleshooting and the man page BUGS sections mention this for users. As you point out, it can be an issue during installation too. I suppose we must have some non-ascii in the docs, and these are now embedded into the haskell code at compile time. I'm having trouble reproducing it though. I did unset LANG, stack clean, ./Shake.hs docs, stack build hledger without problem. |
Could you try stack --stack-yaml=stack-ghc8.yaml install hledger also. Perhaps GHC 8 will give a better error, revealing which tool it's coming from. |
Added --verbose to that, think I got something that might be useful, see About
Daniel [1] danielv@dvflair ~/private/local/hledger-orig master $ stack
2016-10-22 09:06:26.499409: [debug] Loading project config file -- While building package hledger-0.28 using: /home/danielv/.stack/setup-exe-cache/x86_64-linux/setup-Simple-Cabal-1.24.0.0-ghc-8.0.1 On Fri, Oct 21, 2016 at 1:50 AM, Simon Michael [email protected]
|
Those are great UX ideas for hledger, and I might have a wishlist issue open for it somewhere [nope, just a note]. For building hledger, those changes would need to be done in GHC and maybe other tools as well, right ? |
PS what can you tell from the verbose log ? Is the error coming from GHC ? |
@daniel-vainsencher did you ever figure out what was erroring ? Any idea what the resolution for this issue should be as far as hledger is concerned ? |
This is easily reproduced with Docker. Do
|
Thanks. This is a well known issue with haskell tools and applications built with GHC. Since hledger-install.sh is supposed to work around all known issues, I guess it should be setting LANG to something that can handle the hledger docs if it is unset. Like the Makefile does:
Maybe that syntax works in hledger-install.sh too ? |
Do we also need to explain this in the b2, b3 and c steps on the download page ? On the downside, whenever we try to document every possible breakage the instructions become huge and unreadable. |
@simonmichael I think it's best to fix this issue in the code itself, instead of trying to cover all possible ways stack/cabal could be called. The way to do this would be to simply Instead of the
replace the last line with
(Not tested, might open a PR after I get some desperately needed sleep...) AFAIK, this should fix all problems compiling with LANG=POSIX or similar. |
That sounds interesting. I have sometimes tried too hard to paper over tooling/ecosystem issues and regretted it; it can be more fragile and cost more than it's worth. Let us know if you try it. |
Before:
[danielv@dvflair hledger]$ stack install hledger hledger-ui hledger-web -j1
hledger-0.28: build
Progress: 0/34
-- While building package hledger-0.28 using:
/home/danielv/.stack/setup-exe-cache/x86_64-linux-ncurses6/setup-Simple-Cabal-1.22.5.0-ghc-7.10.3 --builddir=.stack-work/dist/x86_64-linux-ncurses6/Cabal-1.22.5.0 build lib:hledger exe:hledger --ghc-options " -ddump-hi -ddump-to-file"
Process exited with code: ExitFailure 1
Logs have been written to: /home/danielv/private/local/hledger/.stack-work/logs/hledger-0.28.log
After doing
export LANG=en_US.utf8
Building works just fine. Some utf requiring data in the docs, I presume?
I guess there is a general good reason to depend on the platform locale, but is it ever useful to hledger users specifically? if so, please give error messages that clarify the problem.
Want to back this issue? Post a bounty on it! We accept bounties via Bountysource.
The text was updated successfully, but these errors were encountered: