Skip to content

Specifying flags for multiple packages #335

@lostman

Description

@lostman

I have a collection of packages containing libraries/executables and I want to build them all. Each package contains a release flag which is used to tweak, among other things, ghc-options. For development I use -rtsopts -O1 to get speedier builds and tweak-ability; for release I use -O2 -Werror.

With cabal-install I can build the packages like this:

cabal install -frelease foo/ bar/ baz/ (1)

This doesn't seem possible with stack. It looks like I need to set the flags one by one:

flags:
  foo:
    release: true
  bar:
    release: true
  baz:
    release: true

And it is also hard to override the config from command line. Ideally I would like to set release: false in my stack.yaml and only make the release build when necessary.

Overriding the flags from command line is a little bit tedious:

stack build --flag foo:-release --flag bar:-release --flag baz:-release

Recovering the functionality of cabal-install example above (1) would be very useful. Perhaps:

stack build --flag \*:release

?

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions