From 4c25c0d7af7ad71fccbfafe1e5019116c691968e Mon Sep 17 00:00:00 2001 From: Zac Medico Date: Sun, 10 Jan 2021 16:19:06 -0800 Subject: check_reverse_dependencies: dereference virtual expansions (bug 764764) If an atom is the result of virtual expansion, then derefrence it to _orig_atom in check_reverse_dependencies so that it will be correctly handled as a built slot operator dependency when appropriate. This solves a case triggered in bug 764764 where a virtual expansion from virtual/dist-kernel:0/5.10.5= to =virtual/dist-kernel-5.10.5 prevented the atom from being handled as a built slot operator dependency, which prevented rebuilds from being triggered. Bug: https://bugs.gentoo.org/764764 Signed-off-by: Zac Medico --- lib/_emerge/depgraph.py | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) (limited to 'lib/_emerge/depgraph.py') diff --git a/lib/_emerge/depgraph.py b/lib/_emerge/depgraph.py index f3e834a60..2bf04406f 100644 --- a/lib/_emerge/depgraph.py +++ b/lib/_emerge/depgraph.py @@ -2073,6 +2073,12 @@ class depgraph: for parent, atom in self._dynamic_config._parent_atoms.get(existing_pkg, []): if isinstance(parent, Package): if parent in built_slot_operator_parents: + if hasattr(atom, '_orig_atom'): + # If atom is the result of virtual expansion, then + # derefrence it to _orig_atom so that it will be correctly + # handled as a built slot operator dependency when + # appropriate (see bug 764764). + atom = atom._orig_atom # This parent may need to be rebuilt, therefore # discard its soname and built slot operator # dependency components which are not necessarily @@ -2131,6 +2137,22 @@ class depgraph: allow_repo=True) if not atom_set.findAtomForPackage(candidate_pkg, modified_use=self._pkg_use_enabled(candidate_pkg)): + if debug: + parent_atoms = [] + for other_parent, other_atom in self._dynamic_config._parent_atoms.get(existing_pkg, []): + if other_parent is parent: + parent_atoms.append(other_atom) + msg = ( + "", + "", + "check_reverse_dependencies:", + " candidate package does not match atom '%s': %s" % (atom, candidate_pkg), + " parent: %s" % parent, + " parent atoms: %s" % " ".join(parent_atoms), + "", + ) + writemsg_level("\n".join(msg), + noiselevel=-1, level=logging.DEBUG) return False return True -- cgit v1.2.3-65-gdbad