public inbox for gentoo-portage-dev@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-portage-dev] [PATCH] emerge: default --backtrack=3 (bug #536926)
@ 2015-01-17 22:57 Zac Medico
  2015-01-18 17:12 ` Brian Dolbec
  0 siblings, 1 reply; 2+ messages in thread
From: Zac Medico @ 2015-01-17 22:57 UTC (permalink / raw
  To: gentoo-portage-dev; +Cc: Zac Medico

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



^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [gentoo-portage-dev] [PATCH] emerge: default --backtrack=3 (bug #536926)
  2015-01-17 22:57 [gentoo-portage-dev] [PATCH] emerge: default --backtrack=3 (bug #536926) Zac Medico
@ 2015-01-18 17:12 ` Brian Dolbec
  0 siblings, 0 replies; 2+ messages in thread
From: Brian Dolbec @ 2015-01-18 17:12 UTC (permalink / raw
  To: gentoo-portage-dev

On Sat, 17 Jan 2015 14:57:23 -0800
Zac Medico <zmedico@gentoo.org> wrote:

> 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(-)
> 

Looks good, merge please.


-- 
Brian Dolbec <dolsen>



^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2015-01-18 17:12 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-01-17 22:57 [gentoo-portage-dev] [PATCH] emerge: default --backtrack=3 (bug #536926) Zac Medico
2015-01-18 17:12 ` Brian Dolbec

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox