haskell / haskell/cabal

cabal v2-haddock isn't respecting --ghc-options

Open
#7,101 3 comments 0 reactions 0 assignees View on GitHub
cabal-install: cmd/haddock
Dominant language
Haskell
Stars
1.7k
Forks
750
Avg merge
4d 3h
Merged PRs (30d)
28

Description

**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
```

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.