ghcjs / ghcjs

Haskell to JavaScript compiler, based on GHC

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

error while running ghcjs-boot

vu3rdd opened this issue · comments

While running the boot steps provided in the readme after installing emsdk and sourcing the environment shell script, I was hit by this error:

installing package bytestring
configuring package: bytestring
/home/ram/src/ghcjs/lib/boot/pkg/bytestring$ /home/ram/.ghcup/bin/cabal "v1-configure" "--global" "--ghcjs" "--builddir" "dist" "--with-compiler" "/home/ram/src/ghcjs/inplace/bin/ghcjs" "--with-hc-pkg" "/home/ram/src/ghcjs/inplace/bin/ghcjs-pkg" "--with-haddock" "/home/ram/src/ghcjs/inplace/bin/haddock" "--with-gcc" "/home/ram/src/ghcjs/inplace/lib/bin/emcc" "--prefix" "/home/ram/src/ghcjs/inplace" "--configure-option" "--host=js-unknown-ghcjs" "--ghcjs-options=-fwrite-ide-info" "--enable-debug-info" "--disable-library-stripping" "--disable-executable-stripping" "-fghci" "--enable-profiling" "--enable-shared"
Warning: Unknown/unsupported 'ghc' version detected (Cabal 3.6.2.0 supports
'ghc' version < 8.8): /home/ram/src/ghcjs/inplace/bin/ghcjs is based on GHC
version 8.10.7
Resolving dependencies...
Configuring bytestring-0.10.12.0...
/home/ram/src/ghcjs/lib/boot/pkg/bytestring$ /home/ram/.ghcup/bin/cabal "v1-build"
Preprocessing library for bytestring-0.10.12.0..
Building library for bytestring-0.10.12.0..
[ 1 of 23] Compiling Data.ByteString.Builder.Prim.Internal ( Data/ByteString/Builder/Prim/Internal.hs, dist/build/Data/ByteString/Builder/Prim/Internal.js_o, dist/build/Data/ByteString/Builder/Prim/Internal.js_dyn_o )
[ 2 of 23] Compiling Data.ByteString.Builder.Prim.Internal.Floating ( Data/ByteString/Builder/Prim/Internal/Floating.hs, dist/build/Data/ByteString/Builder/Prim/Internal/Floating.js_o, dist/build/Data/ByteString/Builder/Prim/Internal/Floating.js_dyn_o )
[ 3 of 23] Compiling Data.ByteString.Builder.Prim.Internal.UncheckedShifts ( Data/ByteString/Builder/Prim/Internal/UncheckedShifts.hs, dist/build/Data/ByteString/Builder/Prim/Internal/UncheckedShifts.js_o, dist/build/Data/ByteString/Builder/Prim/Internal/UncheckedShifts.js_dyn_o )
[ 4 of 23] Compiling Data.ByteString.Builder.Prim.Binary ( Data/ByteString/Builder/Prim/Binary.hs, dist/build/Data/ByteString/Builder/Prim/Binary.js_o, dist/build/Data/ByteString/Builder/Prim/Binary.js_dyn_o )
[ 5 of 23] Compiling Data.ByteString.Internal ( Data/ByteString/Internal.hs, dist/build/Data/ByteString/Internal.js_o, dist/build/Data/ByteString/Internal.js_dyn_o )

<no location info>: error:
    ghcjs: panic! (the 'impossible' happened)
  (GHC version 8.10.7:
	getClassPredTys
  forall a b.
  Product f_a6Li g_a6Lj (a, b)
  -> (# Product f_a6Li g_a6Lj a, Product f_a6Li g_a6Lj b #)
  Call stack:
      CallStack (from HasCallStack):
        callStackDoc, called at ghc/compiler/utils/Outputable.hs:1179:37 in ghcjs-8.10.7-5fadc091902643d5e752d5dbb14bc0567c1b42524d78475c307681acd331c9cf:Outputable
        pprPanic, called at ghc/compiler/basicTypes/Predicate.hs:89:29 in ghcjs-8.10.7-5fadc091902643d5e752d5dbb14bc0567c1b42524d78475c307681acd331c9cf:Predicate

Please report this as a GHC bug:  https://www.haskell.org/ghc/reportabug

fatal: program /home/ram/.ghcup/bin/cabal returned a nonzero exit code

Are there any patches to be applied or any work arounds?

Re-running the build command, the error vanished. I wonder why it is flaky!