1 |
Prefer choices that minimize conflict atoms, so that choices |
2 |
which satisfy all parents are preferred. This reduces the |
3 |
minimum necessary backtrack tries from 21 to 7 for the unit |
4 |
test related to bug 743115. |
5 |
|
6 |
Bug: https://bugs.gentoo.org/743115 |
7 |
Bug: https://bugs.gentoo.org/743631 |
8 |
Signed-off-by: Zac Medico <zmedico@g.o> |
9 |
--- |
10 |
lib/_emerge/depgraph.py | 6 ++++++ |
11 |
.../tests/resolver/test_slot_operator_missed_update.py | 2 +- |
12 |
2 files changed, 7 insertions(+), 1 deletion(-) |
13 |
|
14 |
diff --git a/lib/_emerge/depgraph.py b/lib/_emerge/depgraph.py |
15 |
index 3f864aefc..40e7d1325 100644 |
16 |
--- a/lib/_emerge/depgraph.py |
17 |
+++ b/lib/_emerge/depgraph.py |
18 |
@@ -1797,6 +1797,12 @@ class depgraph: |
19 |
if parent_atom not in parent_atoms) |
20 |
backtrack_data.append((to_be_masked, conflict_atoms)) |
21 |
|
22 |
+ # Prefer choices that minimize conflict atoms. This is intended |
23 |
+ # to take precedence over the earlier package version sort. The |
24 |
+ # package version sort is still needed or else the |
25 |
+ # testOverlapSlotConflict method of VirtualMinimizeChildrenTestCase |
26 |
+ # will not succeed reliably with the default backtrack limit. |
27 |
+ backtrack_data.sort(key=lambda item: len(item[1])) |
28 |
to_be_masked = backtrack_data[-1][0] |
29 |
|
30 |
self._dynamic_config._backtrack_infos.setdefault( |
31 |
diff --git a/lib/portage/tests/resolver/test_slot_operator_missed_update.py b/lib/portage/tests/resolver/test_slot_operator_missed_update.py |
32 |
index fce012f62..1ea701003 100644 |
33 |
--- a/lib/portage/tests/resolver/test_slot_operator_missed_update.py |
34 |
+++ b/lib/portage/tests/resolver/test_slot_operator_missed_update.py |
35 |
@@ -90,7 +90,7 @@ class BacktrackMissedUpdateTestCase(TestCase): |
36 |
# Bug 743115: missed updates trigger excessive backtracking |
37 |
ResolverPlaygroundTestCase( |
38 |
[">=dev-python/pypy3-7.3.2_rc", "@world"], |
39 |
- options={"--update": True, "--deep": True, "--backtrack": 25}, |
40 |
+ options={"--update": True, "--deep": True, "--backtrack": 10}, |
41 |
success=True, |
42 |
mergelist=[ |
43 |
"dev-python/pypy3-7.3.2_rc2_p37-r1", |
44 |
-- |
45 |
2.25.3 |