GHC Panic on OS X: Data.Binary.Get.runGet: Invalid magic number "INPUT(-l"
When building the latest
opencv-extra library on OS X I'm getting a GHC panic. To reproduce git clone https://github.com/LumiGuide/haskell-opencv, make sure Nix is installed and execute:
> nix-build -A haskellPackages.opencv-extra ... [11 of 11] Compiling OpenCV.Extra ( src/OpenCV/Extra.hs, dist/build/OpenCV/Extra.p_o ) ghc: panic! (the 'impossible' happened) (GHC version 8.6.3 for x86_64-apple-darwin): Data.Binary.Get.runGet at position 8: Invalid magic number "INPUT(-l" CallStack (from HasCallStack): error, called at libraries/binary/src/Data/Binary/Get.hs:351:5 in binary-0.8.6.0:Data.Binary.Get
The library builds successfully on Linux.
Minimal test case: https://github.com/basvandijk/macos-ghc863-panic