Open
Description
Problem
In the resolver conflicts are stored as a list of package versions that cannot be activated the same time. This model is insufficient to describe certain interactions of optional features with requirements that can match multiple major versions. The exact root cause of the problem is not yet clear.
Steps
I have suspected there are issues with this for a long time. But it was only this week that I came across a clear reproducer.
#[test]
/// Minimized from `upstream-ontologist v0.1.37`, although subsequent changes to the index
/// means it's no longer a problem in the wild.
fn test() {
let reg = registry(vec![
pkg_dep(
("breezyshim", "1.0.0"),
vec![dep("debversion").with(&["pyo3"])],
),
pkg_dep(("debbugs", "1.0.0"), vec![dep_req("debversion", "^0.4")]),
pkg_dep(("debversion", "0.3.1"), vec![dep("pyo3").opt()]),
pkg_dep(
("debversion", "0.4.1"),
vec![dep_req("pyo3", ">=0.22").opt()],
),
pkg(("pyo3", "0.20.3")),
]);
let deps = vec![dep("breezyshim"), dep("debbugs")];
let mut sat_resolver = SatResolver::new(®);
resolve_and_validated(deps, ®, &mut sat_resolver).unwrap();
}
Possible Solution(s)
It should be possible to resolve this by directly modeling features
as separately tracked entities in the existing resolver. This would however be a lot of work. I suspect this will not get fixed until we switch to a PubGrub based resolver.