Skip to content

Compiling pandoc: ghc: panic! (the 'impossible' happened)

Summary

GHC fails with the message ghc: panic! (the 'impossible' happened)

The relevant portion of the log follows below.

Steps to reproduce

Install Pandoc from source using Homebrew on macOS 10.11.6 El Capitan.

brew install -s pandoc

or

cabal v1-install --jobs=4 --max-backjumps=100000 --prefix=/usr/local/Cellar/pandoc/2.7.2

Expected behavior

Compile and install Pandoc.

Environment

  • GHC version used:

8.6.5

Optional:

  • Operating System: macOS 10.11.6 El Capitan

  • System Architecture: iMac (27-inch, Late 2012), 3.2 GHz Intel Core i5, 24 GB 1600 MHz DDR3

Details

The complete failed build log is available at:

https://gist.github.com/sjackman/d36d85952bbe89a8116b3ddc752e081f https://gist.github.com/sjackman/d36d85952bbe89a8116b3ddc752e081f/raw/a41548c8c8628cccfcbebf1a6de349a058d50d08/05.cabal

The relevant snippet:

[125 of 149] Compiling Text.Pandoc.Readers.Org ( src/Text/Pandoc/Readers/Org.hs, dist/dist-sandbox-d0b5f27a/build/Text/Pandoc/Readers/Org.o )
[126 of 149] Compiling Text.Pandoc.Readers.HTML ( src/Text/Pandoc/Readers/HTML.hs, dist/dist-sandbox-d0b5f27a/build/Text/Pandoc/Readers/HTML.o )
ghc: panic! (the 'impossible' happened)
  (GHC version 8.6.5 for x86_64-apple-darwin):
	applyTypeToArgs
  Expression: maximum_$smaximum1
                (build
                   @ Int
                   (\ (@ b1_a5AA)
                      (c_a5AB [OS=OneShot] :: Int -> b1_a5AA -> b1_a5AA)
                      (n_a5AC [OS=OneShot] :: b1_a5AA) ->
                      foldr
                        @ [Blocks]
                        @ b1_a5AA
                        (mapFB @ Int @ b1_a5AA @ [Blocks] c_a5AB (length @ Blocks))
                        n_a5AC
cabal: Leaving directory '.'
cabal: Error: some packages failed to install:
pandoc-2.7.2-BuLovjPjQtDCQ5YWlxlHmB failed during the building phase. The
exception was:
ExitFailure (-11)
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information