1 |
commit: e5878170638a091db1331df7e7922c8a14e29e86 |
2 |
Author: Zac Medico <zmedico <AT> gentoo <DOT> org> |
3 |
AuthorDate: Tue Jan 21 01:59:30 2020 +0000 |
4 |
Commit: Zac Medico <zmedico <AT> gentoo <DOT> org> |
5 |
CommitDate: Tue Jan 21 02:35:43 2020 +0000 |
6 |
URL: https://gitweb.gentoo.org/proj/portage.git/commit/?id=e5878170 |
7 |
|
8 |
Add unit test which demonstrates bug 705986 |
9 |
|
10 |
This USE suggestion appears to prevent application of || preference |
11 |
adjustment to solve the cycle (pypy-exe-bin would solve it): |
12 |
|
13 |
* Error: circular dependencies: |
14 |
|
15 |
(dev-python/pypy-exe-7.3.0:7.3.0/7.3.0::test_repo, ebuild scheduled for merge) depends on |
16 |
(dev-python/pypy-7.3.0:0/73::test_repo, ebuild scheduled for merge) (buildtime) |
17 |
(dev-python/pypy-exe-7.3.0:7.3.0/7.3.0::test_repo, ebuild scheduled for merge) (buildtime) |
18 |
|
19 |
It might be possible to break this cycle |
20 |
by applying the following change: |
21 |
- dev-python/pypy-exe-7.3.0 (Change USE: +low-memory) |
22 |
|
23 |
Meanwhile, an explicit pypy-exe-bin argument adjusts the || preference |
24 |
and breaks the cycle: |
25 |
|
26 |
$ emerge -pq pypy pypy-exe-bin |
27 |
[ebuild N ] dev-python/pypy-exe-bin-7.3.0 |
28 |
[ebuild N ] dev-python/pypy-7.3.0 |
29 |
|
30 |
Bug: https://bugs.gentoo.org/705986 |
31 |
Signed-off-by: Zac Medico <zmedico <AT> gentoo.org> |
32 |
|
33 |
.../tests/resolver/test_circular_choices.py | 48 ++++++++++++++++++++++ |
34 |
1 file changed, 48 insertions(+) |
35 |
|
36 |
diff --git a/lib/portage/tests/resolver/test_circular_choices.py b/lib/portage/tests/resolver/test_circular_choices.py |
37 |
index a5c10b476..968677a46 100644 |
38 |
--- a/lib/portage/tests/resolver/test_circular_choices.py |
39 |
+++ b/lib/portage/tests/resolver/test_circular_choices.py |
40 |
@@ -160,3 +160,51 @@ class VirtualCircularChoicesTestCase(TestCase): |
41 |
self.assertEqual(test_case.test_success, True, test_case.fail_msg) |
42 |
finally: |
43 |
playground.cleanup() |
44 |
+ |
45 |
+ |
46 |
+class CircularPypyExeTestCase(TestCase): |
47 |
+ def testCircularPypyExe(self): |
48 |
+ |
49 |
+ ebuilds = { |
50 |
+ 'dev-python/pypy-7.3.0': { |
51 |
+ 'EAPI': '7', |
52 |
+ 'SLOT' : '0/73', |
53 |
+ 'DEPEND': '|| ( dev-python/pypy-exe dev-python/pypy-exe-bin )' |
54 |
+ }, |
55 |
+ 'dev-python/pypy-exe-7.3.0': { |
56 |
+ 'EAPI': '7', |
57 |
+ 'IUSE': 'low-memory', |
58 |
+ 'SLOT' : '7.3.0', |
59 |
+ 'BDEPEND': '!low-memory? ( dev-python/pypy )' |
60 |
+ }, |
61 |
+ 'dev-python/pypy-exe-bin-7.3.0': { |
62 |
+ 'EAPI': '7', |
63 |
+ 'SLOT' : '7.3.0', |
64 |
+ }, |
65 |
+ } |
66 |
+ |
67 |
+ test_cases = ( |
68 |
+ # Demonstrate bug 705986, where a USE change suggestion is given |
69 |
+ # even though an || preference adjustment is available. |
70 |
+ ResolverPlaygroundTestCase( |
71 |
+ ['dev-python/pypy'], |
72 |
+ circular_dependency_solutions = {'dev-python/pypy-7.3.0': {frozenset({('low-memory', True)})}}, |
73 |
+ success = False, |
74 |
+ ), |
75 |
+ # Demonstrate explicit pypy-exe-bin argument used as a workaround |
76 |
+ # for bug 705986. |
77 |
+ ResolverPlaygroundTestCase( |
78 |
+ ['dev-python/pypy', 'dev-python/pypy-exe-bin'], |
79 |
+ mergelist=['dev-python/pypy-exe-bin-7.3.0', 'dev-python/pypy-7.3.0'], |
80 |
+ success = True, |
81 |
+ ), |
82 |
+ ) |
83 |
+ |
84 |
+ playground = ResolverPlayground(ebuilds=ebuilds, debug=False) |
85 |
+ try: |
86 |
+ for test_case in test_cases: |
87 |
+ playground.run_TestCase(test_case) |
88 |
+ self.assertEqual(test_case.test_success, True, test_case.fail_msg) |
89 |
+ finally: |
90 |
+ playground.debug = False |
91 |
+ playground.cleanup() |