首页 > 解决方案 > haddock 生成文档,但返回退出代码 1

问题描述

我尝试haddock使用以下命令通过堆栈调用:

stack haddock --no-haddock-deps --haddock-internal webservice:lib

stack haddock --haddock-arguments "--odir=/tmp/haddock" --no-haddock-deps --haddock-internal webservice:lib

stack haddock --haddock-arguments "--odir=/tmp/haddock --no-warnings" --no-haddock-deps --haddock-internal webservice:lib

stack haddock --haddock-arguments "--odir=/tmp/haddock --no-warnings --no-print-missing-docs" --no-haddock-deps --haddock-internal webservice:lib

每次,在黑线鳕输出结束时,我都会注意到以下内容:

Documentation created:
.stack-work/dist/x86_64-linux/Cabal-2.2.0.1/doc/html/webservice/index.html,
Cabal-simple_mPHDZzAJ_2.2.0.1_ghc-8.4.3: can't find source for QCTest in
.stack-work/dist/x86_64-linux/Cabal-2.2.0.1/doc/html/webservice/webservice.txt
.stack-work/dist/x86_64-linux/Cabal-2.2.0.1/build/webservice-test/webservice-test-tmp,
Preprocessing test suite 'webservice-test' for webservice-0.1.0.0..
test, src


--  While building custom Setup.hs for package webservice-0.1.0.0 using:
      /home/vl/.stack/setup-exe-cache/x86_64-linux/Cabal-simple_mPHDZzAJ_2.2.0.1_ghc-8.4.3 --builddir=.stack-work/dist/x86_64-linux/Cabal-2.2.0.1 haddock --html --hoogle --html-location=../$pkg-$version/ --haddock-option=--hyperlinked-source --internal --haddock-option=--odir=/tmp/haddock --haddock-option=--no-warnings --haddock-option=--no-print-missing-docs --haddock-option=--hoogle --haddock-option=--quickjump
    Process exited with code: ExitFailure 1

的文档webservice:lib似乎已经生成,但仍然haddock以 退出1,从而完全破坏了我的 CI 脚本。

编辑 - 调试输出:

命令:

stack haddock --haddock-arguments "--odir=/tmp/haddock -v3 --no-haddock-hyperlink-source" --no-haddock-deps --haddock-internal webservice:lib

输出:

Warning: Unable to find a known
         candidate for the Cabal entry
         Keys, but did find: 
         * Keys.hs.sample If you are
         using a custom preprocessor for
         this module with its own file
         extension, consider adding the
         file(s) to your .cabal under
         extra-source-files.
webservice-0.1.0.0: build (lib)
Preprocessing library for webservice-0.1.0.0..
Building library for webservice-0.1.0.0..
ignoring (possibly broken) abi-depends field for packages
webservice-0.1.0.0: haddock
Cabal-simple_mPHDZzAJ_2.2.0.1_ghc-8.4.3:
'/home/vl/.stack/programs/x86_64-linux/ghc-8.4.3/bin/haddock' exited with an
error:


--  While building custom Setup.hs for package webservice-0.1.0.0 using:
      /home/vl/.stack/setup-exe-cache/x86_64-linux/Cabal-simple_mPHDZzAJ_2.2.0.1_ghc-8.4.3 --builddir=.stack-work/dist/x86_64-linux/Cabal-2.2.0.1 haddock --html --hoogle --html-location=../$pkg-$version/ --haddock-option=--hyperlinked-source --internal --haddock-option=--odir=/tmp/haddock --haddock-option=-v3 --haddock-option=--no-haddock-hyperlink-source
    Process exited with code: ExitFailure 1

标签: haskellhaskell-stackhaddock

解决方案


推荐阅读