🐛 Bail out when no packages are found with default solvers (#296)

* 🐛 Bail out when no packages are found with default solvers

Checking packages is more tricky when a resolver is set. Resolvers
are capable of mutating the user request and remove part of the
constraints in order to resolve a specific solution.

This had the countereffect on a normal solver to not detect correctly
packages when missing from the wanted set and not proposed during
installation.

This should fix all the cases above taking into consideration of
resolvers and adding specific test-cases for it.

* ⚙️ Pin to tag for test image
This commit is contained in:
Ettore Di Giacinto
2022-05-24 23:01:56 +02:00
committed by GitHub
parent b5da2fa7b4
commit 1006be9271
7 changed files with 99 additions and 18 deletions

View File

@@ -40,6 +40,13 @@ type Solver struct {
Resolver types.PackageResolver
}
// IsRelaxedResolver returns true wether a solver might
// take action on user side, by removing some installation constraints
// or taking automated actions (e.g. qlearning)
func IsRelaxedResolver(t types.LuetSolverOptions) bool {
return t.Type == QLearningResolverType
}
// NewSolver accepts as argument two lists of packages, the first is the initial set,
// the second represent all the known packages.
func NewSolver(t types.SolverOptions, installed types.PackageDatabase, definitiondb types.PackageDatabase, solverdb types.PackageDatabase) types.PackageSolver {