commercialhaskell / stack

The Haskell Tool Stack
http://haskellstack.org
BSD 3-Clause "New" or "Revised" License
3.99k stars 845 forks source link

CLI mechanism for applying build flags to specific packages #2417

Open mgsloan opened 8 years ago

mgsloan commented 8 years ago

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.

borsboom commented 8 years ago

I think there's overlap between this and #849 as well.