-
Notifications
You must be signed in to change notification settings - Fork 842
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Specifying flags for multiple packages #335
Comments
We did have global flags in the .yaml but they were removed, considered useless. I think adding them back shouldn't be problematic. |
I think they're very useful! Or at least I haven't found alternative workflow to manage development/release for a single project that contains multiple packages. |
I'm not opposed to adding this necessarily, but I do think that in general flags are misused in this way, leading to flags accidentally being turned on when they weren't intended. For the use case you describe, I typically achieve it just by passing in |
I imagine his use-case is like the |
(Although that's something that would be better passed as a command-line flag than put in a version controlled .yaml file.) |
I think what I'm starting to get at is that maybe |
What the cabal solution has is the ability to specify the -DDEVELOPMENT (or w/e) CPP flag, but also GHC options like -Wall -Werror or -O2, etc. So such a flag would be nice to be configurable in the .yaml. |
Maybe we should just implement the simple thing now (support current workflows) and discuss adding a |
@snoyberg fair point about turning flags on accidentally. Who knows what other flags are defined in the dependencies. I was mostly thinking about a single-project/multiple-packages case where I only want to pass the flags to my own projects all of which are in my local directory. Normally I'd do something like this:
|
@lostman I've added this on master with the syntax you mentioned. Can you test it out? It would be trivial in the future to allow the cabal-install behavior of just |
👍 Works great. |
Cool |
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:This doesn't seem possible with
stack
. It looks like I need to set the flags one by one:And it is also hard to override the config from command line. Ideally I would like to set
release: false
in mystack.yaml
and only make the release build when necessary.Overriding the flags from command line is a little bit tedious:
Recovering the functionality of
cabal-install
example above(1)
would be very useful. Perhaps:?
The text was updated successfully, but these errors were encountered: