Re: [gentoo-portage-dev] [PATCH] depgraph: trigger slot operator rebuilds via _complete_graph (bug 614390)

2017-03-31 Thread Zac Medico
On Fri, Mar 31, 2017 at 10:06 PM, Brian Dolbec  wrote:
> On Fri, 31 Mar 2017 21:11:41 -0700
> Zac Medico  wrote:
>
>> Fix _complete_graph to trigger rebuilds of parent packages when they
>> pull in installed packages that had already been scheduled for rebuild
>> by the previous calculation.
>>
>> X-Gentoo-bug: 614390
>> X-Gentoo-bug-url: https://bugs.gentoo.org/show_bug.cgi?id=614390
>> ---
>>  pym/_emerge/depgraph.py|  15 +++
>>  .../resolver/test_slot_operator_complete_graph.py  | 141
>> + 2 files changed, 156 insertions(+)
>>  create mode 100644
>> pym/portage/tests/resolver/test_slot_operator_complete_graph.py
>>
>
> looks good.  I look forward to getting less conflicts with this...

Thanks, pushed:

https://gitweb.gentoo.org/proj/portage.git/commit/?id=a83bb83909c5a6ac232c8eb5931b28027f4175af

-- 
Thanks,
Zac



Re: [gentoo-portage-dev] [PATCH] depgraph: trigger slot operator rebuilds via _complete_graph (bug 614390)

2017-03-31 Thread Brian Dolbec
On Fri, 31 Mar 2017 21:11:41 -0700
Zac Medico  wrote:

> Fix _complete_graph to trigger rebuilds of parent packages when they
> pull in installed packages that had already been scheduled for rebuild
> by the previous calculation.
> 
> X-Gentoo-bug: 614390
> X-Gentoo-bug-url: https://bugs.gentoo.org/show_bug.cgi?id=614390
> ---
>  pym/_emerge/depgraph.py|  15 +++
>  .../resolver/test_slot_operator_complete_graph.py  | 141
> + 2 files changed, 156 insertions(+)
>  create mode 100644
> pym/portage/tests/resolver/test_slot_operator_complete_graph.py
> 
> diff --git a/pym/_emerge/depgraph.py b/pym/_emerge/depgraph.py
> index 04e724d..8a614c4 100644
> --- a/pym/_emerge/depgraph.py
> +++ b/pym/_emerge/depgraph.py
> @@ -6649,6 +6649,21 @@ class depgraph(object):
>   # will be appropriately reported as
> a slot collision # (possibly solvable via backtracking).
>   pkg = matches[-1] # highest match
> +
> + if
> (self._dynamic_config._allow_backtracking and
> + not
> self._want_installed_pkg(pkg) and (dep.atom.soname or (
> + dep.atom.package and
> dep.atom.slot_operator_built))):
> + # If pkg was already
> scheduled for rebuild by the previous
> + # calculation, then pulling
> in the installed instance will
> + # trigger a slot conflict
> that may go unsolved. Therefore,
> + # trigger a rebuild of the
> parent if appropriate.
> + dep.child = pkg
> + new_dep =
> self._slot_operator_update_probe(dep)
> + if new_dep is not None:
> +
> self._slot_operator_update_backtrack(
> + dep,
> new_dep=new_dep)
> + continue
> +
>   if not self._add_pkg(pkg, dep):
>   return 0
>   if not
> self._create_graph(allow_unsatisfied=True): diff --git
> a/pym/portage/tests/resolver/test_slot_operator_complete_graph.py
> b/pym/portage/tests/resolver/test_slot_operator_complete_graph.py new
> file mode 100644 index 000..1d59bce --- /dev/null
> +++ b/pym/portage/tests/resolver/test_slot_operator_complete_graph.py
> @@ -0,0 +1,141 @@
> +# Copyright 2017 Gentoo Foundation
> +# Distributed under the terms of the GNU General Public License v2
> +
> +from portage.tests import TestCase
> +from portage.tests.resolver.ResolverPlayground import (
> + ResolverPlayground,
> + ResolverPlaygroundTestCase,
> +)
> +
> +class SlotOperatorCompleteGraphTestCase(TestCase):
> +
> + def testSlotOperatorCompleteGraph(self):
> +
> + ebuilds = {
> + "app-misc/meta-pkg-2" : {
> + "EAPI": "6",
> + "DEPEND": "=app-misc/B-2
> =app-misc/C-1  =app-misc/D-1 =dev-libs/foo-2",
> + "RDEPEND": "=app-misc/B-2
> =app-misc/C-1 =app-misc/D-1 =dev-libs/foo-2",
> + },
> +
> + "app-misc/meta-pkg-1" : {
> + "EAPI": "6",
> + "DEPEND": "=app-misc/B-1
> =app-misc/C-1  =app-misc/D-1 =dev-libs/foo-1",
> + "RDEPEND": "=app-misc/B-1
> =app-misc/C-1 =app-misc/D-1 =dev-libs/foo-1",
> + },
> +
> + "app-misc/B-1" : {
> + "EAPI": "6",
> + "DEPEND": "dev-libs/foo:=",
> + "RDEPEND": "dev-libs/foo:=",
> + },
> +
> + "app-misc/B-2" : {
> + "EAPI": "6",
> + "DEPEND": "dev-libs/foo:=",
> + "RDEPEND": "dev-libs/foo:=",
> + },
> +
> + "app-misc/C-1" : {
> + "EAPI": "6",
> + "DEPEND": "dev-libs/foo:=
> app-misc/B",
> + "RDEPEND": "dev-libs/foo:=
> app-misc/B",
> + },
> +
> + "app-misc/C-2" : {
> + "EAPI": "6",
> + "DEPEND": "dev-libs/foo:=
> app-misc/B",
> + "RDEPEND": "dev-libs/foo:=
> app-misc/B",
> + },
> +
> + "app-misc/D-1" : {
> + "EAPI": "6",
> + "DEPEND": "dev-libs/foo:=",
> + "RDEPEND": "dev-libs/foo:=",
> + },
> +
> + "app-misc/D-2" : {
> +