Re:The Magic of Dependency Resolution
by OscarCunningham on Tuesday July 11, 2023 @01:16PM
(#36684064)
Ideally, one would also prefer higher versions of each package. How much longer would it take to find a solution with the guarantee that there's no other solution with all packages at least as good?
[ Parent
| on HN ]
Unfortunately, it is sometimes not even possible to say which solution should be preferred because different branches lead to different sets of packages having higher versions. There is not really an "ultimate" heuristic to determine which of the two sets is better.
However, users are always encouraged to add more constraints to shape the solution, and packagers encouraged to take good care of the metadata.
At prefix we are quite interested in figuring out how we can help packagers to determine e.g. compatibility ranges more correctly by doing static analysis and such things.
Re:The Magic of Dependency Resolution
by OscarCunningham on Tuesday July 11, 2023 @01:32PM
(#36684367)
Right, but we could still ask for Pareto optimality: no way to make one package better, while keeping the rest at least as good.
Ideally, there should be a choice that allowed to look for the minimal and the maximal versions that satisfy given requirement.
Developers usually want the newest, but maintainers usually want the oldest.
> Ideally, one would also prefer higher versions of each package
Ideally, yes. In practice? I know that I rather strongly prefer not to use the latest version of any piece of software.
Author here. I glossed over this in the article, but the solver is actually privileging higher versions as you suggest. In the "set" step, when we arbitrarily set a variable to true, we have a heuristic that picks the highest possible version of the package.