Gentoo Archives: gentoo-portage-dev

From: Brian Dolbec <dolsen@g.o>
To: gentoo-portage-dev@l.g.o
Subject: Re: [gentoo-portage-dev] [PATCH v2] depgraph: fix missed atom_not_selected initialization (bug 612846)
Date: Thu, 16 Mar 2017 22:33:25
Message-Id: 20170316153321.5e19b091.dolsen@gentoo.org
In Reply to: [gentoo-portage-dev] [PATCH v2] depgraph: fix missed atom_not_selected initialization (bug 612846) by Zac Medico
1 On Thu, 16 Mar 2017 14:19:07 -0700
2 Zac Medico <zmedico@g.o> wrote:
3
4 > Fix the _slot_operator_update_probe method to ensure that the
5 > atom_not_selected variable is always properly initialized. This
6 > problem prevented the method from identifying slot operator rebuild
7 > candidates, leading to dependency conflicts and/or missed updates.
8 > For example, this may have triggered the missed llvm update reported
9 > in bug 611742, since these dependencies from the mesa-17.0.1 ebuild
10 > are capable of triggering the problem, when atom_not_selected is not
11 > properly set to True for the second atom:
12 >
13 > || (
14 > sys-devel/llvm:4[${MULTILIB_USEDEP}]
15 > >=sys-devel/llvm-3.6.0:0[${MULTILIB_USEDEP}]
16 > )
17 >
18 > X-Gentoo-bug: 612846
19 > X-Gentoo-bug-url: https://bugs.gentoo.org/show_bug.cgi?id=612846
20 > ---
21 > [PATCH v2] fixes it to handle soname atoms correctly
22 >
23 > pym/_emerge/depgraph.py | 17 ++++++++++++++---
24 > 1 file changed, 14 insertions(+), 3 deletions(-)
25 >
26 > diff --git a/pym/_emerge/depgraph.py b/pym/_emerge/depgraph.py
27 > index ad94fb7..511944c 100644
28 > --- a/pym/_emerge/depgraph.py
29 > +++ b/pym/_emerge/depgraph.py
30 > @@ -1895,7 +1895,9 @@ class depgraph(object):
31 > all_candidate_pkgs = None
32 >
33 > for atom in atoms:
34 > - atom_not_selected = False
35 > + # The _select_atoms_probe method is
36 > expensive, so initialization
37 > + # of this variable is only
38 > permformed on demand.
39 > + atom_not_selected = None
40 >
41 > if not atom.package:
42 > unevaluated_atom = None
43 > @@ -1977,8 +1979,8 @@ class depgraph(object):
44 > if selected_atoms is
45 > None: selected_atoms = self._select_atoms_probe(
46 > dep.child.root,
47 > replacement_parent)
48 > - if unevaluated_atom
49 > not in selected_atoms:
50 > -
51 > atom_not_selected = True
52 > + atom_not_selected =
53 > unevaluated_atom not in selected_atoms
54 > + if atom_not_selected:
55 > break
56 >
57 > if not insignificant and \
58 > @@ -1989,6 +1991,15 @@ class depgraph(object):
59 > (pkg,
60 > unevaluated_atom or atom)) candidate_pkgs.append(pkg)
61 >
62 > + # When unevaluated_atom is None, it
63 > means that atom is
64 > + # an soname atom which is
65 > unconditionally selected, and
66 > + # _select_atoms_probe is not
67 > applicable.
68 > + if atom_not_selected is None and
69 > unevaluated_atom is not None:
70 > + if selected_atoms is None:
71 > + selected_atoms =
72 > self._select_atoms_probe(
73 > +
74 > dep.child.root, replacement_parent)
75 > + atom_not_selected =
76 > unevaluated_atom not in selected_atoms +
77 > if atom_not_selected:
78 > continue
79 > replacement_candidates.append(candidate_pkg_atoms)
80
81 Looks good other than 2 typos permfomed and "# an soname" -n
82
83 --
84 Brian Dolbec <dolsen>

Replies