Skip to content

Backtracking Resolver misses a category of conflict resolutions. #12

@awwad

Description

@awwad

There's a bug relating to the innate order of the recursion in the backtracking resolver. While it resolves most conflicts, it misses a sizeable portion. gerritbot(0.2.0) exemplifies the error.

A dependency of gerritbot adds pbr 0.9.0 to be installed before gerritbot asserts its own dependency on pbr >=0.5 <0.6.
resolver.ConflictingVersionError is raised.

A simplified case:
X(1) depends on B and C, any version
B(1) has no dependencies
B(2) has no dependencies
C(1) depends on B==1

Once possible versions of B and all its dependencies are handled, the selected version of B (B(2) in this case) is set in stone and cannot be backtracked, so no version of C can be installed in this case.

While the algo does manage to resolve a surprising number of conflicts (58% of the 2,862 conflicts that pip fails to correctly resolve from a >200k package scrape of PyPI), this is obviously a substantial bug. Until it's fixed, I won't know how many more of the conflicts are resolvable (17% turn out to be malformed, but the other 35%, which show up as unresolvable, may or may not be.).

The algorithm has to be changed:

Rewrite the core of the backtracker (the high level part - not so long) either using Justin's algorithm (which may have the same bug) or, more likely, this one from semver-resolver.

This will allow it to catch all resolvable conflicts, and therefore categorize resolvable/unresolvable conflicts with certainty.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions