4

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,

user3340662
  • 191
  • 4
  • 1
    perhaps this helps: http://documentup.com/feuerbach/standalone-haddock – d8d0d65b3f7cf42 Mar 31 '14 at 13:07
  • Thank you for the link, but as I understand it, `standalone-haddock` needs the dependencies to be installed and I would like to be able generate documentation without having to install every package, if possible. Is it possible that Haddock requires packages to be installed to find links correctly ? – user3340662 Mar 31 '14 at 15:14
  • I am not sure. But why not take the obvious solution: if it works when packages are installed, then install the packages. (In a cabal sandbox if you're cautious.) Or do you mean you have a set of packages that is not cabal-install-able? Then it's doubtful whether haddock can process it. I think it needs to resolve (all) references the same way ghc would. – d8d0d65b3f7cf42 Mar 31 '14 at 18:57
  • Well, I don't know if it works when packages are installed, since I have never tried it. The Haddock documentation didn't mention anything about packages, so I didn't try anything in that direction. Another reason I haven't considered that approach is that it would be long and arduous, since some of my packages are not cabal-powered and it would take some effort to craft the appropriate functions to make them appear so. Anyway, I gyess I have no choice in the matter, so I'd better get to it... Thanks again for your help, in any case :-) – user3340662 Apr 01 '14 at 00:17

0 Answers0