language-javascript icon indicating copy to clipboard operation
language-javascript copied to clipboard

0.7.1.0 Fails to build on macOS M1 using GHC 9.2.1

Open arafangion opened this issue 4 years ago • 3 comments

Just reporting that language-javascript seems to fail on macOS using the M1 architecture (Arm64), and I'm not sure how to make it pass:

bash-3.2$ locale
LANG="en_AU.UTF-8"
LC_COLLATE="en_AU.UTF-8"
LC_CTYPE="en_AU.UTF-8"
LC_MESSAGES="en_AU.UTF-8"
LC_MONETARY="en_AU.UTF-8"
LC_NUMERIC="en_AU.UTF-8"
LC_TIME="en_AU.UTF-8"
LC_ALL=
bash-3.2$ LC_ALL=en_AU.UTF-8 cabal install language-javascript
Resolving dependencies...
Build profile: -w ghc-9.2.1 -O1
In order, the following will be built (use -v for more details):
 - language-javascript-0.7.1.0 (lib) (requires build)
Starting     language-javascript-0.7.1.0 (lib)
Building     language-javascript-0.7.1.0 (lib)

Failed to build language-javascript-0.7.1.0.
Build log (
/Users/johnchapman/.cabal/logs/ghc-9.2.1/lngg-jvscrpt-0.7.1.0-62cfd969.log ):
Configuring library for language-javascript-0.7.1.0..
Warning: Packages using 'cabal-version: >= 1.10' and before 'cabal-version:
3.4' must specify the 'default-language' field for each component (e.g.
Haskell98 or Haskell2010). If a component uses different languages in
different modules then list the other ones in the 'other-languages' field.
Preprocessing library for language-javascript-0.7.1.0..
happy: src/Language/JavaScript/Parser/Grammar7.y: hGetContents: invalid argument (invalid byte sequence)
cabal: Failed to build language-javascript-0.7.1.0. See the build log above
for details.

bash-3.2$

arafangion avatar Nov 25 '21 08:11 arafangion

I ran into this same issue. Doing export LANG=C.UTF-8 made it work (in ubuntu-20.04.4 LTS).

Daniel-Diaz avatar Apr 21 '22 11:04 Daniel-Diaz

The sole unicode symbol in that file is ∉, which is used in a comment. Removing that character fixes the build on non-unicode locales.

joeyh avatar Mar 07 '23 19:03 joeyh

See also https://github.com/haskell/happy/issues/157

joeyh avatar Mar 07 '23 19:03 joeyh