Panic: Loading temp shared object failed
I ran into a panic when updating
singletons for 7.10. I'm clueless as to what's going on here, so sorry for not minimizing the test case. A little testing has me convinced it's Template Haskell in some way.
> git clone http://github.com/goldfirere/singletons.git > cd singletons > git checkout ghc-loading-panic-test-case > cabal update > cabal install --only-dependencies > cabal configure > cabal build > cat dist/build/autogen/cabal_macros.h # copy the value for CURRENT_PACKAGE_KEY from the end of cabal_macros.h > cd tests/compile-and-dump > ghc -c -this-package-key <package key from cabal_macros.h> -i../../dist/build -XTemplateHaskell Singletons/Maybe.hs
You will see something like
ghc: panic! (the 'impossible' happened) (GHC version 18.104.22.16850123 for x86_64-apple-darwin): Loading temp shared object failed: dlopen(/var/folders/ps/s45r2x1s6r15ws78py_zypl00000gn/T/ghc45837_0/libghc45837_1.dylib, 5): Symbol not found: _mtlzuJNaGzzEkFfL43R3LZZNRlPRm_ControlziMonadziReaderziClass_DZCMonadReader_con_info Referenced from: /var/folders/ps/s45r2x1s6r15ws78py_zypl00000gn/T/ghc45837_0/libghc45837_1.dylib Expected in: flat namespace in /var/folders/ps/s45r2x1s6r15ws78py_zypl00000gn/T/ghc45837_0/libghc45837_1.dylib Please report this as a GHC bug: http://www.haskell.org/ghc/reportabug
I've observed this on a Mac, but Travis has the same problem, so it's not strictly Mac-specific. You can see representative Travis output here.
Why am I doing such a crazy thing? It's part of the
singletons test suite, where it's important to test the output of a run of ghc with
-ddump-splices. Getting the test cases to compile against the built-but-not-yet-installed
singletons object files should work with
-this-package-key. I'm sure there's a better way to structure a testsuite, but this general technique works (with
-package-name instead of
-this-package-key) with 7.8.
|Operating system||MacOS X|