From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id E42301382C5 for ; Mon, 11 Jan 2021 07:27:34 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id ED38CE0A6D; Mon, 11 Jan 2021 07:27:33 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [IPv6:2001:470:ea4a:1:5054:ff:fec7:86e4]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id C1C84E0A6D for ; Mon, 11 Jan 2021 07:27:33 +0000 (UTC) Received: from oystercatcher.gentoo.org (oystercatcher.gentoo.org [148.251.78.52]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 1CCC8340F15 for ; Mon, 11 Jan 2021 07:27:32 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id 7CA604C for ; Mon, 11 Jan 2021 07:27:30 +0000 (UTC) From: "Zac Medico" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Zac Medico" Message-ID: <1610335965.4c25c0d7af7ad71fccbfafe1e5019116c691968e.zmedico@gentoo> Subject: [gentoo-commits] proj/portage:master commit in: lib/portage/tests/resolver/, lib/_emerge/ X-VCS-Repository: proj/portage X-VCS-Files: lib/_emerge/depgraph.py lib/portage/tests/resolver/test_slot_operator_reverse_deps.py X-VCS-Directories: lib/portage/tests/resolver/ lib/_emerge/ X-VCS-Committer: zmedico X-VCS-Committer-Name: Zac Medico X-VCS-Revision: 4c25c0d7af7ad71fccbfafe1e5019116c691968e X-VCS-Branch: master Date: Mon, 11 Jan 2021 07:27:30 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply X-Archives-Salt: 763aa3f5-0208-4484-a285-123196500ba9 X-Archives-Hash: 50fce324f34bbcd76ed7b775df2d5df1 commit: 4c25c0d7af7ad71fccbfafe1e5019116c691968e Author: Zac Medico gentoo org> AuthorDate: Mon Jan 11 00:19:06 2021 +0000 Commit: Zac Medico gentoo org> CommitDate: Mon Jan 11 03:32:45 2021 +0000 URL: https://gitweb.gentoo.org/proj/portage.git/commit/?id=4c25c0d7 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 gentoo.org> lib/_emerge/depgraph.py | 22 ++++++++++++++++++++++ .../resolver/test_slot_operator_reverse_deps.py | 2 +- 2 files changed, 23 insertions(+), 1 deletion(-) 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 diff --git a/lib/portage/tests/resolver/test_slot_operator_reverse_deps.py b/lib/portage/tests/resolver/test_slot_operator_reverse_deps.py index 6e7214043..ef884f8ca 100644 --- a/lib/portage/tests/resolver/test_slot_operator_reverse_deps.py +++ b/lib/portage/tests/resolver/test_slot_operator_reverse_deps.py @@ -284,7 +284,7 @@ class SlotOperatorReverseDepsVirtualTestCase(TestCase): ["@world"], options = {"--update": True, "--deep": True}, success = True, - mergelist = [] + mergelist = ['sys-kernel/gentoo-kernel-5.10.6', 'virtual/dist-kernel-5.10.6', 'app-emulation/virtualbox-modules-6.1.16-r1', 'x11-drivers/nvidia-drivers-460.32.03'] ), )