我正在编写一个 Cabal-install 替代品来编译我自己的项目(如果你好奇的话,可以在 Github 上查看),并且几乎已经让它完全可操作,但有一个细节:当为单独的包生成文档时,Haddock 没有' 似乎无法找到其他包的 HTML 目标,即使它确实读取了由所述其他包生成的接口文件。
这是我的构建系统对 Haddock 的调用,及其伴随的输出:
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
我还尝试了几乎所有可能的方法来编写--read-interface
标志,包括:
- 作为构建目录的相对路径
- 作为
file://
网址 - 带有 0、1 和 2 前缀,应该指示 HTML 链接目录
我知道接口文件被正确读取,因为当文件不存在时 Haddock 会失败,并且我知道 HTML 文件在正确的位置,因为我现在正在浏览它们,所以我找不到为什么 Haddock 没有的解释见不到他们。
这种情况困扰了我将近两个月,我已经学会接受在我的文档中没有超链接的生活的灰色,但如果有人知道该怎么做,我将永远感激:-)
谢谢你的时间,