Skip to content

executable with library and template haskell doesn't compile statically

See the attached program. Make sure to compile it under a cabal sandbox so that it picks up the static compilation options in cabal.config.

It doesn't compile, complaining about a missing dynamic (.so/.dll) library although everything should be static.

It does work if either

  • the static compilation options are left out of cabal.config and everything compiles dynamically, or
  • the tmp variable from Main.hs is removed, or
  • the staticth library import is removed from the executable (remove dependency in staticth.cabal and import statement from Main.hs).

If all 3 are present it doesn't compile.

Trac metadata
Trac field Value
Version 8.4.3
Type Bug
TypeOfFailure OtherFailure
Priority normal
Resolution Unresolved
Component Compiler
Test case
Differential revisions
BlockedBy
Related
Blocking
CC
Operating system
Architecture
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information