Niels Thykier
69d42ffb36
solver: improve apply_order to simplify more code
...
Signed-off-by: Niels Thykier <niels@thykier.net>
6 years ago
Niels Thykier
b306700376
solver: Extract a function from _comute_group_order_adds
...
Signed-off-by: Niels Thykier <niels@thykier.net>
6 years ago
Niels Thykier
259fecf6cf
solver: Rename a variable to avoid confusion
...
Signed-off-by: Niels Thykier <niels@thykier.net>
6 years ago
Niels Thykier
cdcfe85bfa
solver: Replace dict with a proper object
...
Signed-off-by: Niels Thykier <niels@thykier.net>
6 years ago
Niels Thykier
93f101bee2
solver: Extract some common code into a function
...
Signed-off-by: Niels Thykier <niels@thykier.net>
6 years ago
Niels Thykier
2ed6161b49
solver: Refactor out a function to avoid duplicated code
...
Signed-off-by: Niels Thykier <niels@thykier.net>
6 years ago
Niels Thykier
af20634b12
solver: Merge some loops to reduce nesting level
...
Signed-off-by: Niels Thykier <niels@thykier.net>
6 years ago
Niels Thykier
b61e1086bd
solver: Invert an if-statement to reduce max indentation level
...
Signed-off-by: Niels Thykier <niels@thykier.net>
6 years ago
Niels Thykier
68407c53c0
Remove an unnecessary if-statement
...
Signed-off-by: Niels Thykier <niels@thykier.net>
6 years ago
Niels Thykier
9971714e27
solver: Merge two loops by using chain
...
Signed-off-by: Niels Thykier <niels@thykier.net>
6 years ago
Niels Thykier
16dc303190
solver: Reduce two small loops into a comprehension
...
Signed-off-by: Niels Thykier <niels@thykier.net>
6 years ago
Niels Thykier
d3e06fc45f
solver: Split _compute_group_order into three methods
...
Signed-off-by: Niels Thykier <niels@thykier.net>
6 years ago
Niels Thykier
c65b377c5d
solver: Split solve_groups into 3 smaller methods
...
Signed-off-by: Niels Thykier <niels@thykier.net>
6 years ago
Niels Thykier
7124313aa6
Make InstallabilityTester suite agnostic
...
Signed-off-by: Niels Thykier <niels@thykier.net>
6 years ago
Niels Thykier
ced7b7b413
Refactor britney.py to use InstallabilityTester less
...
Signed-off-by: Niels Thykier <niels@thykier.net>
6 years ago
Niels Thykier
0b4f58315f
Rename a method and reduce a table to a set
...
Signed-off-by: Niels Thykier <niels@thykier.net>
6 years ago
Niels Thykier
0eb8b5a201
BinaryPackageUniverse: Provde equivalent_packages
...
Signed-off-by: Niels Thykier <niels@thykier.net>
6 years ago
Niels Thykier
ef813bf0d8
Let the BinaryPackageUnvierse track broken packages
...
Signed-off-by: Niels Thykier <niels@thykier.net>
6 years ago
Niels Thykier
8867ef0cf9
Let the BinaryPackageUniverse track essential packages
...
Signed-off-by: Niels Thykier <niels@thykier.net>
6 years ago
Niels Thykier
07a407e810
Partly separate the solver from the inst_tester
...
Signed-off-by: Niels Thykier <niels@thykier.net>
6 years ago
Niels Thykier
c0ecdd82fb
Remove now redundant APIs from the InstallabilityTester
...
Signed-off-by: Niels Thykier <niels@thykier.net>
6 years ago
Niels Thykier
35b06ee007
tests: Separate inst_tester from universe
...
This commit updates the test suite to use the BinaryPackageUniverse
instead of the InstallabilityTester where that makes sense. The rest
of Britney has yet to be updated except where absolutely necessary (as
that will come in a later commit).
Signed-off-by: Niels Thykier <niels@thykier.net>
6 years ago
Niels Thykier
d557610c6f
BinaryPackageUniverse: Implement packages_equivalent_to()
...
Signed-off-by: Niels Thykier <niels@thykier.net>
6 years ago
Niels Thykier
530db5d3f7
Extract a BinaryPackageUniverse from the InstallabilityTester
...
The InstallabilityTester is suffering from a lack of clear purpose
because it serves multiple. This commit extracts most of one of these
purposes into the BinaryPackageUniverse class while retaining the
original API of the InstallabilityTester.
Signed-off-by: Niels Thykier <niels@thykier.net>
6 years ago
Niels Thykier
32def47991
Fix typo in doc string
...
Signed-off-by: Niels Thykier <niels@thykier.net>
6 years ago
Niels Thykier
f86cda97da
inst_tester: Improve doc string/argument name
...
Signed-off-by: Niels Thykier <niels@thykier.net>
6 years ago
Niels Thykier
6c5300d873
Unfold the suite.binaries tuple into two members
...
Signed-off-by: Niels Thykier <niels@thykier.net>
6 years ago
Niels Thykier
c4931fb1b2
solver: Move a common variable out of an if
...
Signed-off-by: Niels Thykier <niels@thykier.net>
6 years ago
Niels Thykier
1e46965924
inst/builder.py: Split function in three to reduce indentation levels
...
Signed-off-by: Niels Thykier <niels@thykier.net>
6 years ago
Niels Thykier
dd5211d55a
inst-tester: Add missing element to a set
...
Signed-off-by: Niels Thykier <niels@thykier.net>
6 years ago
Niels Thykier
55dd190fa6
inst-tester: Make "check" a list
...
Should be slightly cheaper (O(1)) than using a set.
Signed-off-by: Niels Thykier <niels@thykier.net>
6 years ago
Niels Thykier
cd1f384012
inst-tester: Remove obsolete "safe-set" optimization
...
Signed-off-by: Niels Thykier <niels@thykier.net>
6 years ago
Niels Thykier
95b945d2b3
inst-tester: Remove obsolete optimization
...
Signed-off-by: Niels Thykier <niels@thykier.net>
6 years ago
Paul Gevers
713b98ad6b
inst_tester: add is_pkg_in_testing
6 years ago
Niels Thykier
b6888c2716
test-builder: Avoid allocating empty throw-away lists on empty relations
...
Signed-off-by: Niels Thykier <niels@thykier.net>
6 years ago
Niels Thykier
373f7f51f3
inst-builder: Avoid some hash-look ups by doing them early
...
Signed-off-by: Niels Thykier <niels@thykier.net>
6 years ago
Niels Thykier
35add7cb26
Move loop-invariant out of loop
...
Signed-off-by: Niels Thykier <niels@thykier.net>
6 years ago
Niels Thykier
02001d4d4f
inst-builder: Loop over values instead of keys + hash-lookup
...
Signed-off-by: Niels Thykier <niels@thykier.net>
6 years ago
Niels Thykier
0446ead9e8
inst-builder: Replace RelationBuilder with a set_relations method
...
Signed-off-by: Niels Thykier <niels@thykier.net>
6 years ago
Niels Thykier
ab6b2ef953
inst-builder: Refactor to bulk adding dependency clauses
...
Signed-off-by: Niels Thykier <niels@thykier.net>
6 years ago
Niels Thykier
bc1d3afa38
inst-builder: Make add_breaks a bulk call
...
Signed-off-by: Niels Thykier <niels@thykier.net>
6 years ago
Niels Thykier
6f97e36477
inst-builder: Split relation loop and optimize conflicts
...
Signed-off-by: Niels Thykier <niels@thykier.net>
6 years ago
Niels Thykier
6a3d100b92
Fix error format string error in AssertionError
...
Signed-off-by: Niels Thykier <niels@thykier.net>
6 years ago
Niels Thykier
fc834624fc
Avoid some unnecessary hash look ups
...
Signed-off-by: Niels Thykier <niels@thykier.net>
6 years ago
Niels Thykier
64d2bc4203
builder.py: Make the code suite agnostic
...
Signed-off-by: Niels Thykier <niels@thykier.net>
7 years ago
Niels Thykier
41978869ce
Migrate solver's ad-hoc debug logging
...
Signed-off-by: Niels Thykier <niels@thykier.net>
7 years ago
Niels Thykier
69473eefca
solver: Extract compute_scc into a function
...
Signed-off-by: Niels Thykier <niels@thykier.net>
8 years ago
Niels Thykier
bd375fdd85
solver: Make _compute_scc iterative
...
Rewrite _compute_scc to be iterative to avoid call recursion limit for
graphs with long dependency chains.
Signed-off-by: Niels Thykier <niels@thykier.net>
8 years ago
Niels Thykier
64653087d0
solver: Fix bug where some items were not emitted
...
Sometimes the solver would correctly compute which items are grouped
together, but then fail to emit some groups. This is trivially
fixable by forcing an update of "before" + "after" relations.
Admittedly, this looks unnecessary, so it may just be hiding the bug.
Nonetheless, the change makes the new test_solver_simple_scc test
produce the expected result.
Signed-off-by: Niels Thykier <niels@thykier.net>
8 years ago
Niels Thykier
42be17ad26
inst-tester: Correctly handle unresolved essential choices
...
Britney has a special case for essential packages to ensure that any
package that with essential packages are not installable. This check
did not account for a case, where a package is not co-installable with
two or more pseudo-essential package part of the same OR dependency.
A contrived example based on real world data:
Package: foo
# Conflict with all providers of "awk"
Conflicts: mawk | gawk | original-awk
This alone is actually not sufficient to trigger the bug, as
_get_min_pseudo_ess_set is in theory some times smart enough to pick
an "obvious" solution between the pseudo-essential option.
When it does, one of the above ends up in the (de-facto) essential set
and then the installability tester correctly rejects "foo".
Though, even with the fix above, the handling for this is probably not
correct if the essential set is not (fully co-)installable. However,
that basically only happens if we are bootstrapping an architecture
(or testing is royally broken, in which case this is the least of our
worries).
Signed-off-by: Niels Thykier <niels@thykier.net>
8 years ago