commercialhaskell / commercialhaskell/stack
CLI mechanism for applying build flags to specific packages
- Dominant language
- Haskell
- Stars
- 4.1k
- Forks
- 850
- Avg merge
- 10h 37m
- Merged PRs (30d)
- 4
Description
For flags, in both stack.yaml and the CLI we specify them in a package-specific manner. However, for `--ghc-options` and other CLI flags, we specify something that applies to all. In the case of flags like `--coverage`, `--profile`, `--haddock`, etc, many packages may be rebuilt - see for example https://github.com/commercialhaskell/stack/issues/1940 https://github.com/commercialhaskell/stack/issues/1132 .
It would make sense to me if some subset of build flags could be specified per-package. One way to do this might be something like `stack build target-pkg --opts "--coverage --haddock" other-pkg`. `--haddock` and `--coverage` would only be applied to `target-pkg`.
This also suggests a potential alternative way of specifying `ghc-options`, `flags`, and other settings in `stack.yaml`. We might consider an alternative specification which is included in the `packages` member, and uses the same names as the top level settings.
Contributor guide
Assessment
This issue has not been assessed yet.