Open ramirez7 opened 4 years ago
I suspect that command line --ghc-options
are not passed to haddock, verbose (cabal haddock -v2
) output would help to figure out what is called and how.
Just sparing someone running cabal with -v2
:
> cabal haddock -v2 --ghc-options='-Wwarn'
...
Build profile: -w ghc-8.8.4 -O1
In order, the following will be built:
- cabal-haddock-0.1.0.0 (lib) (file src/MyLib.hs changed)
creating /home/munin/Documents/haskell/cabal-haddock/dist-newstyle/build
creating /home/munin/Documents/haskell/cabal-haddock/dist-newstyle/tmp
creating
/home/munin/Documents/haskell/cabal-haddock/dist-newstyle/build/x86_64-linux/ghc-8.8.4/cabal-haddock-0.1.0.0
creating
/home/munin/Documents/haskell/cabal-haddock/dist-newstyle/build/x86_64-linux/ghc-8.8.4/cabal-haddock-0.1.0.0/cache
whenReRegister: nothing to register
Using self-exec internal setup method with build-type Simple and args:
["act-as-setup","--build-type=Simple","--","haddock","--verbose=2","--builddir=/home/munin/Documents/haskell/cabal-haddock/dist-newstyle/build/x86_64-linux/ghc-8.8.4/cabal-haddock-0.1.0.0","lib:cabal-haddock"]
/home/munin/.cabal/store/ghc-8.8.4/cabal-install-3.5.0.0-31243c8f02aa1caf3ec5ba134fc9692633f0f52de1e4a8f039787e5fd37726bd/bin/cabal
act-as-setup --build-type=Simple -- haddock --verbose=2
--builddir=/home/munin/Documents/haskell/cabal-haddock/dist-newstyle/build/x86_64-linux/ghc-8.8.4/cabal-haddock-0.1.0.0
lib:cabal-haddock
/home/munin/.nix-profile/bin/haddock --ghc-version
/home/munin/.nix-profile/bin/ghc --print-libdir -hide-all-packages -Wwarn
/home/munin/.nix-profile/bin/ghc-pkg init /home/munin/Documents/haskell/cabal-haddock/dist-newstyle/build/x86_64-linux/ghc-8.8.4/cabal-haddock-0.1.0.0/package.conf.inplace
creating
/home/munin/Documents/haskell/cabal-haddock/dist-newstyle/build/x86_64-linux/ghc-8.8.4/cabal-haddock-0.1.0.0/build
creating
/home/munin/Documents/haskell/cabal-haddock/dist-newstyle/build/x86_64-linux/ghc-8.8.4/cabal-haddock-0.1.0.0/build/autogen
creating
/home/munin/Documents/haskell/cabal-haddock/dist-newstyle/build/x86_64-linux/ghc-8.8.4/cabal-haddock-0.1.0.0/build/autogen
Preprocessing library for cabal-haddock-0.1.0.0..
Running Haddock on library for cabal-haddock-0.1.0.0..
creating
/home/munin/Documents/haskell/cabal-haddock/dist-newstyle/build/x86_64-linux/ghc-8.8.4/cabal-haddock-0.1.0.0/doc/html/cabal-haddock
/home/munin/.nix-profile/bin/haddock '@/home/munin/Documents/haskell/cabal-haddock/dist-newstyle/build/x86_64-linux/ghc-8.8.4/cabal-haddock-0.1.0.0/doc/html/cabal-haddock/haddock-response2926-1.txt'
...
cabal: Failed to build documentation for cabal-haddock-0.1.0.0-inplace.
Furthermore:
> runghc Setup.hs configure
> runghc Setup.hs haddock --ghc-options=-Wwarn
does not work either. (Assuming I finally did a correct Cabal incantation)
So, no cabal
does not pass the relevant info, but even if it did, Cabal
would not use it.
Also, see this note:
setupHsHaddockFlags :: ElaboratedConfiguredPackage
-> ElaboratedSharedConfig
-> Verbosity
-> FilePath
-> Cabal.HaddockFlags
setupHsHaddockFlags (ElaboratedConfiguredPackage{..}) _ verbosity builddir =
Cabal.HaddockFlags {
haddockProgramPaths = mempty, --unused, set at configure time
haddockProgramArgs = mempty, --unused, set at configure time
...
Describe the bug I am trying to run
cabal v2-haddock --ghc-options='-Wwarn'
but despite that, it is still erroring (due to my project-wide-Werror
)cabal v2-build --ghc-options='-Wwarn'
successfully only warns instead of errors however.To Reproduce
-Werror
to your cabal file ghc optionscabal haddock --ghc-options='-Wwarn'
will failPlease use version-prefixed commands (e.g.
v2-build
orv1-build
) to avoid ambiguity.Expected behavior I would expect haddock generation to respect my ghc options. In this example, I would expect it to warn but not error.
System information