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
manual cabal flag toggled by modular solver #2280
Comments
/cc @kosmikus |
Here's some interesting output from
|
I just noticed that the Also, this bug occurs in
|
Ok, I think I can reproduce this. |
I think I found the bug. So when fixing manual flags, the modular solver commits to the first still enabled choice at the time. The problem here is that at the point manual flags are enforced, the |
This hopefully addresses issue #2280. The problem was as follows: In the modular solver, manual flags are enforced. However, in order to respect manual choices by the user, which are still allowed, we would first check if one of the two choices had already been disabled, and only if that's not the case, disable the non-default choice. However, a manual user constraint is not the only reason why the default flag choice can be disabled at this point. It can already be disabled in the validation phase, if it's immediately obvious to the solver at this point that it can never work. In such a situation (which is described in #2280), the solver would then fail to respect a manual flag and allow to change it without user intervention. The fix seems simple: we now explicitly check whether the flag choice has been disabled *by the user*, and only then leave it alone. Otherwise, we enforce the manual flag.
This should now be fixed in master. I cannot currently judge how much of a problem this error will be for users of old cabal versions that have the bug once the new GHC is released. Perhaps a candidate for backporting to various branches. Leaving open for now because of this issue. |
/cc @tibbe fyi, this may need backporting to 1.18 and 1.20 |
👍 :-) |
So... how do I manually toggle one of these flags? |
@ezyang Using either |
(The key point is, you need to use |
Since the fix hasn't been backported for over a year, can this be closed? |
I guess it can, new |
With GHC 7.9/7.10, only
deepseq>=1.4.0.0
is installable.semigroups-0.16
has the following flag defined:and it's used for toggling a build-dep:
So it's expected that
semigroups-0.16
isn't installable with GHC 7.9/7.10. However, Cabal decides to toggle thedeepseq
flag, even though it isn't allowed to:as you can see in the logging output above, surprisingly
deepseq=False
is set.The text was updated successfully, but these errors were encountered: