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
tmpvariable 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.