0

尽管某些软件包中存在 Haddock 错误,但是否有一种解决方法来构建一个 lokal Hoogle DB。例如,在 lokal Hoogle DB 构建期间,是否有关于如何从 Haddock 子任务中排除这些包的解决方法?

作为一个具体的例子:

$ stack hoogle
No Hoogle database yet. Automatically building haddocks and hoogle database (use --no-setup to disable) ...
classy-prelude-yesod-1.5.0: configure
classy-prelude-yesod-1.5.0: build
classy-prelude-yesod-1.5.0: haddock
Progress 1/2

--  While building package classy-prelude-yesod-1.5.0 using:
      /Users/nrm/.stack/setup-exe-cache/x86_64-osx/Cabal-simple_mPHDZzAJ_2.4.0.1_ghc-8.6.4 --builddir=.stack-work/dist/x86_64-osx/Cabal-2.4.0.1 haddock --html --hoogle --html-location=../$pkg-$version/ --haddock-option=--hyperlinked-source --haddock-option=--quickjump
    Process exited with code: ExitFailure 1
    Logs have been written to: /Users/nrm/Sources/mdpm/projects/Yapper/.stack-work/logs/classy-prelude-yesod-1.5.0.log

    Configuring classy-prelude-yesod-1.5.0...
    Preprocessing library for classy-prelude-yesod-1.5.0..
    Building library for classy-prelude-yesod-1.5.0..
    [1 of 2] Compiling ClassyPrelude.Yesod ( src/ClassyPrelude/Yesod.hs, .stack-work/dist/x86_64-osx/Cabal-2.4.0.1/build/ClassyPrelude/Yesod.o )
    [2 of 2] Compiling Paths_classy_prelude_yesod ( .stack-work/dist/x86_64-osx/Cabal-2.4.0.1/build/autogen/Paths_classy_prelude_yesod.hs, .stack-work/dist/x86_64-osx/Cabal-2.4.0.1/build/Paths_classy_prelude_yesod.o )
    Preprocessing library for classy-prelude-yesod-1.5.0..
    Running Haddock on library for classy-prelude-yesod-1.5.0..
    Haddock coverage:
    haddock: internal error: internal: extractDecl
    CallStack (from HasCallStack):
      error, called at utils/haddock/haddock-api/src/Haddock/Interface/Create.hs:1116:12 in main:Haddock.Interface.Create

涉及如何使用黑线鳕构建,但忽略黑线鳕错误

4

1 回答 1

0

stack hoogle大约是stack haddock当时的帮手hoogle generate --local。如果您只能为有效的项目生成 Haddock 输出,那么您可以手动生成hoogle generate --local。但是,我不知道有任何方法可以仅限stack haddock于一个子集,因此它可能不切实际。

另一种方法是 to hoogle generate <list of dependencies>,它将使用远程文档而不是本地文档,因此将跳过运行 Haddock。

于 2019-04-02T19:10:32.087 回答