Skip to content

ghc: panic when building latest purescript version on Raspberry Pi 4

Summary

When trying to build purescript 0.13.5 with stack 2.1.3 and ghc 8.6.3 it throws a ghc: panic! (the 'impossible' happened) error message.

Steps to reproduce

  • be on a Raspberry Pi 4B
  • download latest purescript source code
  • have ghc 8.6.3 and stack 2.1.3 in PATH
  • add line use-system-ghc: true to ~/.stack/config.yaml (else it will try to use ghc 8.6.4 or 8.6.5 and not find a bindist for the Raspberry Pi 4B)
  • run make build

Expected behavior

make, ghc and stack build purescript and finish with exit code 0.

Environment

  • GHC version used: 8.6.3 (since 8.6.4 and 8.6.5 don't have a bindist for Raspberry Pi 4B)

Optional:

  • Device: Raspberry Pi 4B
  • Operating System: Raspbian Buster (PRETTY_NAME="Raspbian GNU/Linux 10 (buster)")
  • System Architecture: armv7, armv7l or armhf (shows as different name depending on which tool is asked)
  • npm 6.13 and nodejs 12.13.0 are installed. Not sure if this is relevant.

Output of uname -a is Linux rp4 4.19.75-v7l+ #1270 SMP Tue Sep 24 18:51:41 BST 2019 armv7l GNU/Linux

Error log

output of make build:

[...]
Building all executables for `purescript' once. After a successful build of all of them, only specified executables will be rebuilt.
purescript                       > configure (lib + exe)
Configuring purescript-0.13.5...
purescript                       > build (lib + exe)
Preprocessing library for purescript-0.13.5..
Building library for purescript-0.13.5..
[  1 of 163] Compiling Control.Monad.Logger
[  2 of 163] Compiling Control.Monad.Supply
[  3 of 163] Compiling Control.Monad.Supply.Class
[  4 of 163] Compiling Language.PureScript.Comments
[  5 of 163] Compiling Language.PureScript.AST.SourcePos
...
[149 of 163] Compiling Language.PureScript.Ide.Reexports
[150 of 163] Compiling Language.PureScript.Ide.State
[151 of 163] Compiling Language.PureScript.Ide.Watcher
[152 of 163] Compiling Language.PureScript.Ide.Usage
[153 of 163] Compiling Language.PureScript.Ide.CaseSplit
[154 of 163] Compiling Language.PureScript.Ide.Rebuild
[155 of 163] Compiling Language.PureScript.Ide.Matcher
ghc: panic! (the 'impossible' happened)
  (GHC version 8.6.3 for arm-unknown-linux):
        tyThingTyCon
  Identifier ‘$tc'CondcommentEndToken2’
  Call stack:
      CallStack (from HasCallStack):
        callStackDoc, called at compiler/utils/Outputable.hs:1160:37 in ghc:Outputable
        pprPanic, called at compiler/main/HscTypes.hs:2165:28 in ghc:HscTypes

Please report this as a GHC bug:  http://www.haskell.org/ghc/reportabug
Edited by Nico Wawrzyniak
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information