Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
Listing flags in stack.yaml gives "Invalid flag specification" #3374
I'd expect listing the flags in
flags: library1: flag-name1: true library2: flag-name2: false
to has the same effect as
stack build --flag library1:flag-name1 --flag library2:-flag-name2
However, the first one fails with "Invalid flag specification" and wants me to add library1 and library2 to the extra-deps field, while the second one succeeds.
EDIT: This happens with
Yeah, I recall seeing this distinction in the code. With CLI flags, it does implicit upgrade of packages to being extra-deps. Whereas with the configuration, you need to be explicit about the upgrade of packages to extra-deps.
I think this is a reasonable thing to expect, it potentially makes the behavior of flags clearer to the user. Though, if implicit snapshots gets implemented - #3330 - it will probably make sense to drop this requirement.
That said, the error should definitely be better than
Isn't it better for the upgrade to be implicit? If it's not, every time you want to change the lts version in the
EDIT: As a user, I'd expect stack to automatically pick the matching lts versions of the mentioned packages.
I just noticed this issue in the Haskell Weekly newsletter. I may have accidentally implemented this already on master, thinking that the requested behavior was the current behavior in 1.5 (which apparently it isn't). So before anyone jumps in to implement, simply testing against master would be good.