You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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
Add -Werror to your cabal file ghc options
Introduce a warning (e.g. unused variable)
cabal haddock --ghc-options='-Wwarn' will fail
Please use version-prefixed commands (e.g. v2-build or v1-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
NixOS 20.03
cabal-install version 3.2.0.0
compiled using version 3.2.0.0 of the Cabal library
The Glorious Glasgow Haskell Compilation System, version 8.6.5
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.
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...
Activity
phadej commentedon Oct 3, 2020
I suspect that command line
--ghc-optionsare not passed to haddock, verbose (cabal haddock -v2) output would help to figure out what is called and how.fendor commentedon Oct 21, 2020
Just sparing someone running cabal with
-v2:Furthermore:
does not work either. (Assuming I finally did a correct Cabal incantation)
So, no
cabaldoes not pass the relevant info, but even if it did,Cabalwould not use it.fendor commentedon Oct 21, 2020
Also, see this note:
at https://github.com/haskell/cabal/blob/master/cabal-install/src/Distribution/Client/ProjectPlanning.hs#L3571