Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 632202 - sys-apps/portage: slot conflict solver interferes with @preserved-rebuild
Summary: sys-apps/portage: slot conflict solver interferes with @preserved-rebuild
Status: RESOLVED FIXED
Alias: None
Product: Portage Development
Classification: Unclassified
Component: Core - Interface (emerge) (show other bugs)
Hardware: All All
: Normal normal
Assignee: Portage team
URL:
Whiteboard:
Keywords: InVCS
Depends on:
Blocks: 155723 631448
  Show dependency tree
 
Reported: 2017-09-27 22:44 UTC by Zac Medico
Modified: 2018-02-01 23:54 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Zac Medico gentoo-dev 2017-09-27 22:44:22 UTC
It's possible for the depgraph _solve_non_slot_operator_slot_conflicts to eliminate packages that @preserved-rebuild has selected for rebuild. In this case, it's better to allow the conflict to be resolved by backtracking, which will ultimately choose a version to build that doesn't trigger a conflict. This quick-and-dirty patch solved the problem for me:

diff --git a/pym/_emerge/depgraph.py b/pym/_emerge/depgraph.py
index 785c036b8..2afbc7b9c 100644
--- a/pym/_emerge/depgraph.py
+++ b/pym/_emerge/depgraph.py
@@ -1336,6 +1336,13 @@ class depgraph(object):
 				all_parent_atoms.update(
 					self._dynamic_config._parent_atoms.get(pkg, []))
 
+			if (inst_pkg is not None and
+				not self._want_installed_pkg(inst_pkg)):
+				for pkg in sorted(conflict, reverse=True):
+					if not pkg.installed:
+						non_matching_forced.add(pkg)
+						break
+
 			for parent, atom in all_parent_atoms:
 				is_arg_parent = isinstance(parent, AtomArg)
 				is_non_conflict_parent = parent not in conflict_pkgs and \
Comment 1 Zac Medico gentoo-dev 2017-09-28 01:08:25 UTC
This fix is better but it makes SlotConflictUpdateTestCase fail the same way as bug 632210:

diff --git a/pym/_emerge/depgraph.py b/pym/_emerge/depgraph.py
index 785c036b8..f0de40178 100644
--- a/pym/_emerge/depgraph.py
+++ b/pym/_emerge/depgraph.py
@@ -1337,7 +1337,8 @@ class depgraph(object):
 					self._dynamic_config._parent_atoms.get(pkg, []))
 
 			for parent, atom in all_parent_atoms:
-				is_arg_parent = isinstance(parent, AtomArg)
+				is_arg_parent = (inst_pkg is not None and
+					not self._want_installed_pkg(inst_pkg))
Comment 2 Zac Medico gentoo-dev 2017-09-29 08:20:19 UTC
Patch sent for review:

https://github.com/gentoo/portage/pull/211
Comment 4 Zac Medico gentoo-dev 2017-10-02 19:37:18 UTC
Released in 2.3.11.