haskell / cabal

Official upstream development repository for Cabal and cabal-install
https://haskell.org/cabal
Other
1.62k stars 691 forks source link

`cabal build --enable-build-info` doesn't contain options specified via `cabal.project` files #9927

Open fendor opened 6 months ago

fendor commented 6 months ago

Describe the bug

The build-info.json file generated by cabal build --enable-build-info does not include ghc-options specified via cabal.project

To Reproduce Steps to reproduce the behavior:

$ mkdir cabal-bi-bug && cd cabal-bi-bug
$ cabal init -n --lib
$ echo -e "packages: ./\npackage cabal-bi-bug\n  ghc-options: -haddock\n" > cabal.project
$ cabal build --enable-build-info
$ cat dist-newstyle/build/**/build-info.json | jq | grep haddock

Expected behavior

compiler-args field should contain -haddock

System information

Mikolaj commented 5 months ago

The failing test case confirms this is a bug. I've assumed no design is involved in fixing this and so I've set the pr-welcome label. If it can be fixed in many way, though, let's discuss here first before opening a PR.