Gentoo Archives: gentoo-portage-dev

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