From: Zac Medico <zmedico@gentoo.org>
To: gentoo-portage-dev@lists.gentoo.org
Cc: Zac Medico <zmedico@gentoo.org>
Subject: [gentoo-portage-dev] [PATCH] emerge: default --backtrack=3 (bug #536926)
Date: Sat, 17 Jan 2015 14:57:23 -0800 [thread overview]
Message-ID: <1421535443-4784-1-git-send-email-zmedico@gentoo.org> (raw)
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
next reply other threads:[~2015-01-17 22:57 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-01-17 22:57 Zac Medico [this message]
2015-01-18 17:12 ` [gentoo-portage-dev] [PATCH] emerge: default --backtrack=3 (bug #536926) Brian Dolbec
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1421535443-4784-1-git-send-email-zmedico@gentoo.org \
--to=zmedico@gentoo.org \
--cc=gentoo-portage-dev@lists.gentoo.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox