erikd / language-javascript

Parser for JavaScript, in Haskell
BSD 3-Clause "New" or "Revised" License
160 stars 47 forks source link

'invalid byte sequence' error when installing the package #111

Closed mrakgr closed 4 years ago

mrakgr commented 4 years ago
c:\purescript>stack build
language-javascript> configure
language-javascript> Configuring language-javascript-0.7.0.0...
language-javascript> build
language-javascript> Preprocessing library for language-javascript-0.7.0.0..
language-javascript> happy.exe: src\Language\JavaScript\Parser\Grammar7.y: hGetContents: invalid argument (invalid byte sequence)

--  While building package language-javascript-0.7.0.0 using:
      C:\Users\Marko\AppData\Roaming\stack\setup-exe-cache\x86_64-windows\Cabal-simple_Z6RU0evB_2.4.0.1_ghc-8.6.5.exe --builddir=.stack-work\dist\e626a42b build --ghc-options " -fdiagnostics-color=always"
    Process exited with code: ExitFailure 1
Progress 1/2

This is towards the end of the Purescript compiler build, but it happens to me when I try doing stack install language-javascript-0.7.0.0 on a completely fresh project as well.

For all I know, this error might be Windows 10 related. I've been running into crazy stack errors since yesterday and Haskell tooling is completely broken for me.

Any ideas why this could be happening?

erikd commented 4 years ago

This is a windows text encoding problem. I don't use Windows, but its my understanding that there is a windows specific way around this.

stack should be setting up the correct environment when it is building this package.

mrakgr commented 4 years ago

You are right. I actually figured it out myself just now. On a whim I changed my locale from Japanese to US and that managed to get the package install to go through. Thanks.

AaronM04 commented 4 years ago

I also see this issue on OpenBSD.

Update: putting LANG=en_US.UTF-8 in front of the cabal install command fixed my issue. 🎉