Gentoo Archives: gentoo-portage-dev

From: Zac Medico <zmedico@g.o>
To: gentoo-portage-dev@l.g.o, "M. J. Everitt" <m.j.everitt@×××.org>
Subject: Re: [gentoo-portage-dev] [PATCH] depgraph.autounmask_breakage_detected: ignore REQUIRED_USE violations (bug 654782)
Date: Fri, 04 May 2018 17:38:48
Message-Id: a9091228-2174-0b6b-22a1-113f8463d09a@gentoo.org
In Reply to: Re: [gentoo-portage-dev] [PATCH] depgraph.autounmask_breakage_detected: ignore REQUIRED_USE violations (bug 654782) by "M. J. Everitt"
1 On 05/04/2018 06:17 AM, M. J. Everitt wrote:
2 > On 04/05/18 06:22, Zac Medico wrote:
3 >> When autounmask USE changes violate REQUIRED_USE, rather than
4 >> recalculate with autounmask disabled, display the autounmask USE
5 >> changes along with the REQUIRED_USE violation. Adjust unit tests
6 >> to allow for the autounmask USE changes that were previously
7 >> discarded. For the case reported in bug 654782, the output will
8 >> appear as follows:
9 >>
10 >> The following keyword changes are necessary to proceed:
11 >> (see "package.accept_keywords" in the portage(5) man page for more details)
12 >> # required by =retext-7.0.1-r1 (argument)
13 >> =app-editors/retext-7.0.1-r1 ~amd64
14 >>
15 >> The following USE changes are necessary to proceed:
16 >> (see "package.use" in the portage(5) man page for more details)
17 >> # required by app-editors/retext-7.0.1-r1::gentoo
18 >> # required by =retext-7.0.1-r1 (argument)
19 >>> =dev-python/PyQt5-5.9.2 printsupport webengine network gui widgets
20 >> !!! The ebuild selected to satisfy "dev-python/PyQt5[gui,network,printsupport,webengine,widgets,python_targets_python3_4(-)?,python_targets_python3_5(-)?,python_targets_python3_6(-)?,-python_single_target_python3_4(-),-python_single_target_python3_5(-),-python_single_target_python3_6(-)]" has unmet requirements.
21 >> - dev-python/PyQt5-5.9.2::gentoo USE="-bluetooth -dbus -debug -declarative -designer -examples -gles2 -gui -help -location -multimedia -network -opengl -positioning -printsupport -sensors -serialport -sql -svg -testlib -webchannel -webengine -webkit -websockets -widgets -x11extras -xmlpatterns" PYTHON_TARGETS="python2_7 python3_4 python3_6 -python3_5"
22 >>
23 >> The following REQUIRED_USE flag constraints are unsatisfied:
24 >> webengine? ( widgets? ( webchannel ) )
25 >>
26 >> The above constraints are a subset of the following complete expression:
27 >> any-of ( python_targets_python2_7 python_targets_python3_4 python_targets_python3_5 python_targets_python3_6 ) bluetooth? ( gui ) declarative? ( gui network ) designer? ( widgets ) help? ( gui widgets ) location? ( positioning ) multimedia? ( gui network ) opengl? ( gui widgets ) positioning? ( gui ) printsupport? ( gui widgets ) sensors? ( gui ) serialport? ( gui ) sql? ( widgets ) svg? ( gui widgets ) testlib? ( widgets ) webchannel? ( network ) webengine? ( network widgets? ( printsupport webchannel ) ) webkit? ( gui network printsupport widgets ) websockets? ( network ) widgets? ( gui ) xmlpatterns? ( network )
28 >>
29 >> (dependency required by "app-editors/retext-7.0.1-r1::gentoo" [ebuild])
30 >> (dependency required by "=retext-7.0.1-r1" [argument])
31 >>
32 >> Bug: https://bugs.gentoo.org/654782
33 >> ---
34 >> pym/_emerge/depgraph.py | 8 ++--
35 >> pym/portage/tests/resolver/test_autounmask.py | 48 ++++++++++++++++++++--
36 >> pym/portage/tests/resolver/test_slot_collisions.py | 20 +++++----
37 >> 3 files changed, 61 insertions(+), 15 deletions(-)
38 >>
39 >> diff --git a/pym/_emerge/depgraph.py b/pym/_emerge/depgraph.py
40 >> index fbd16ad98..429d8871c 100644
41 >> --- a/pym/_emerge/depgraph.py
42 >> +++ b/pym/_emerge/depgraph.py
43 >> @@ -3009,6 +3009,10 @@ class depgraph(object):
44 >> {"myparent" : dep.parent, "show_req_use" : pkg}))
45 >> self._dynamic_config._required_use_unsatisfied = True
46 >> self._dynamic_config._skip_restart = True
47 >> + # Add pkg to digraph in order to enable autounmask messages
48 >> + # for this package, which is useful when autounmask USE
49 >> + # changes have violated REQUIRED_USE.
50 >> + self._dynamic_config.digraph.add(pkg, dep.parent, priority=priority)
51 >> return 0
52 >>
53 >> if not pkg.onlydeps:
54 >> @@ -9428,10 +9432,6 @@ class depgraph(object):
55 >> return self._dynamic_config._need_config_reload
56 >>
57 >> def autounmask_breakage_detected(self):
58 >> - # Check for REQUIRED_USE violations.
59 >> - for changes in self._dynamic_config._needed_use_config_changes.values():
60 >> - if getattr(changes, 'required_use_satisfied', None) is False:
61 >> - return True
62 >> try:
63 >> for pargs, kwargs in self._dynamic_config._unsatisfied_deps_for_display:
64 >> self._show_unsatisfied_dep(
65 >> diff --git a/pym/portage/tests/resolver/test_autounmask.py b/pym/portage/tests/resolver/test_autounmask.py
66 >> index 9042349ea..809d42104 100644
67 >> --- a/pym/portage/tests/resolver/test_autounmask.py
68 >> +++ b/pym/portage/tests/resolver/test_autounmask.py
69 >> @@ -251,15 +251,42 @@ class AutounmaskTestCase(TestCase):
70 >> use_changes={ "dev-util/R-1": { "bar": True } }),
71 >>
72 >> #Test interaction with REQUIRED_USE.
73 >> + # Some of these cases trigger USE change(s) that violate
74 >> + # REQUIRED_USE, so the USE changes are shown along with
75 >> + # the REQUIRED_USE violation that they would trigger.
76 >> +
77 >> + # The following USE changes are necessary to proceed:
78 >> + # (see "package.use" in the portage(5) man page for more details)
79 >> + # # required by app-portage/A-1::test_repo
80 >> + # # required by =app-portage/A-1 (argument)
81 >> + # >=app-portage/B-1 foo
82 >> + #
83 >> + # !!! The ebuild selected to satisfy "app-portage/B[foo]" has unmet requirements.
84 >> + # - app-portage/B-1::test_repo USE="bar (forced-flag) -foo"
85 >> + #
86 >> + # The following REQUIRED_USE flag constraints are unsatisfied:
87 >> + # exactly-one-of ( foo bar )
88 >> ResolverPlaygroundTestCase(
89 >> ["=app-portage/A-1"],
90 >> options={ "--autounmask": True },
91 >> - use_changes=None,
92 >> + use_changes={"app-portage/B-1": {"foo": True}},
93 >> success=False),
94 >> +
95 >> + # The following USE changes are necessary to proceed:
96 >> + # (see "package.use" in the portage(5) man page for more details)
97 >> + # # required by app-portage/A-2::test_repo
98 >> + # # required by =app-portage/A-2 (argument)
99 >> + # >=app-portage/B-1 foo
100 >> + #
101 >> + # !!! The ebuild selected to satisfy "app-portage/B[foo=]" has unmet requirements.
102 >> + # - app-portage/B-1::test_repo USE="bar (forced-flag) -foo"
103 >> + #
104 >> + # The following REQUIRED_USE flag constraints are unsatisfied:
105 >> + # exactly-one-of ( foo bar )
106 >> ResolverPlaygroundTestCase(
107 >> ["=app-portage/A-2"],
108 >> options={ "--autounmask": True },
109 >> - use_changes=None,
110 >> + use_changes={"app-portage/B-1": {"foo": True}},
111 >> success=False),
112 >> ResolverPlaygroundTestCase(
113 >> ["=app-portage/C-1"],
114 >> @@ -269,10 +296,25 @@ class AutounmaskTestCase(TestCase):
115 >>
116 >> # Test bug 622462, where it inappropriately unmasked a newer
117 >> # version rather than report unsatisfied REQUIRED_USE.
118 >> + #
119 >> + # The following USE changes are necessary to proceed:
120 >> + # (see "package.use" in the portage(5) man page for more details)
121 >> + # # required by sci-mathematics/octave-4.2.2::test_repo
122 >> + # # required by sci-mathematics/octave (argument)
123 >> + # >=x11-libs/qscintilla-2.9.4 qt5
124 >> + #
125 >> + # !!! The ebuild selected to satisfy ">=x11-libs/qscintilla-2.9.3-r2:=[qt5(+)]" has unmet requirements.
126 >> + # - x11-libs/qscintilla-2.9.4::test_repo USE="qt4 -qt5"
127 >> + #
128 >> + # The following REQUIRED_USE flag constraints are unsatisfied:
129 >> + # exactly-one-of ( qt4 qt5 )
130 >> + #
131 >> + # (dependency required by "sci-mathematics/octave-4.2.2::test_repo" [ebuild])
132 >> + # (dependency required by "sci-mathematics/octave" [argument])
133 >> ResolverPlaygroundTestCase(
134 >> ["sci-mathematics/octave"],
135 >> options={"--autounmask": True},
136 >> - use_changes=None,
137 >> + use_changes={"x11-libs/qscintilla-2.9.4": {"qt5": True}},
138 >> success=False),
139 >>
140 >> #Make sure we don't change masked/forced flags.
141 >> diff --git a/pym/portage/tests/resolver/test_slot_collisions.py b/pym/portage/tests/resolver/test_slot_collisions.py
142 >> index 9fcd5294a..430ccaad6 100644
143 >> --- a/pym/portage/tests/resolver/test_slot_collisions.py
144 >> +++ b/pym/portage/tests/resolver/test_slot_collisions.py
145 >> @@ -136,15 +136,19 @@ class SlotCollisionTestCase(TestCase):
146 >> slot_collision_solutions = [{"sci-libs/Q-1": {"foo": True}, "sci-libs/P-1": {"foo": True}}]
147 >> ),
148 >>
149 >> - #Conflict with REQUIRED_USE
150 >> - ResolverPlaygroundTestCase(
151 >> - ["=app-misc/C-1", "=app-misc/B-1"],
152 >> - all_permutations = True,
153 >> - slot_collision_solutions = [],
154 >> - mergelist = ["app-misc/A-1", "app-misc/C-1", "app-misc/B-1"],
155 >> - ignore_mergelist_order = True,
156 >> - success = False),
157 >> )
158 >> + # NOTE: For this test case, ResolverPlaygroundTestCase attributes
159 >> + # vary randomly between runs, so it's expected to fail randomly.
160 >> + #Conflict with REQUIRED_USE
161 >> + #ResolverPlaygroundTestCase(
162 >> + # ["=app-misc/C-1", "=app-misc/B-1"],
163 >> + # all_permutations = True,
164 >> + # slot_collision_solutions = None,
165 >> + # use_changes={"app-misc/A-1": {"foo": True}},
166 >> + # mergelist = ["app-misc/A-1", "app-misc/C-1", "app-misc/B-1"],
167 >> + # ignore_mergelist_order = True,
168 >> + # success = False),
169 >> + #)
170 >>
171 >> playground = ResolverPlayground(ebuilds=ebuilds, installed=installed)
172 >> try:
173 > More [plain English] explanations of portage hiccups is always welcome!
174 >
175 > Thanks Zac!
176
177 Thanks! Merged:
178
179 https://gitweb.gentoo.org/proj/portage.git/commit/?id=ce150da22e351a7ba52a6390b9cb7aa076c0c8ce
180 --
181 Thanks,
182 Zac

Attachments

File name MIME type
signature.asc application/pgp-signature