I am in the process of writing a Cabal-install replacement for compiling my own projects (available for peeks on Github if you are curious), and have almost made it fully operational but for one detail : when generating documentation for separate packages, Haddock doesn't seem to be able to find the HTML destinations of other packages, even though it does read the interface files generated by said other packages.
Here is the call that my build system makes to Haddock, and its accompanying output :
haddock --read-interface=/usr/share/doc/ghc/html/libraries/base-4.6.0.1/base.haddock --read-interface=/usr/share/doc/ghc/html/libraries/ghc-prim-0.3.0.0/ghc-prim.haddock --title=vector-0.10.9.1 --source-module=/home/murray/World/%{FILE} -o /home/murray/.world/doc -h --use-contents=/home/murray/.world/doc/index.html --use-index=/home/murray/.world/doc/doc-index.html --optghc=-hide-all-packages --optghc=-package-name --optghc=vector-0.10.9.1 --optghc=-package-id --optghc=world-main --optghc=-optP--include=.build/deps/macros.h --optghc=-I.build/pool --optghc=-i/home/murray/.world/obj --optghc=-package --optghc=base --optghc=-package --optghc=ghc-prim --optghc=-ipackages/vector/0.10.9.1/source --optghc=-XCPP --optghc=-XDeriveDataTypeable --read-interface=file:///home/murray/.world/doc,/home/murray/.world/doc/primitive-0.5.2.1.haddock --read-interface=file:///home/murray/.world/doc,/home/murray/.world/doc/deepseq-1.3.0.2.haddock --read-interface=file:///home/murray/.world/doc,/home/murray/.world/doc/array-0.5.0.0.haddock -D/home/murray/.world/doc/vector-0.10.9.1.haddock .build/pool/Data/Vector/Storable.hs .build/pool/Data/Vector/Generic.hs .build/pool/Data/Vector/Generic/Base.hs .build/pool/Data/Vector/Generic/Mutable.hs .build/pool/Data/Vector/Fusion/Stream.hs .build/pool/Data/Vector/Fusion/Stream/Size.hs .build/pool/Data/Vector/Fusion/Util.hs .build/pool/Data/Vector/Fusion/Stream/Monadic.hs .build/pool/Data/Vector/Internal/Check.hs .build/pool/Data/Vector/Generic/New.hs .build/pool/Data/Vector/Storable/Mutable.hs .build/pool/Data/Vector/Storable/Internal.hs .build/pool/Data/Vector.hs .build/pool/Data/Vector/Mutable.hs .build/pool/Data/Vector/Unboxed.hs .build/pool/Data/Vector/Unboxed/Base.hs .build/pool/Data/Vector/Primitive.hs .build/pool/Data/Vector/Primitive/Mutable.hs
.build/pool/Data/Vector/Fusion/Stream/Size.hs:25:10: Warning:
No explicit method or default declaration for `*'
In the instance declaration for `Num Size'
.build/pool/Data/Vector/Fusion/Stream/Size.hs:25:10: Warning:
No explicit method or default declaration for `abs'
In the instance declaration for `Num Size'
.build/pool/Data/Vector/Fusion/Stream/Size.hs:25:10: Warning:
No explicit method or default declaration for `signum'
In the instance declaration for `Num Size'
Haddock coverage:
100% ( 5 / 5) in 'Data.Vector.Fusion.Util'
100% ( 6 / 6) in 'Data.Vector.Fusion.Stream.Size'
11% ( 1 / 9) in 'Data.Vector.Internal.Check'
83% (104 /126) in 'Data.Vector.Fusion.Stream.Monadic'
85% ( 88 /104) in 'Data.Vector.Fusion.Stream'
64% ( 42 / 66) in 'Data.Vector.Generic.Mutable'
100% ( 3 / 3) in 'Data.Vector.Generic.Base'
76% ( 37 / 49) in 'Data.Vector.Mutable'
Warning: Couldn't find .haddock for export Data.Primitive.Types.Prim
74% ( 37 / 50) in 'Data.Vector.Primitive.Mutable'
5% ( 1 / 20) in 'Data.Vector.Generic.New'
25% ( 1 / 4) in 'Data.Vector.Storable.Internal'
79% ( 46 / 58) in 'Data.Vector.Storable.Mutable'
93% (215 /232) in 'Data.Vector.Generic'
Warning: Data.Vector.Primitive: Instances of type and data families are not yet supported. Instances of the following families will be filtered out:
Mutable
Warning: Couldn't find .haddock for export Data.Primitive.Types.Prim
96% (184 /191) in 'Data.Vector.Primitive'
Warning: Data.Vector.Unboxed.Base: Instances of type and data families are not yet supported. Instances of the following families will be filtered out:
Mutable, MVector, Vector
17% ( 1 / 6) in 'Data.Vector.Unboxed.Base'
96% (201 /210) in 'Data.Vector.Unboxed'
Warning: Data.Vector.Storable: Instances of type and data families are not yet supported. Instances of the following families will be filtered out:
Mutable
97% (194 /200) in 'Data.Vector.Storable'
Warning: Data.Vector: Instances of type and data families are not yet supported. Instances of the following families will be filtered out:
Mutable
94% (199 /212) in 'Data.Vector'
Warning: Data.Vector.Generic.Mutable: could not find link destinations for:
Control.Monad.Primitive.PrimMonad Control.Monad.Primitive.PrimState
Warning: Data.Vector.Mutable: could not find link destinations for:
Data.Primitive.Array.MutableArray Control.Monad.Primitive.PrimMonad Control.Monad.Primitive.PrimState
Warning: Data.Vector.Primitive.Mutable: could not find link destinations for:
Data.Primitive.ByteArray.MutableByteArray Control.DeepSeq.NFData Data.Primitive.Types.Addr Control.Monad.Primitive.PrimMonad Control.Monad.Primitive.PrimState
Warning: Data.Vector.Generic.New: could not find link destinations for:
Control.Monad.Primitive.PrimMonad Control.Monad.Primitive.PrimState
Warning: Data.Vector.Storable.Mutable: could not find link destinations for:
Control.DeepSeq.NFData Control.Monad.Primitive.PrimMonad Control.Monad.Primitive.PrimState
Warning: Data.Vector.Generic: could not find link destinations for:
Control.Monad.Primitive.PrimMonad Control.Monad.Primitive.PrimState
Warning: Data.Vector.Primitive: could not find link destinations for:
Control.DeepSeq.NFData Data.Primitive.ByteArray.MutableByteArray Data.Primitive.Types.Addr Control.Monad.Primitive.PrimMonad Control.Monad.Primitive.PrimState
Warning: Data.Vector.Unboxed: could not find link destinations for:
Control.DeepSeq.NFData Control.Monad.Primitive.PrimMonad Control.Monad.Primitive.PrimState
Warning: Data.Vector.Storable: could not find link destinations for:
Control.DeepSeq.NFData Control.Monad.Primitive.PrimMonad Control.Monad.Primitive.PrimState
Warning: Data.Vector: could not find link destinations for:
Control.DeepSeq.NFData Control.Monad.Primitive.PrimMonad Control.Monad.Primitive.PrimState
I also tried pretty much all possible ways to write the --read-interface
flag, including :
- as a relative path to the build directory
- as a
file://
URL - with 0, 1 and 2 prefixes that are supposed to indicate the HTML link directory
I know the interface files are being read correctly because Haddock fails when the files are absent, and I know that the HTML files are in the right place because I am browsing them right now, so I can't find an explanation for why Haddock doesn't see them.
This situation has been stumping me for almost two months, and I've learned to accept the greyness of a life without hyperlinks in my documentation, but if anyone knows what to do, I will be eternally grateful :-)
Thanks for your time,