-
Notifications
You must be signed in to change notification settings - Fork 45
All file reading and writing explicitly uses UTF-8 #20
Conversation
@rtfeldman If you could build this branch on your VM and test if it fixes the issue that would be very helpful! |
Nice, I like this a lot! I have two main questions:
I ask 2 because I believe reading and writing to disk is one of the slowest parts of building a project right now. I don't have good numbers on this, but I am vaguely concerned that a small change could mess with compile times. Separate from this issue, it may be time to start setting up some proper profiling so we can assess this. |
My hypothesis is that the difference will be unmeasurable. |
And keep in mind that I've only made the reading of *.elm files strict. The reading of object files, and more importantly the writing of the final output are still lazy. The lazy output might be important if you are compiling a giant Elm program, where the output .js is several megabytes. But other than that I don't think it matter either way. |
Unfortunately my personal bandwidth is extremely limited between now and the end of mloc...I realistically won't have time to test this out until after the conference. Sorry about that! |
LGTM, thank you! |
For future reference, confirmed that we ran the new version successfully on our CI server without setting environment variables. Thanks @laszlopandy! |
Whoo, thanks @laszlopandy, and thanks @rtfeldman for confirmation! |
Changes two things:
hGetContents: invalid argument (invalid byte sequence)
,Bad encoding; the file must be valid UTF-8
People share Elm files on GitHub, and elsewhere. So even if you have a strange system using a strange locale, we should still use UTF-8 everywhere to avoid compatibility issues.
I believe this will fix elm/compiler#914, however I could not reproduce the bug on my machine so I cannot say for sure. More testing is needed with a custom build of this branch.