]> _ Git - alire.git/commit
Solver: Speed-up for impossible dependencies (#620)
authorAlejandro R Mosteo <alejandro@mosteo.com>
Fri, 20 Nov 2020 14:20:49 +0000 (15:20 +0100)
committerGitHub <noreply@github.com>
Fri, 20 Nov 2020 14:20:49 +0000 (15:20 +0100)
commitff9fb73ca6f7c46af3c1e5f2c0410f816685e219
tree25e3d756a4220ba325dc1a2615b5336933a32fce
parent7f4fbaf33a3682397660d7193bc9abb9772f455d
Solver: Speed-up for impossible dependencies (#620)

* Solver: Speed-up for impossible dependencies

Whenever a solution is incomplete we keep looking for solutions. But if the
reason for incompleteness is an impossible request (non-existent crate or
version), this resulted on finding all combinations for the rest of crates that
do have satisfiable dependencies.

With this patch, impossible situations are considered part of the "complete"
solution (as there cannot be a more complete one), which allows the solver to
use complete the search much more quickly, as no pointless attempts for more
solutions are made.

* Fixes for problems caught by the test suite

The optimization was too aggressive, as it took place before detecting
externals. Also, it should only apply to direct unavoidable dependencies, as
indirect impossibilities can be avoided by other solutions.
src/alire/alire-solver.adb