Haddock fails with "GHCi couldn't find the following symbol" message
Summary
Project successfully compiled with GHC 9.0.1; but building haddock fails with an apparent GHCi failure message
Steps to reproduce
Since the failure is during haddock, the easiest is to replicate would be to clone the project and try it yourself.
git clone https://github.com/LeventErkok/sbvPlugin.git
cd sbvPlugin
cabal new-haddock --haddock-option=--hyperlinked-source --haddock-option=--no-warnings
Pretty quickly, you get:
Resolving dependencies...
Build profile: -w ghc-9.0.1 -O1
In order, the following will be built (use -v for more details):
- sbvPlugin-9.0.1 (lib) (first run)
Configuring library for sbvPlugin-9.0.1..
Preprocessing library for sbvPlugin-9.0.1..
Running Haddock on library for sbvPlugin-9.0.1..
Warning: The documentation for the following packages are not installed. No
links will be generated to these packages: QuickCheck-2.14.2,
hashable-1.3.1.0, libBF-0.6.2, uniplate-1.6.13, unordered-containers-0.2.13.0,
random-1.2.0, sbv-8.13, splitmix-0.1.0.3, syb-0.7.2.1, async-2.2.3
Haddock coverage:
100% ( 6 / 6) in 'Data.SBV.Plugin.Data'
100% ( 11 / 11) in 'Data.SBV.Plugin'
haddock: ^^ Could not load '_sbvPluginzm9zi0zi1zminplace_DataziSBVziPluginziPlugin_plugin_closure', dependency unresolved. See top entry above.
GHC.Runtime.Linker.getHValue
During interactive linking, GHCi couldn't find the following symbol:
sbvPluginzm9zi0zi1zminplace_DataziSBVziPluginziPlugin_plugin_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 report this as a GHC bug:
https://www.haskell.org/ghc/reportabug
cabal: Failed to build documentation for sbvPlugin-9.0.1.
Expected behavior
Haddock documentation is produced
Environment
- GHC version used: 9.0.1 (Though I suspect earlier versions of GHC in the 8.10 series have the same problem.)
Optional:
- Operating System: Darwin
- System Architecture: Mac OSX