language-python
language-python copied to clipboard
'stack build' fails with a GHC panic !?
$ stack build
ghc: panic! (the 'impossible' happened)
(GHC version 8.2.2 for x86_64-apple-darwin):
Prelude.chr: bad argument: 1543503875
Please report this as a GHC bug: http://www.haskell.org/ghc/reportabug
-- While building simple Setup.hs (scroll up to its section to see the error) using:
/Users/marco/.stack/programs/x86_64-osx/ghc-8.2.2/bin/ghc-8.2.2 -rtsopts -threaded -clear-package-db -global-package-db -hide-all-packages -package base -main-is StackSetupShim.mainOverride -package Cabal-2.0.1.0 /Users/marco/.stack/setup-exe-src/setup-mPHDZzAJ.hs /Users/marco/.stack/setup-exe-src/setup-shim-mPHDZzAJ.hs -o /Users/marco/.stack/setup-exe-cache/x86_64-osx/tmp-Cabal-simple_mPHDZzAJ_2.0.1.0_ghc-8.2.2
Process exited with code: ExitFailure 1
Strangely, I'm able to import and use this library in a project, but unable to build it standalone.
I'm guessing this is due to stack not handling build-tools correctly (making GHC choke on an unrecognized token, which could only be from an Alex .x or Happy .y file) , since 'cabal build' works as expected.
Update : this seems to be specific to GHC 8.2, since bumping the Stackage LTS version to 19.12 (== GHC 9.0.2) makes the problem disappear.