Closed imeckler closed 10 years ago
Looks like there's an issue with the current directory and Template Haskell. What version of cabal and GHC are you using?
This looks like an encoding issue. In Linux, I can reproduce the error with:
env LC_CTYPE=latin1 cabal build
What is your OS? Further investigation will likely be OS-specific (unfortunately I don't have a Windows system around to test it right now).
Ghc version: 7.6.3 Cabal:
cabal-install version 1.18.0.1
using version 1.18.1 of the Cabal library
/etc/lsb-release:
DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=11.10
DISTRIB_CODENAME=oneiric
DISTRIB_DESCRIPTION="Ubuntu 11.10"
LC_CTYPE
isn't set in my environment.
LC_CTYPE
isn't set in my environment.
Then it is probably LANG
which specifies it. Here I have...
$ printenv | grep UTF-8
LANG=en_US.UTF-8
...and this...
$ env LANG=en.US.latin1 cabal build
...reproduces the error as well.
Strange, I have LANG=en_US.UTF-8
in my env.
In ghci:
Prelude System.IO> openFile "src/Graphics/UI/jquery.js" ReadMode >>= hGetContents >>= putStr
[elided output]
,e.browser.version=z.version),e.browser.webkit&&(e.browser.safari=!0),j.test("*** Exception: src/Graphics/UI/jquery.js: hGetContents: invalid argument (invalid byte sequence)
I should add that reading the contents of a few other files worked fine. I'm going to try replacing the file with jQuery downloaded directly from their site. (EDIT: That did nothing).
It worked when I manually set the encoding on the handle as follows:
Prelude System.IO> h <- openFile "src/Graphics/UI/jquery.js" ReadMode
Prelude System.IO> hSetEncoding h utf8
Not sure why my system locale is set incorrectly. Thanks though.
Does the latest commit on the development branch help?
It didn't, but I fixed my locale issues by running
locale-gen en_US en_US.UTF-8
dpkg-reconfigure locales
and threepenny built successfully afterward.
I'm not certain about how well my experiment reproduces the original issue; in any case, env LANG=en_US.latin1 cabal build
now works.
@duplode Ok, so the source level fix works to some extend. Thanks!
I get the following compilation failure when building both from the latest version on github and the latest hackage version: