diff --git a/lib/_emerge/depgraph.py b/lib/_emerge/depgraph.py index 28acfed9d..4ce7beef3 100644 --- a/lib/_emerge/depgraph.py +++ b/lib/_emerge/depgraph.py @@ -1872,6 +1872,24 @@ class depgraph: if self._dynamic_config._allow_backtracking: self._slot_operator_trigger_reinstalls() + # When there needs to be additional slot operator rebuilds, + # _solve_non_slot_operator_slot_conflicts is not aware of them, + # so it ends up pulling in subslot dependencies according to the + # installed subslots. This causes "slot conflict" entries to be added + # to backtrack infos, and portage would backtrack by masking each + # version. This is not ideal because portage now have to do multiple + # backtracks, for each version masked. It also implies that portage + # is attempting to pull in those versions, and this may cause issues + # during subslot rebuild pruning. Instead of that, let portage solve + # slot operator rebuilds first, then backtrack on slot conflicts, if + # they are truly necessary after slot operator rebuilds are considered. + if self._dynamic_config._backtrack_infos.setdefault("config", {}).get( + "slot_operator_replace_installed", set() + ): + if "slot conflict" in self._dynamic_config._backtrack_infos: + del self._dynamic_config._backtrack_infos["slot conflict"] + return + def _process_slot_conflict(self, conflict): """ Process slot conflict data to identify specific atoms which