Treat flags with much less priority.
This implements two changes: (1) Flag choices are deferred whenever possible. (2) If a package appears on both branches of a conditional, the unconstrained package is lifted out of the conditional. In combination, we're trying to achieve that the solver should pick a package before the flag, and thereby e.g. respect installed package versions. This is adequate in the common use case that flags are simply representing a disjunction, and should be rather weak. We'll have to see what happens in the few other situations where flags are really representing optional features. I'd expect, however, that in such situations there are targets in one branch, and not the other. Then the flag choice would still happen prior to the corresponding target. (cherry picked from commit 91abc4f9)
Showing
- cabal-install/Distribution/Client/Dependency/Modular/IndexConversion.hs 9 additions, 1 deletion...Distribution/Client/Dependency/Modular/IndexConversion.hs
- cabal-install/Distribution/Client/Dependency/Modular/Preference.hs 14 additions, 7 deletions...tall/Distribution/Client/Dependency/Modular/Preference.hs
- cabal-install/Distribution/Client/Dependency/Modular/Solver.hs 2 additions, 1 deletion...-install/Distribution/Client/Dependency/Modular/Solver.hs
Loading
Please register or sign in to comment