[gentoo-commits] proj/portage:master commit in: lib/_emerge/resolver/, lib/portage/tests/resolver/, lib/_emerge/
commit: 994ac00aa764615ec6d319c7c1cb8123cf9f2aa1 Author: Zac Medico gentoo org> AuthorDate: Sat Aug 24 22:30:29 2019 + Commit: Zac Medico gentoo org> CommitDate: Sun Sep 1 17:33:54 2019 + URL:https://gitweb.gentoo.org/proj/portage.git/commit/?id=994ac00a _slot_confict_backtrack: consider masking a package matched by all parent atoms (bug 692746) When a slot conflict occurs involving a package that is matched by all involved parent atoms, consider masking the package in order to avoid a possible missed update. The included unit test demonstrates the case fixed by this patch. There are 2 previously existing unit tests that require larger backtracking values in order to succeed with this patch, since more possible solutions are now considered. Bug: https://bugs.gentoo.org/692746 Signed-off-by: Zac Medico gentoo.org> lib/_emerge/depgraph.py| 5 ++ lib/_emerge/resolver/backtracking.py | 9 +++ .../resolver/test_slot_conflict_update_virt.py | 79 ++ .../resolver/test_slot_operator_complete_graph.py | 2 +- .../test_slot_operator_runtime_pkg_mask.py | 2 +- 5 files changed, 95 insertions(+), 2 deletions(-) diff --git a/lib/_emerge/depgraph.py b/lib/_emerge/depgraph.py index 08240af67..6be1b3ec7 100644 --- a/lib/_emerge/depgraph.py +++ b/lib/_emerge/depgraph.py @@ -1768,6 +1768,11 @@ class depgraph(object): debug = "--debug" in self._frozen_config.myopts existing_node = next(self._dynamic_config._package_tracker.match( root, slot_atom, installed=False)) + if existing_node not in conflict_pkgs: + # Even though all parent atoms match existing_node, + # consider masking it in order to avoid a missed update + # as in bug 692746. + conflict_pkgs.append(existing_node) # In order to avoid a missed update, first mask lower versions # that conflict with higher versions (the backtracker visits # these in reverse order). diff --git a/lib/_emerge/resolver/backtracking.py b/lib/_emerge/resolver/backtracking.py index c29b9d42a..99e4565c8 100644 --- a/lib/_emerge/resolver/backtracking.py +++ b/lib/_emerge/resolver/backtracking.py @@ -135,11 +135,20 @@ class Backtracker(object): continue entry_is_valid = False + any_conflict_parents = False for ppkg, patom in runtime_pkg_mask[pkg].get("slot conflict", set()): + any_conflict_parents = True if ppkg not in runtime_pkg_mask: entry_is_valid = True break + else: + if not any_conflict_parents: + # Even though pkg was involved in a slot conflict + # where it was matched by all involved parent atoms, + # consider masking it in order to avoid a missed + # update as in bug 692746. + entry_is_valid = True if not entry_is_valid: return False diff --git a/lib/portage/tests/resolver/test_slot_conflict_update_virt.py b/lib/portage/tests/resolver/test_slot_conflict_update_virt.py new file mode 100644 index 0..0bac095b8 --- /dev/null +++ b/lib/portage/tests/resolver/test_slot_conflict_update_virt.py @@ -0,0 +1,79 @@ +# Copyright 2019 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +from portage.tests import TestCase +from portage.tests.resolver.ResolverPlayground import (ResolverPlayground, + ResolverPlaygroundTestCase) + +class SlotConflictUpdateVirtTestCase(TestCase): + + def testSlotConflictUpdateVirt(self): + + ebuilds = { + "dev-db/mysql-connector-c-6.1.11-r2" : { + "EAPI": "7", + "SLOT" : "0/18" + }, + + "dev-db/mysql-connector-c-8.0.17-r3" : { + "EAPI": "7", + "SLOT" : "0/21" + }, + + "virtual/libmysqlclient-18-r1" : { + "EAPI": "7", + "SLOT" : "0/18", + "RDEPEND": "dev-db/mysql-connector-c:0/18", + }, + + "virtual/libmysqlclient-21" : { + "EAPI": "7", + "SLOT" : "0/21", + "RDEPEND": "dev-db/mysql-connector-c:
[gentoo-commits] proj/portage:master commit in: lib/_emerge/resolver/, lib/portage/tests/resolver/, lib/_emerge/
commit: 994ac00aa764615ec6d319c7c1cb8123cf9f2aa1 Author: Zac Medico gentoo org> AuthorDate: Sat Aug 24 22:30:29 2019 + Commit: Zac Medico gentoo org> CommitDate: Sun Sep 1 17:33:54 2019 + URL:https://gitweb.gentoo.org/proj/portage.git/commit/?id=994ac00a _slot_confict_backtrack: consider masking a package matched by all parent atoms (bug 692746) When a slot conflict occurs involving a package that is matched by all involved parent atoms, consider masking the package in order to avoid a possible missed update. The included unit test demonstrates the case fixed by this patch. There are 2 previously existing unit tests that require larger backtracking values in order to succeed with this patch, since more possible solutions are now considered. Bug: https://bugs.gentoo.org/692746 Signed-off-by: Zac Medico gentoo.org> lib/_emerge/depgraph.py| 5 ++ lib/_emerge/resolver/backtracking.py | 9 +++ .../resolver/test_slot_conflict_update_virt.py | 79 ++ .../resolver/test_slot_operator_complete_graph.py | 2 +- .../test_slot_operator_runtime_pkg_mask.py | 2 +- 5 files changed, 95 insertions(+), 2 deletions(-) diff --git a/lib/_emerge/depgraph.py b/lib/_emerge/depgraph.py index 08240af67..6be1b3ec7 100644 --- a/lib/_emerge/depgraph.py +++ b/lib/_emerge/depgraph.py @@ -1768,6 +1768,11 @@ class depgraph(object): debug = "--debug" in self._frozen_config.myopts existing_node = next(self._dynamic_config._package_tracker.match( root, slot_atom, installed=False)) + if existing_node not in conflict_pkgs: + # Even though all parent atoms match existing_node, + # consider masking it in order to avoid a missed update + # as in bug 692746. + conflict_pkgs.append(existing_node) # In order to avoid a missed update, first mask lower versions # that conflict with higher versions (the backtracker visits # these in reverse order). diff --git a/lib/_emerge/resolver/backtracking.py b/lib/_emerge/resolver/backtracking.py index c29b9d42a..99e4565c8 100644 --- a/lib/_emerge/resolver/backtracking.py +++ b/lib/_emerge/resolver/backtracking.py @@ -135,11 +135,20 @@ class Backtracker(object): continue entry_is_valid = False + any_conflict_parents = False for ppkg, patom in runtime_pkg_mask[pkg].get("slot conflict", set()): + any_conflict_parents = True if ppkg not in runtime_pkg_mask: entry_is_valid = True break + else: + if not any_conflict_parents: + # Even though pkg was involved in a slot conflict + # where it was matched by all involved parent atoms, + # consider masking it in order to avoid a missed + # update as in bug 692746. + entry_is_valid = True if not entry_is_valid: return False diff --git a/lib/portage/tests/resolver/test_slot_conflict_update_virt.py b/lib/portage/tests/resolver/test_slot_conflict_update_virt.py new file mode 100644 index 0..0bac095b8 --- /dev/null +++ b/lib/portage/tests/resolver/test_slot_conflict_update_virt.py @@ -0,0 +1,79 @@ +# Copyright 2019 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +from portage.tests import TestCase +from portage.tests.resolver.ResolverPlayground import (ResolverPlayground, + ResolverPlaygroundTestCase) + +class SlotConflictUpdateVirtTestCase(TestCase): + + def testSlotConflictUpdateVirt(self): + + ebuilds = { + "dev-db/mysql-connector-c-6.1.11-r2" : { + "EAPI": "7", + "SLOT" : "0/18" + }, + + "dev-db/mysql-connector-c-8.0.17-r3" : { + "EAPI": "7", + "SLOT" : "0/21" + }, + + "virtual/libmysqlclient-18-r1" : { + "EAPI": "7", + "SLOT" : "0/18", + "RDEPEND": "dev-db/mysql-connector-c:0/18", + }, + + "virtual/libmysqlclient-21" : { + "EAPI": "7", + "SLOT" : "0/21", + "RDEPEND": "dev-db/mysql-connector-c:
[gentoo-commits] proj/portage:master commit in: lib/_emerge/resolver/, lib/portage/tests/resolver/, lib/_emerge/
commit: 994ac00aa764615ec6d319c7c1cb8123cf9f2aa1 Author: Zac Medico gentoo org> AuthorDate: Sat Aug 24 22:30:29 2019 + Commit: Zac Medico gentoo org> CommitDate: Sun Sep 1 17:33:54 2019 + URL:https://gitweb.gentoo.org/proj/portage.git/commit/?id=994ac00a _slot_confict_backtrack: consider masking a package matched by all parent atoms (bug 692746) When a slot conflict occurs involving a package that is matched by all involved parent atoms, consider masking the package in order to avoid a possible missed update. The included unit test demonstrates the case fixed by this patch. There are 2 previously existing unit tests that require larger backtracking values in order to succeed with this patch, since more possible solutions are now considered. Bug: https://bugs.gentoo.org/692746 Signed-off-by: Zac Medico gentoo.org> lib/_emerge/depgraph.py| 5 ++ lib/_emerge/resolver/backtracking.py | 9 +++ .../resolver/test_slot_conflict_update_virt.py | 79 ++ .../resolver/test_slot_operator_complete_graph.py | 2 +- .../test_slot_operator_runtime_pkg_mask.py | 2 +- 5 files changed, 95 insertions(+), 2 deletions(-) diff --git a/lib/_emerge/depgraph.py b/lib/_emerge/depgraph.py index 08240af67..6be1b3ec7 100644 --- a/lib/_emerge/depgraph.py +++ b/lib/_emerge/depgraph.py @@ -1768,6 +1768,11 @@ class depgraph(object): debug = "--debug" in self._frozen_config.myopts existing_node = next(self._dynamic_config._package_tracker.match( root, slot_atom, installed=False)) + if existing_node not in conflict_pkgs: + # Even though all parent atoms match existing_node, + # consider masking it in order to avoid a missed update + # as in bug 692746. + conflict_pkgs.append(existing_node) # In order to avoid a missed update, first mask lower versions # that conflict with higher versions (the backtracker visits # these in reverse order). diff --git a/lib/_emerge/resolver/backtracking.py b/lib/_emerge/resolver/backtracking.py index c29b9d42a..99e4565c8 100644 --- a/lib/_emerge/resolver/backtracking.py +++ b/lib/_emerge/resolver/backtracking.py @@ -135,11 +135,20 @@ class Backtracker(object): continue entry_is_valid = False + any_conflict_parents = False for ppkg, patom in runtime_pkg_mask[pkg].get("slot conflict", set()): + any_conflict_parents = True if ppkg not in runtime_pkg_mask: entry_is_valid = True break + else: + if not any_conflict_parents: + # Even though pkg was involved in a slot conflict + # where it was matched by all involved parent atoms, + # consider masking it in order to avoid a missed + # update as in bug 692746. + entry_is_valid = True if not entry_is_valid: return False diff --git a/lib/portage/tests/resolver/test_slot_conflict_update_virt.py b/lib/portage/tests/resolver/test_slot_conflict_update_virt.py new file mode 100644 index 0..0bac095b8 --- /dev/null +++ b/lib/portage/tests/resolver/test_slot_conflict_update_virt.py @@ -0,0 +1,79 @@ +# Copyright 2019 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +from portage.tests import TestCase +from portage.tests.resolver.ResolverPlayground import (ResolverPlayground, + ResolverPlaygroundTestCase) + +class SlotConflictUpdateVirtTestCase(TestCase): + + def testSlotConflictUpdateVirt(self): + + ebuilds = { + "dev-db/mysql-connector-c-6.1.11-r2" : { + "EAPI": "7", + "SLOT" : "0/18" + }, + + "dev-db/mysql-connector-c-8.0.17-r3" : { + "EAPI": "7", + "SLOT" : "0/21" + }, + + "virtual/libmysqlclient-18-r1" : { + "EAPI": "7", + "SLOT" : "0/18", + "RDEPEND": "dev-db/mysql-connector-c:0/18", + }, + + "virtual/libmysqlclient-21" : { + "EAPI": "7", + "SLOT" : "0/21", + "RDEPEND": "dev-db/mysql-connector-c:
[gentoo-commits] proj/portage:master commit in: lib/_emerge/resolver/, lib/portage/tests/resolver/, lib/_emerge/
commit: 994ac00aa764615ec6d319c7c1cb8123cf9f2aa1 Author: Zac Medico gentoo org> AuthorDate: Sat Aug 24 22:30:29 2019 + Commit: Zac Medico gentoo org> CommitDate: Sun Sep 1 17:33:54 2019 + URL:https://gitweb.gentoo.org/proj/portage.git/commit/?id=994ac00a _slot_confict_backtrack: consider masking a package matched by all parent atoms (bug 692746) When a slot conflict occurs involving a package that is matched by all involved parent atoms, consider masking the package in order to avoid a possible missed update. The included unit test demonstrates the case fixed by this patch. There are 2 previously existing unit tests that require larger backtracking values in order to succeed with this patch, since more possible solutions are now considered. Bug: https://bugs.gentoo.org/692746 Signed-off-by: Zac Medico gentoo.org> lib/_emerge/depgraph.py| 5 ++ lib/_emerge/resolver/backtracking.py | 9 +++ .../resolver/test_slot_conflict_update_virt.py | 79 ++ .../resolver/test_slot_operator_complete_graph.py | 2 +- .../test_slot_operator_runtime_pkg_mask.py | 2 +- 5 files changed, 95 insertions(+), 2 deletions(-) diff --git a/lib/_emerge/depgraph.py b/lib/_emerge/depgraph.py index 08240af67..6be1b3ec7 100644 --- a/lib/_emerge/depgraph.py +++ b/lib/_emerge/depgraph.py @@ -1768,6 +1768,11 @@ class depgraph(object): debug = "--debug" in self._frozen_config.myopts existing_node = next(self._dynamic_config._package_tracker.match( root, slot_atom, installed=False)) + if existing_node not in conflict_pkgs: + # Even though all parent atoms match existing_node, + # consider masking it in order to avoid a missed update + # as in bug 692746. + conflict_pkgs.append(existing_node) # In order to avoid a missed update, first mask lower versions # that conflict with higher versions (the backtracker visits # these in reverse order). diff --git a/lib/_emerge/resolver/backtracking.py b/lib/_emerge/resolver/backtracking.py index c29b9d42a..99e4565c8 100644 --- a/lib/_emerge/resolver/backtracking.py +++ b/lib/_emerge/resolver/backtracking.py @@ -135,11 +135,20 @@ class Backtracker(object): continue entry_is_valid = False + any_conflict_parents = False for ppkg, patom in runtime_pkg_mask[pkg].get("slot conflict", set()): + any_conflict_parents = True if ppkg not in runtime_pkg_mask: entry_is_valid = True break + else: + if not any_conflict_parents: + # Even though pkg was involved in a slot conflict + # where it was matched by all involved parent atoms, + # consider masking it in order to avoid a missed + # update as in bug 692746. + entry_is_valid = True if not entry_is_valid: return False diff --git a/lib/portage/tests/resolver/test_slot_conflict_update_virt.py b/lib/portage/tests/resolver/test_slot_conflict_update_virt.py new file mode 100644 index 0..0bac095b8 --- /dev/null +++ b/lib/portage/tests/resolver/test_slot_conflict_update_virt.py @@ -0,0 +1,79 @@ +# Copyright 2019 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +from portage.tests import TestCase +from portage.tests.resolver.ResolverPlayground import (ResolverPlayground, + ResolverPlaygroundTestCase) + +class SlotConflictUpdateVirtTestCase(TestCase): + + def testSlotConflictUpdateVirt(self): + + ebuilds = { + "dev-db/mysql-connector-c-6.1.11-r2" : { + "EAPI": "7", + "SLOT" : "0/18" + }, + + "dev-db/mysql-connector-c-8.0.17-r3" : { + "EAPI": "7", + "SLOT" : "0/21" + }, + + "virtual/libmysqlclient-18-r1" : { + "EAPI": "7", + "SLOT" : "0/18", + "RDEPEND": "dev-db/mysql-connector-c:0/18", + }, + + "virtual/libmysqlclient-21" : { + "EAPI": "7", + "SLOT" : "0/21", + "RDEPEND": "dev-db/mysql-connector-c:
[gentoo-commits] proj/portage:master commit in: lib/_emerge/resolver/, lib/portage/tests/resolver/, lib/_emerge/
commit: 994ac00aa764615ec6d319c7c1cb8123cf9f2aa1 Author: Zac Medico gentoo org> AuthorDate: Sat Aug 24 22:30:29 2019 + Commit: Zac Medico gentoo org> CommitDate: Sun Sep 1 17:33:54 2019 + URL:https://gitweb.gentoo.org/proj/portage.git/commit/?id=994ac00a _slot_confict_backtrack: consider masking a package matched by all parent atoms (bug 692746) When a slot conflict occurs involving a package that is matched by all involved parent atoms, consider masking the package in order to avoid a possible missed update. The included unit test demonstrates the case fixed by this patch. There are 2 previously existing unit tests that require larger backtracking values in order to succeed with this patch, since more possible solutions are now considered. Bug: https://bugs.gentoo.org/692746 Signed-off-by: Zac Medico gentoo.org> lib/_emerge/depgraph.py| 5 ++ lib/_emerge/resolver/backtracking.py | 9 +++ .../resolver/test_slot_conflict_update_virt.py | 79 ++ .../resolver/test_slot_operator_complete_graph.py | 2 +- .../test_slot_operator_runtime_pkg_mask.py | 2 +- 5 files changed, 95 insertions(+), 2 deletions(-) diff --git a/lib/_emerge/depgraph.py b/lib/_emerge/depgraph.py index 08240af67..6be1b3ec7 100644 --- a/lib/_emerge/depgraph.py +++ b/lib/_emerge/depgraph.py @@ -1768,6 +1768,11 @@ class depgraph(object): debug = "--debug" in self._frozen_config.myopts existing_node = next(self._dynamic_config._package_tracker.match( root, slot_atom, installed=False)) + if existing_node not in conflict_pkgs: + # Even though all parent atoms match existing_node, + # consider masking it in order to avoid a missed update + # as in bug 692746. + conflict_pkgs.append(existing_node) # In order to avoid a missed update, first mask lower versions # that conflict with higher versions (the backtracker visits # these in reverse order). diff --git a/lib/_emerge/resolver/backtracking.py b/lib/_emerge/resolver/backtracking.py index c29b9d42a..99e4565c8 100644 --- a/lib/_emerge/resolver/backtracking.py +++ b/lib/_emerge/resolver/backtracking.py @@ -135,11 +135,20 @@ class Backtracker(object): continue entry_is_valid = False + any_conflict_parents = False for ppkg, patom in runtime_pkg_mask[pkg].get("slot conflict", set()): + any_conflict_parents = True if ppkg not in runtime_pkg_mask: entry_is_valid = True break + else: + if not any_conflict_parents: + # Even though pkg was involved in a slot conflict + # where it was matched by all involved parent atoms, + # consider masking it in order to avoid a missed + # update as in bug 692746. + entry_is_valid = True if not entry_is_valid: return False diff --git a/lib/portage/tests/resolver/test_slot_conflict_update_virt.py b/lib/portage/tests/resolver/test_slot_conflict_update_virt.py new file mode 100644 index 0..0bac095b8 --- /dev/null +++ b/lib/portage/tests/resolver/test_slot_conflict_update_virt.py @@ -0,0 +1,79 @@ +# Copyright 2019 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +from portage.tests import TestCase +from portage.tests.resolver.ResolverPlayground import (ResolverPlayground, + ResolverPlaygroundTestCase) + +class SlotConflictUpdateVirtTestCase(TestCase): + + def testSlotConflictUpdateVirt(self): + + ebuilds = { + "dev-db/mysql-connector-c-6.1.11-r2" : { + "EAPI": "7", + "SLOT" : "0/18" + }, + + "dev-db/mysql-connector-c-8.0.17-r3" : { + "EAPI": "7", + "SLOT" : "0/21" + }, + + "virtual/libmysqlclient-18-r1" : { + "EAPI": "7", + "SLOT" : "0/18", + "RDEPEND": "dev-db/mysql-connector-c:0/18", + }, + + "virtual/libmysqlclient-21" : { + "EAPI": "7", + "SLOT" : "0/21", + "RDEPEND": "dev-db/mysql-connector-c:
[gentoo-commits] proj/portage:master commit in: lib/_emerge/resolver/, lib/portage/tests/resolver/, lib/_emerge/
commit: 994ac00aa764615ec6d319c7c1cb8123cf9f2aa1 Author: Zac Medico gentoo org> AuthorDate: Sat Aug 24 22:30:29 2019 + Commit: Zac Medico gentoo org> CommitDate: Sun Sep 1 17:33:54 2019 + URL:https://gitweb.gentoo.org/proj/portage.git/commit/?id=994ac00a _slot_confict_backtrack: consider masking a package matched by all parent atoms (bug 692746) When a slot conflict occurs involving a package that is matched by all involved parent atoms, consider masking the package in order to avoid a possible missed update. The included unit test demonstrates the case fixed by this patch. There are 2 previously existing unit tests that require larger backtracking values in order to succeed with this patch, since more possible solutions are now considered. Bug: https://bugs.gentoo.org/692746 Signed-off-by: Zac Medico gentoo.org> lib/_emerge/depgraph.py| 5 ++ lib/_emerge/resolver/backtracking.py | 9 +++ .../resolver/test_slot_conflict_update_virt.py | 79 ++ .../resolver/test_slot_operator_complete_graph.py | 2 +- .../test_slot_operator_runtime_pkg_mask.py | 2 +- 5 files changed, 95 insertions(+), 2 deletions(-) diff --git a/lib/_emerge/depgraph.py b/lib/_emerge/depgraph.py index 08240af67..6be1b3ec7 100644 --- a/lib/_emerge/depgraph.py +++ b/lib/_emerge/depgraph.py @@ -1768,6 +1768,11 @@ class depgraph(object): debug = "--debug" in self._frozen_config.myopts existing_node = next(self._dynamic_config._package_tracker.match( root, slot_atom, installed=False)) + if existing_node not in conflict_pkgs: + # Even though all parent atoms match existing_node, + # consider masking it in order to avoid a missed update + # as in bug 692746. + conflict_pkgs.append(existing_node) # In order to avoid a missed update, first mask lower versions # that conflict with higher versions (the backtracker visits # these in reverse order). diff --git a/lib/_emerge/resolver/backtracking.py b/lib/_emerge/resolver/backtracking.py index c29b9d42a..99e4565c8 100644 --- a/lib/_emerge/resolver/backtracking.py +++ b/lib/_emerge/resolver/backtracking.py @@ -135,11 +135,20 @@ class Backtracker(object): continue entry_is_valid = False + any_conflict_parents = False for ppkg, patom in runtime_pkg_mask[pkg].get("slot conflict", set()): + any_conflict_parents = True if ppkg not in runtime_pkg_mask: entry_is_valid = True break + else: + if not any_conflict_parents: + # Even though pkg was involved in a slot conflict + # where it was matched by all involved parent atoms, + # consider masking it in order to avoid a missed + # update as in bug 692746. + entry_is_valid = True if not entry_is_valid: return False diff --git a/lib/portage/tests/resolver/test_slot_conflict_update_virt.py b/lib/portage/tests/resolver/test_slot_conflict_update_virt.py new file mode 100644 index 0..0bac095b8 --- /dev/null +++ b/lib/portage/tests/resolver/test_slot_conflict_update_virt.py @@ -0,0 +1,79 @@ +# Copyright 2019 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +from portage.tests import TestCase +from portage.tests.resolver.ResolverPlayground import (ResolverPlayground, + ResolverPlaygroundTestCase) + +class SlotConflictUpdateVirtTestCase(TestCase): + + def testSlotConflictUpdateVirt(self): + + ebuilds = { + "dev-db/mysql-connector-c-6.1.11-r2" : { + "EAPI": "7", + "SLOT" : "0/18" + }, + + "dev-db/mysql-connector-c-8.0.17-r3" : { + "EAPI": "7", + "SLOT" : "0/21" + }, + + "virtual/libmysqlclient-18-r1" : { + "EAPI": "7", + "SLOT" : "0/18", + "RDEPEND": "dev-db/mysql-connector-c:0/18", + }, + + "virtual/libmysqlclient-21" : { + "EAPI": "7", + "SLOT" : "0/21", + "RDEPEND": "dev-db/mysql-connector-c:
[gentoo-commits] proj/portage:master commit in: lib/_emerge/resolver/, lib/portage/tests/resolver/, lib/_emerge/
commit: 994ac00aa764615ec6d319c7c1cb8123cf9f2aa1 Author: Zac Medico gentoo org> AuthorDate: Sat Aug 24 22:30:29 2019 + Commit: Zac Medico gentoo org> CommitDate: Sun Sep 1 17:33:54 2019 + URL:https://gitweb.gentoo.org/proj/portage.git/commit/?id=994ac00a _slot_confict_backtrack: consider masking a package matched by all parent atoms (bug 692746) When a slot conflict occurs involving a package that is matched by all involved parent atoms, consider masking the package in order to avoid a possible missed update. The included unit test demonstrates the case fixed by this patch. There are 2 previously existing unit tests that require larger backtracking values in order to succeed with this patch, since more possible solutions are now considered. Bug: https://bugs.gentoo.org/692746 Signed-off-by: Zac Medico gentoo.org> lib/_emerge/depgraph.py| 5 ++ lib/_emerge/resolver/backtracking.py | 9 +++ .../resolver/test_slot_conflict_update_virt.py | 79 ++ .../resolver/test_slot_operator_complete_graph.py | 2 +- .../test_slot_operator_runtime_pkg_mask.py | 2 +- 5 files changed, 95 insertions(+), 2 deletions(-) diff --git a/lib/_emerge/depgraph.py b/lib/_emerge/depgraph.py index 08240af67..6be1b3ec7 100644 --- a/lib/_emerge/depgraph.py +++ b/lib/_emerge/depgraph.py @@ -1768,6 +1768,11 @@ class depgraph(object): debug = "--debug" in self._frozen_config.myopts existing_node = next(self._dynamic_config._package_tracker.match( root, slot_atom, installed=False)) + if existing_node not in conflict_pkgs: + # Even though all parent atoms match existing_node, + # consider masking it in order to avoid a missed update + # as in bug 692746. + conflict_pkgs.append(existing_node) # In order to avoid a missed update, first mask lower versions # that conflict with higher versions (the backtracker visits # these in reverse order). diff --git a/lib/_emerge/resolver/backtracking.py b/lib/_emerge/resolver/backtracking.py index c29b9d42a..99e4565c8 100644 --- a/lib/_emerge/resolver/backtracking.py +++ b/lib/_emerge/resolver/backtracking.py @@ -135,11 +135,20 @@ class Backtracker(object): continue entry_is_valid = False + any_conflict_parents = False for ppkg, patom in runtime_pkg_mask[pkg].get("slot conflict", set()): + any_conflict_parents = True if ppkg not in runtime_pkg_mask: entry_is_valid = True break + else: + if not any_conflict_parents: + # Even though pkg was involved in a slot conflict + # where it was matched by all involved parent atoms, + # consider masking it in order to avoid a missed + # update as in bug 692746. + entry_is_valid = True if not entry_is_valid: return False diff --git a/lib/portage/tests/resolver/test_slot_conflict_update_virt.py b/lib/portage/tests/resolver/test_slot_conflict_update_virt.py new file mode 100644 index 0..0bac095b8 --- /dev/null +++ b/lib/portage/tests/resolver/test_slot_conflict_update_virt.py @@ -0,0 +1,79 @@ +# Copyright 2019 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +from portage.tests import TestCase +from portage.tests.resolver.ResolverPlayground import (ResolverPlayground, + ResolverPlaygroundTestCase) + +class SlotConflictUpdateVirtTestCase(TestCase): + + def testSlotConflictUpdateVirt(self): + + ebuilds = { + "dev-db/mysql-connector-c-6.1.11-r2" : { + "EAPI": "7", + "SLOT" : "0/18" + }, + + "dev-db/mysql-connector-c-8.0.17-r3" : { + "EAPI": "7", + "SLOT" : "0/21" + }, + + "virtual/libmysqlclient-18-r1" : { + "EAPI": "7", + "SLOT" : "0/18", + "RDEPEND": "dev-db/mysql-connector-c:0/18", + }, + + "virtual/libmysqlclient-21" : { + "EAPI": "7", + "SLOT" : "0/21", + "RDEPEND": "dev-db/mysql-connector-c:
[gentoo-commits] proj/portage:master commit in: lib/_emerge/resolver/, lib/portage/tests/resolver/, lib/_emerge/
commit: 994ac00aa764615ec6d319c7c1cb8123cf9f2aa1 Author: Zac Medico gentoo org> AuthorDate: Sat Aug 24 22:30:29 2019 + Commit: Zac Medico gentoo org> CommitDate: Sun Sep 1 17:33:54 2019 + URL:https://gitweb.gentoo.org/proj/portage.git/commit/?id=994ac00a _slot_confict_backtrack: consider masking a package matched by all parent atoms (bug 692746) When a slot conflict occurs involving a package that is matched by all involved parent atoms, consider masking the package in order to avoid a possible missed update. The included unit test demonstrates the case fixed by this patch. There are 2 previously existing unit tests that require larger backtracking values in order to succeed with this patch, since more possible solutions are now considered. Bug: https://bugs.gentoo.org/692746 Signed-off-by: Zac Medico gentoo.org> lib/_emerge/depgraph.py| 5 ++ lib/_emerge/resolver/backtracking.py | 9 +++ .../resolver/test_slot_conflict_update_virt.py | 79 ++ .../resolver/test_slot_operator_complete_graph.py | 2 +- .../test_slot_operator_runtime_pkg_mask.py | 2 +- 5 files changed, 95 insertions(+), 2 deletions(-) diff --git a/lib/_emerge/depgraph.py b/lib/_emerge/depgraph.py index 08240af67..6be1b3ec7 100644 --- a/lib/_emerge/depgraph.py +++ b/lib/_emerge/depgraph.py @@ -1768,6 +1768,11 @@ class depgraph(object): debug = "--debug" in self._frozen_config.myopts existing_node = next(self._dynamic_config._package_tracker.match( root, slot_atom, installed=False)) + if existing_node not in conflict_pkgs: + # Even though all parent atoms match existing_node, + # consider masking it in order to avoid a missed update + # as in bug 692746. + conflict_pkgs.append(existing_node) # In order to avoid a missed update, first mask lower versions # that conflict with higher versions (the backtracker visits # these in reverse order). diff --git a/lib/_emerge/resolver/backtracking.py b/lib/_emerge/resolver/backtracking.py index c29b9d42a..99e4565c8 100644 --- a/lib/_emerge/resolver/backtracking.py +++ b/lib/_emerge/resolver/backtracking.py @@ -135,11 +135,20 @@ class Backtracker(object): continue entry_is_valid = False + any_conflict_parents = False for ppkg, patom in runtime_pkg_mask[pkg].get("slot conflict", set()): + any_conflict_parents = True if ppkg not in runtime_pkg_mask: entry_is_valid = True break + else: + if not any_conflict_parents: + # Even though pkg was involved in a slot conflict + # where it was matched by all involved parent atoms, + # consider masking it in order to avoid a missed + # update as in bug 692746. + entry_is_valid = True if not entry_is_valid: return False diff --git a/lib/portage/tests/resolver/test_slot_conflict_update_virt.py b/lib/portage/tests/resolver/test_slot_conflict_update_virt.py new file mode 100644 index 0..0bac095b8 --- /dev/null +++ b/lib/portage/tests/resolver/test_slot_conflict_update_virt.py @@ -0,0 +1,79 @@ +# Copyright 2019 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +from portage.tests import TestCase +from portage.tests.resolver.ResolverPlayground import (ResolverPlayground, + ResolverPlaygroundTestCase) + +class SlotConflictUpdateVirtTestCase(TestCase): + + def testSlotConflictUpdateVirt(self): + + ebuilds = { + "dev-db/mysql-connector-c-6.1.11-r2" : { + "EAPI": "7", + "SLOT" : "0/18" + }, + + "dev-db/mysql-connector-c-8.0.17-r3" : { + "EAPI": "7", + "SLOT" : "0/21" + }, + + "virtual/libmysqlclient-18-r1" : { + "EAPI": "7", + "SLOT" : "0/18", + "RDEPEND": "dev-db/mysql-connector-c:0/18", + }, + + "virtual/libmysqlclient-21" : { + "EAPI": "7", + "SLOT" : "0/21", + "RDEPEND": "dev-db/mysql-connector-c: