From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) by finch.gentoo.org (Postfix) with ESMTP id BE1AF138A1A for ; Sat, 17 Jan 2015 22:57:50 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 73EF4E09DB; Sat, 17 Jan 2015 22:57:48 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id F24A6E09D6 for ; Sat, 17 Jan 2015 22:57:47 +0000 (UTC) Received: from localhost.localdomain (ip174-67-205-96.oc.oc.cox.net [174.67.205.96]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) (Authenticated sender: zmedico) by smtp.gentoo.org (Postfix) with ESMTPSA id 98E8B340688; Sat, 17 Jan 2015 22:57:46 +0000 (UTC) From: Zac Medico To: gentoo-portage-dev@lists.gentoo.org Cc: Zac Medico Subject: [gentoo-portage-dev] [PATCH] emerge: default --backtrack=3 (bug #536926) Date: Sat, 17 Jan 2015 14:57:23 -0800 Message-Id: <1421535443-4784-1-git-send-email-zmedico@gentoo.org> X-Mailer: git-send-email 2.0.5 Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-portage-dev@lists.gentoo.org Reply-to: gentoo-portage-dev@lists.gentoo.org X-Archives-Salt: 026d49d3-c71d-4de3-b708-29a8a54ac701 X-Archives-Hash: e2196c1d48e0b1a9a3fdc68d9cbf12ea The previous default emerge --backtrack=10 setting could lead to lots of wasted cpu time in cases where it will ultimately fail to find a valid solution anyway. Therefore, reduce the default to --backtrack=3. In order for the BacktrackingTestCase.testBacktrackNoWrongRebuilds to succeed, the test now needs to specify --backtrack=6. This is a rather obscure case though, so it does not seem worthwhile to increase the default because of it. X-Gentoo-Bug: 536926 X-Gentoo-Bug-URL: https://bugs.gentoo.org/show_bug.cgi?id=536926 --- man/emerge.1 | 2 +- pym/_emerge/depgraph.py | 2 +- pym/portage/tests/resolver/test_backtracking.py | 7 ++++++- 3 files changed, 8 insertions(+), 3 deletions(-) diff --git a/man/emerge.1 b/man/emerge.1 index aea7cae..fd9140f 100644 --- a/man/emerge.1 +++ b/man/emerge.1 @@ -384,7 +384,7 @@ precedence over existing changes. This option is automatically enabled with .BR \-\-backtrack=COUNT Specifies an integer number of times to backtrack if dependency calculation fails due to a conflict or an -unsatisfied dependency (default: \'10\'). +unsatisfied dependency (default: \'3\'). .TP .BR "\-\-binpkg\-changed\-deps [ y | n ]" Tells emerge to ignore binary packages for which the corresponding diff --git a/pym/_emerge/depgraph.py b/pym/_emerge/depgraph.py index 1431779..5e94a04 100644 --- a/pym/_emerge/depgraph.py +++ b/pym/_emerge/depgraph.py @@ -8941,7 +8941,7 @@ def _backtrack_depgraph(settings, trees, myopts, myparams, myaction, myfiles, sp debug = "--debug" in myopts mydepgraph = None - max_retries = myopts.get('--backtrack', 10) + max_retries = myopts.get('--backtrack', 3) max_depth = max(1, (max_retries + 1) // 2) allow_backtracking = max_retries > 0 backtracker = Backtracker(max_depth) diff --git a/pym/portage/tests/resolver/test_backtracking.py b/pym/portage/tests/resolver/test_backtracking.py index 3b69eda..f3592c9 100644 --- a/pym/portage/tests/resolver/test_backtracking.py +++ b/pym/portage/tests/resolver/test_backtracking.py @@ -154,7 +154,12 @@ class BacktrackingTestCase(TestCase): world = ["dev-libs/B", "dev-libs/C"] - options = {'--update' : True, '--deep' : True, '--selective' : True} + options = { + '--backtrack': 6, + '--deep' : True, + '--selective' : True, + '--update' : True, + } test_cases = ( ResolverPlaygroundTestCase( -- 2.0.5