-
Notifications
You must be signed in to change notification settings - Fork 724
Description
Here is an example of the current behavior:
$ cabal install --dry-run thorn --max-backjumps -1 -v3
[...]
[__4] fail (backjumping, conflict set: base, comonad, transformers)
[__3] rejecting: comonad-1.1.0 (conflict: base==4.9.0.0/installed-4.9..., comonad => base>=4 && <4.4)
[__3] rejecting: comonad-1.0.3, comonad-1.0.2, comonad-1.0.1, comonad-1.0, comonad-0.9.0.1, comonad-0.9.0, comonad-0.7.0, comonad-0.6.2.1, comonad-0.6.2, comonad-0.6.1.2, comonad-0.6.1.1, comonad-0.6.1, comonad-0.6.0, comonad-0.5.0, comonad-0.4.0, comonad-0.3.0, comonad-0.1.1, comonad-0.1.0 (conflict: profunctors => comonad>=1.1 && <1.2)
[__3] fail (backjumping, conflict set: base, comonad, profunctors, transformers)
[__2] fail (backjumping, conflict set: base, bifunctors, comonad, profunctors, semigroupoids, thorn, transformers, transformers-compat, semigroupoids-4.0.3:flag, semigroupoids-4.0.4:flag, semigroupoids-4.2:flag)
[__1] rejecting: base-4.9.0.0, base-4.8.2.0, base-4.8.1.0, base-4.8.0.0, base-4.7.0.2, base-4.7.0.1, base-4.7.0.0, base-4.6.0.1, base-4.6.0.0, base-4.5.1.0, base-4.5.0.0, base-4.4.1.0, base-4.4.0.0, base-4.3.1.0, base-4.3.0.0, base-4.2.0.2, base-4.2.0.1, base-4.2.0.0, base-4.1.0.0, base-4.0.0.0, base-3.0.3.2, base-3.0.3.1 (constraint from non-upgradeable package requires installed instance)
[__0] fail (backjumping, conflict set: base, bifunctors, comonad, profunctors, semigroupoids, thorn, transformers, transformers-compat, semigroupoids-4.0.3:flag, semigroupoids-4.0.4:flag, semigroupoids-4.2:flag)
[...]
The final conflict set contains semigroupoids-4.0.3:flag, semigroupoids-4.0.4:flag, semigroupoids-4.2:flag.
As I understand it, the version information has no effect on backjumping, because backjumping never uses variables that were assigned below the current node. And the only way for a conflict set to have more than one version of a flag is for that flag to have been assigned multiple times, which can only happen on multiple branches below the current node.
Some reasons to remove the version:
-
Treating all versions of a flag as the same variable could improve conflict counting. If a flag causes a conflict in one version of a package, then it is more likely to cause a conflict in the next version, and the solver should try to assign the flag sooner.
-
It would simplify the final conflict set when we display it for Print final conflict set when dependency solver fails after an exhaustive search #3570.
-
Flag variables would be more consistent with variables for setup dependencies, which contain the name, but not the version, of the package that has the setup script.
Does it make sense to remove the version info? If we remove it, should we remove it from the Var type, or just remove it when we add variables to the conflict set?