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

'stack build' fails with a GHC panic !?

Open ocramz opened this issue 3 years ago • 3 comments

$ 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

ocramz avatar Jun 20 '22 05:06 ocramz

Strangely, I'm able to import and use this library in a project, but unable to build it standalone.

ocramz avatar Jun 20 '22 06:06 ocramz

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.

ocramz avatar Jun 20 '22 12:06 ocramz

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.

ocramz avatar Jun 22 '22 01:06 ocramz