Ticket #187 (new defect)
With TH, when doing "cabal haddock", GHCi "couldn't find symbol"
|Reported by:||MikolajKonarski||Owned by:|
This is a copy of the ticket http://hackage.haskell.org/trac/hackage/ticket/898, I've filed for Cabal. I include the whole ticket text below.
GHC 7.2.1, Cabal HEAD, Haddock 2.9.2. The message
During interactive linking, GHCi couldn't find the following symbol: Allurezm0zi4zi2_UtilsziMultiline_multiline_closure
How to reproduce: get package http://hackage.haskell.org/package/Allure-0.4.2, cabal install, cabal haddock --executables and you should get the following:
Running Haddock for Allure-0.4.2... Warning: The documentation for the following packages are not installed. No links will be generated to these packages: ConfigFile-1.1.1, HUnit-18.104.22.168, MissingH-22.214.171.124, ffi-1.0, rts-1.0, cairo-0.12.1, deepseq-126.96.36.199, gio-0.12.1, glib-0.12.1, gtk-0.12.1, hslogger-1.1.5, mtl-188.8.131.52, network-184.108.40.206, pango-0.12.1, parsec-3.1.2, random-220.127.116.11, regex-base-0.93.2, regex-compat-0.95.1, regex-posix-0.95.1, text-0.11.1.6, transformers-0.2.2.0, zlib-0.5.3.1 Preprocessing executable 'BotAllure' for Allure-0.4.2... haddock coverage for dist/build/tmp-28531/src/Bot.hs: 0/3 0% Warning: Main: could not find link destinations for: System.Random.StdGen Documentation created: dist/doc/html/Allure/BotAllure/index.html Preprocessing executable 'Allure' for Allure-0.4.2... haddock coverage for dist/build/autogen/Paths_Allure.hs: 0/4 0% haddock coverage for dist/build/tmp-28531/src/Utils/File.hs: 0/3 0% haddock coverage for dist/build/tmp-28531/src/Frequency.hs: 0/6 0% haddock coverage for dist/build/tmp-28531/src/Strategy.hs: 1/7 14% haddock coverage for dist/build/tmp-28531/src/Content/Content.hs: 0/2 0% haddock coverage for dist/build/tmp-28531/src/Utils/Multiline.hs: 1/2 50% During interactive linking, GHCi couldn't find the following symbol: Allurezm0zi4zi2_UtilsziMultiline_multiline_closure This may be due to you not asking GHCi to load extra object files, archives or DLLs needed by your current session. Restart GHCi, specifying the missing library using the -L/path/to/object/dir and -lmissinglibname flags, or simply by naming the relevant files on the GHCi command line. Alternatively, this link failure might indicate a bug in GHCi. If you suspect the latter, please send a bug report to: firstname.lastname@example.org
The same problem for a library, with or without executables, with the same code. Hiding, in the library, the offending module Multiline does not help. The only thing that helps is eta-expanding the Multiline code as follows:
-multiline = TQ.QuasiQuoter (TH.litE . TH.stringL) undefined undefined undefined +multiline = TQ.QuasiQuoter (\x -> (TH.litE . TH.stringL) x) undefined undefined undefined
and _not_ using the function in the only place where it's used.