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.
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 totarget-pkg
.This also suggests a potential alternative way of specifying
ghc-options
,flags
, and other settings instack.yaml
. We might consider an alternative specification which is included in thepackages
member, and uses the same names as the top level settings.