10

我尝试haddock通过运行以下命令进行安装,cabal install haddock但遇到了以下问题。

leonzo@lion:~/opt$ cabal install haddock
Resolving dependencies...
Configuring haddock-2.11.0...
Building haddock-2.11.0...
Preprocessing library haddock-2.11.0...
unused terminals: 1
[ 1 of 31] Compiling Haddock.Backends.HaddockDB ( src/Haddock/Backends/HaddockDB.hs, dist/build/Haddock/Backends/HaddockDB.o )
[ 2 of 31] Compiling Haddock.Backends.Xhtml.Types ( src/Haddock/Backends/Xhtml/Types.hs, dist/build/Haddock/Backends/Xhtml/Types.o )
[ 3 of 31] Compiling Haddock.Convert  ( src/Haddock/Convert.hs, dist/build/Haddock/Convert.o )
[ 4 of 31] Compiling Paths_haddock    ( dist/build/autogen/Paths_haddock.hs,     dist/build/Paths_haddock.o )
[ 5 of 31] Compiling Haddock.GhcUtils ( src/Haddock/GhcUtils.hs, dist/build/Haddock/GhcUtils.o )
[ 6 of 31] Compiling Haddock.Version  ( src/Haddock/Version.hs, dist/build/Haddock/Version.o )
[ 7 of 31] Compiling Haddock.Lex      ( dist/build/Haddock/Lex.hs, dist/build/Haddock/Lex.o )
[ 8 of 31] Compiling Haddock.Types    ( src/Haddock/Types.hs, dist/build/Haddock/Types.o )
[ 9 of 31] Compiling Haddock.Utils    ( src/Haddock/Utils.hs, dist/build/Haddock/Utils.o )
[10 of 31] Compiling Haddock.Options  ( src/Haddock/Options.hs, dist/build/Haddock/Options.o )
[11 of 31] Compiling Haddock.Backends.Xhtml.Themes ( src/Haddock/Backends/Xhtml/Themes.hs, dist/build/Haddock/Backends/Xhtml/Themes.o )
[12 of 31] Compiling Haddock.Backends.Xhtml.Utils ( src/Haddock/Backends/Xhtml/Utils.hs, dist/build/Haddock/Backends/Xhtml/Utils.o )
[13 of 31] Compiling Haddock.Backends.LaTeX ( src/Haddock/Backends/LaTeX.hs, dist/build/Haddock/Backends/LaTeX.o )
[14 of 31] Compiling Haddock.Backends.Hoogle ( src/Haddock/Backends/Hoogle.hs, dist/build/Haddock/Backends/Hoogle.o )
[15 of 31] Compiling Haddock.Interface.AttachInstances ( src/Haddock/Interface/AttachInstances.hs, dist/build/Haddock/Interface/AttachInstances.o )
[16 of 31] Compiling Haddock.Interface.Rename ( src/Haddock/Interface/Rename.hs, dist/build/Haddock/Interface/Rename.o )
[17 of 31] Compiling Haddock.Doc      ( src/Haddock/Doc.hs, dist/build/Haddock/Doc.o )
[18 of 31] Compiling Haddock.Parse    ( dist/build/Haddock/Parse.hs, dist/build/Haddock/Parse.o )
[19 of 31] Compiling Haddock.Interface.ParseModuleHeader ( src/Haddock/Interface/ParseModuleHeader.hs, dist/build/Haddock/Interface/ParseModuleHeader.o )
[20 of 31] Compiling Haddock.Interface.LexParseRn ( src/Haddock/Interface/LexParseRn.hs, dist/build/Haddock/Interface/LexParseRn.o )

src/Haddock/Interface/LexParseRn.hs:67:52:
Not in scope: type constructor or class `SafeHaskellMode'
cabal: Error: some packages failed to install:
haddock-2.11.0 failed during the building phase. The exception was:
ExitFailure 1
leonzo@lion:~/opt$

有没有人知道如何处理这个烂摊子?

编辑 我的 ghc 版本是 7.4.1

4

1 回答 1

10

如今,黑线鳕版本与 GHC 版本紧密绑定。对于 ghc-7.4.1,对应的 haddock 版本是 2.10.0。

错误消息中提到的SafeHaskellMode类型是在 ghc-7.4.2 中添加的,因此您无法使用 ghc-7.4.1 编译 haddock-2.11。

您的 GHC 可能应该有一个可以工作的 haddock-2.10。如果没有,您可以安装 haddock-2.10.0,或者升级您的 GHC(推荐,自 7.4.1 以来修复了一些错误)。

于 2012-10-24T20:27:25.957 回答