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.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id 91225158099 for ; Sat, 25 Nov 2023 06:30:23 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id BB7DC2BC01A; Sat, 25 Nov 2023 06:30:22 +0000 (UTC) Received: from smtp.gentoo.org (woodpecker.gentoo.org [140.211.166.183]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id 9A8EF2BC01A for ; Sat, 25 Nov 2023 06:30:22 +0000 (UTC) Received: from oystercatcher.gentoo.org (oystercatcher.gentoo.org [148.251.78.52]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 98C3233E3A9 for ; Sat, 25 Nov 2023 06:30:21 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id F346EBB1 for ; Sat, 25 Nov 2023 06:30:19 +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: <1700691973.cdc781349337fa755bc15773e2a87e4b41f5ff1e.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_alternatives_gzip.py lib/portage/tests/resolver/test_merge_order.py lib/portage/tests/resolver/test_rebuild_ghostscript.py X-VCS-Directories: lib/portage/tests/resolver/ lib/_emerge/ X-VCS-Committer: zmedico X-VCS-Committer-Name: Zac Medico X-VCS-Revision: cdc781349337fa755bc15773e2a87e4b41f5ff1e X-VCS-Branch: master Date: Sat, 25 Nov 2023 06:30:19 +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: 70fcf5ae-0790-407d-986e-b00d8543c2a4 X-Archives-Hash: c2fa02b18e1d3591bc4380779d512df1 commit: cdc781349337fa755bc15773e2a87e4b41f5ff1e Author: Zac Medico gentoo org> AuthorDate: Wed Nov 22 21:46:12 2023 +0000 Commit: Zac Medico gentoo org> CommitDate: Wed Nov 22 22:26:13 2023 +0000 URL: https://gitweb.gentoo.org/proj/portage.git/commit/?id=cdc78134 Revert "find_smallest_cycle: Increase ignore_priority to find smaller cycles" This reverts commit 9206d5a75ecd2d9ae0fe63e57d28aa8061b5927e. The len(smallest_cycle) == 1 loop termination condition is not optimal and it's too expensive as reported in bug 917660. Bug: https://bugs.gentoo.org/917660 Bug: https://bugs.gentoo.org/917259 Signed-off-by: Zac Medico gentoo.org> lib/_emerge/depgraph.py | 7 +++---- .../tests/resolver/test_alternatives_gzip.py | 7 +++++-- lib/portage/tests/resolver/test_merge_order.py | 24 ++++++++++------------ .../tests/resolver/test_rebuild_ghostscript.py | 6 +++--- 4 files changed, 22 insertions(+), 22 deletions(-) diff --git a/lib/_emerge/depgraph.py b/lib/_emerge/depgraph.py index 0d3b37c698..e4305c18c9 100644 --- a/lib/_emerge/depgraph.py +++ b/lib/_emerge/depgraph.py @@ -9345,10 +9345,9 @@ class depgraph: smallest_cycle = selected_nodes ignore_priority = priority - if smallest_cycle is not None and len(smallest_cycle) == 1: - # The cycle can't get any smaller than this, - # so there is no need to search further since - # we try to minimize ignore_priority. + # Exit this loop with the lowest possible priority, which + # minimizes the use of installed packages to break cycles. + if smallest_cycle is not None: break return smallest_cycle, ignore_priority diff --git a/lib/portage/tests/resolver/test_alternatives_gzip.py b/lib/portage/tests/resolver/test_alternatives_gzip.py index 7cd1da25f1..602ed1756f 100644 --- a/lib/portage/tests/resolver/test_alternatives_gzip.py +++ b/lib/portage/tests/resolver/test_alternatives_gzip.py @@ -1,6 +1,8 @@ # Copyright 2023 Gentoo Authors # Distributed under the terms of the GNU General Public License v2 +import pytest + from portage.tests import TestCase from portage.tests.resolver.ResolverPlayground import ( ResolverPlayground, @@ -8,6 +10,7 @@ from portage.tests.resolver.ResolverPlayground import ( ) +@pytest.mark.xfail() class AlternativesGzipTestCase(TestCase): def testAlternativesGzip(self): """ @@ -16,8 +19,8 @@ class AlternativesGzipTestCase(TestCase): find_smallest_cycle selects a large cycle and the topological sort produces poor results when leaf_nodes returns app-alternatives/gzip as part of a large group of nodes. - This problem was solved by increasing ignore_priority in order - to find a smaller cycle. + This problem might be solved by implementing a finer-grained + ignore_priority for leaf_nodes calls. """ ebuilds = { "app-alternatives/gzip-1": { diff --git a/lib/portage/tests/resolver/test_merge_order.py b/lib/portage/tests/resolver/test_merge_order.py index 671543ca29..940eb3bbbe 100644 --- a/lib/portage/tests/resolver/test_merge_order.py +++ b/lib/portage/tests/resolver/test_merge_order.py @@ -382,12 +382,10 @@ class MergeOrderTestCase(TestCase): ambiguous_merge_order=True, # The following merge order assertion reflects optimal order for # a circular relationship which is DEPEND in one direction and - # RDEPEND in the other. However, it is not respected because - # it would result in a temporarily broken RDEPEND, so we instead - # rely on satisfied installed build-time dependencies. - # merge_order_assertions=( - # ("app-misc/circ-buildtime-a-1", "app-misc/circ-buildtime-c-1"), - # ), + # RDEPEND in the other. + merge_order_assertions=( + ("app-misc/circ-buildtime-a-1", "app-misc/circ-buildtime-c-1"), + ), mergelist=[ ( "app-misc/circ-buildtime-b-1", @@ -701,15 +699,15 @@ class MergeOrderTestCase(TestCase): "!app-misc/installed-blocker-a", "app-misc/circ-direct-a-1", "app-misc/circ-direct-b-1", - "app-misc/circ-satisfied-a-1", - "app-misc/circ-satisfied-c-1", - "app-misc/circ-satisfied-b-1", - "app-misc/circ-buildtime-c-1", - "app-misc/circ-buildtime-b-1", - "app-misc/circ-buildtime-a-1", - "app-misc/some-app-c-1", "x11-base/xorg-server-1.14.1", "media-libs/mesa-9.1.3", + "app-misc/circ-buildtime-a-1", + "app-misc/circ-buildtime-b-1", + "app-misc/circ-buildtime-c-1", + "app-misc/some-app-c-1", + "app-misc/circ-satisfied-a-1", + "app-misc/circ-satisfied-b-1", + "app-misc/circ-satisfied-c-1", ], ), ) diff --git a/lib/portage/tests/resolver/test_rebuild_ghostscript.py b/lib/portage/tests/resolver/test_rebuild_ghostscript.py index e1d736610e..8d7cbb1f92 100644 --- a/lib/portage/tests/resolver/test_rebuild_ghostscript.py +++ b/lib/portage/tests/resolver/test_rebuild_ghostscript.py @@ -136,12 +136,12 @@ class RebuildGhostscriptTestCase(TestCase): success=True, mergelist=[ "sys-apps/dbus-1.15.6", + "x11-libs/gtk+-3.24.38", + "net-print/cups-2.4.6", + "net-dns/avahi-0.8-r7", "app-text/ghostscript-gpl-10.01.2", "app-text/libspectre-0.2.12", "x11-libs/goffice-0.10.55", - "net-dns/avahi-0.8-r7", - "net-print/cups-2.4.6", - "x11-libs/gtk+-3.24.38", ], ), )