cabal icon indicating copy to clipboard operation
cabal copied to clipboard

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

Open fendor opened this issue 1 year ago • 1 comments

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

  • Operating system
  • cabal 3.10.3.0

fendor avatar Apr 24 '24 11:04 fendor

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.

Mikolaj avatar May 01 '24 10:05 Mikolaj