commercialhaskell / commercialhaskell/stack
Feature Request: Expose Cabal flags and GHC options in ls dependencies json
- Dominant language
- Haskell
- Stars
- 4.1k
- Forks
- 850
- Avg merge
- 10h 37m
- Merged PRs (30d)
- 4
Description
**Feature Request**
I would like the output of `stack ls dependencies json` to contain Cabal flags and GHC options that are defined in the snapshot. E.g. Cabal flags and GHC options that are defined as follows in a custom snapshot:
```
flags:
unordered-containers:
debug: true
ghc-options:
warp:
- -O2
```
This should take flags like [`--static`](https://github.com/commercialhaskell/stack/issues/3420) (if implemented) into account.
**Motivation**
`stack ls dependencies json` is very useful for build tools that would like to call out to `stack` to determine how to build Stackage dependencies. Cabal flags can influence the dependency graph and can be required to build a package correctly on a given platform, similarly GHC options can be required to build a package correctly. However, currently stack does not expose these flags or options. The user of the tool that consumes `stack ls dependencies json` will have to repeat this configuration in some form, which is cumbersome and error-prone.
Contributor guide
Assessment
This issue has not been assessed yet.