From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from pigeon.gentoo.org ([208.92.234.80] helo=lists.gentoo.org) by finch.gentoo.org with esmtp (Exim 4.60) (envelope-from ) id 1QVtg1-0004yz-Cl for garchives@archives.gentoo.org; Sun, 12 Jun 2011 23:02:41 +0000 Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 01E8D1C10C for ; Sun, 12 Jun 2011 23:02:40 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) by pigeon.gentoo.org (Postfix) with ESMTP id C41771C0B3 for ; Sun, 12 Jun 2011 22:13:54 +0000 (UTC) Received: from pelican.gentoo.org (unknown [66.219.59.40]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 36FBA1B4007 for ; Sun, 12 Jun 2011 22:13:54 +0000 (UTC) Received: from localhost.localdomain (localhost [127.0.0.1]) by pelican.gentoo.org (Postfix) with ESMTP id 433EA8003C for ; Sun, 12 Jun 2011 22:13:53 +0000 (UTC) From: "Zac Medico" To: gentoo-commits@lists.gentoo.org Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Zac Medico" Message-ID: Subject: [gentoo-commits] proj/portage:master commit in: pym/portage/tests/resolver/, pym/_emerge/ X-VCS-Repository: proj/portage X-VCS-Files: pym/_emerge/depgraph.py pym/portage/tests/resolver/test_merge_order.py X-VCS-Directories: pym/portage/tests/resolver/ pym/_emerge/ X-VCS-Committer: zmedico X-VCS-Committer-Name: Zac Medico X-VCS-Revision: c754569663408e515fa134c52c7b3b8a1bb15181 Date: Sun, 12 Jun 2011 22:13:53 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: quoted-printable X-Archives-Salt: X-Archives-Hash: 4f17fd5cd279403e47b47d29575375f0 commit: c754569663408e515fa134c52c7b3b8a1bb15181 Author: Zac Medico gentoo org> AuthorDate: Sun Jun 12 22:12:26 2011 +0000 Commit: Zac Medico gentoo org> CommitDate: Sun Jun 12 22:12:26 2011 +0000 URL: http://git.overlays.gentoo.org/gitweb/?p=3Dproj/portage.git;a= =3Dcommit;h=3Dc7545696 test_merge_order: test smallest runtime cycle In the case of multiple runtime cycles, where some cycles may depend on smaller independent cycles, it's optimal to merge smaller independent cycles before other cycles that depend on them. Therefore, we search for the smallest cycle in order to try and identify and prefer these smaller independent cycles. --- pym/_emerge/depgraph.py | 6 ++++ pym/portage/tests/resolver/test_merge_order.py | 33 ++++++++++++++++++= ++++++ 2 files changed, 39 insertions(+), 0 deletions(-) diff --git a/pym/_emerge/depgraph.py b/pym/_emerge/depgraph.py index 3b47c35..9ce199b 100644 --- a/pym/_emerge/depgraph.py +++ b/pym/_emerge/depgraph.py @@ -5022,6 +5022,12 @@ class depgraph(object): # we want to minimize the number of nodes gathered, since # this tends to produce a more optimal merge order. # Ignoring all medium_soft deps serves this purpose. + # In the case of multiple runtime cycles, where some cycles + # may depend on smaller independent cycles, it's optimal + # to merge smaller independent cycles before other cycles + # that depend on them. Therefore, we search for the + # smallest cycle in order to try and identify and prefer + # these smaller independent cycles. ignore_priority =3D priority_range.ignore_medium_soft smallest_cycle =3D None for node in nodes: diff --git a/pym/portage/tests/resolver/test_merge_order.py b/pym/portage= /tests/resolver/test_merge_order.py index e94b6c7..0a52c81 100644 --- a/pym/portage/tests/resolver/test_merge_order.py +++ b/pym/portage/tests/resolver/test_merge_order.py @@ -81,6 +81,27 @@ class MergeOrderTestCase(TestCase): "DEPEND": "app-misc/circ-satisfied-a", "RDEPEND": "app-misc/circ-satisfied-a", }, + "app-misc/circ-smallest-a-1": { + "RDEPEND": "app-misc/circ-smallest-b", + }, + "app-misc/circ-smallest-b-1": { + "RDEPEND": "app-misc/circ-smallest-a", + }, + "app-misc/circ-smallest-c-1": { + "RDEPEND": "app-misc/circ-smallest-d", + }, + "app-misc/circ-smallest-d-1": { + "RDEPEND": "app-misc/circ-smallest-e", + }, + "app-misc/circ-smallest-e-1": { + "RDEPEND": "app-misc/circ-smallest-c", + }, + "app-misc/circ-smallest-f-1": { + "RDEPEND": "app-misc/circ-smallest-g app-misc/circ-smallest-a app-mi= sc/circ-smallest-c", + }, + "app-misc/circ-smallest-g-1": { + "RDEPEND": "app-misc/circ-smallest-f", + }, "app-misc/installed-blocker-a-1" : { "EAPI" : "2", "DEPEND" : "!app-misc/blocker-buildtime-a", @@ -294,6 +315,18 @@ class MergeOrderTestCase(TestCase): ambiguous_merge_order =3D True, merge_order_assertions =3D (("app-misc/circ-satisfied-a-1", "app-mis= c/circ-satisfied-c-1"),), mergelist =3D [("app-misc/circ-satisfied-a-1", "app-misc/circ-satisf= ied-b-1", "app-misc/circ-satisfied-c-1")]), + # In the case of multiple runtime cycles, where some cycles + # may depend on smaller independent cycles, it's optimal + # to merge smaller independent cycles before other cycles + # that depend on them. + ResolverPlaygroundTestCase( + ["app-misc/circ-smallest-a", "app-misc/circ-smallest-c", "app-misc/c= irc-smallest-f"], + success =3D True, + ambiguous_merge_order =3D True, + all_permutations =3D True, + mergelist =3D [('app-misc/circ-smallest-a-1', 'app-misc/circ-smalles= t-b-1'), + ('app-misc/circ-smallest-c-1', 'app-misc/circ-smallest-d-1', 'app-mi= sc/circ-smallest-e-1'), + ('app-misc/circ-smallest-f-1', 'app-misc/circ-smallest-g-1')]), # installed package has buildtime-only blocker # that should be ignored ResolverPlaygroundTestCase(