1 |
Dnia 2014-11-30, o godz. 13:12:18 |
2 |
Mike Gilbert <floppym@g.o> napisał(a): |
3 |
|
4 |
> On Fri, Nov 28, 2014 at 5:59 PM, Michał Górny <mgorny@g.o> wrote: |
5 |
> > As far as the first issue is concerned, I think enough has been said |
6 |
> > already. Right now we are fine-tuned for two cases: |
7 |
> > |
8 |
> > a. packages that support one impl only -- then they have a single |
9 |
> > PYTHON_TARGET that's enabled by default, |
10 |
> > |
11 |
> > b. packages that support python2.7 -- then we have the profile default |
12 |
> > of python2.7 for them. |
13 |
> > |
14 |
> > We have no good way of handling packages that support Python 3 only. |
15 |
> > |
16 |
> |
17 |
> I'm thinking we need to move the default PYTHON_SINGLE_TARGET setting |
18 |
> from profiles to IUSE defaults computed in the eclass. |
19 |
> |
20 |
> What are the problems associated with that? |
21 |
|
22 |
Well, one issue I see is that it means we will have a 'moving' default. |
23 |
That is, different packages will have different (non-matching) defaults |
24 |
depending on supported implementations. Worse than that, adding a new |
25 |
implementation will change the default in one package which may conflict |
26 |
with its dependencies. |
27 |
|
28 |
Please consider the following example. We have two packages, AA and AB. |
29 |
Both are python-single-r1 and in version 1 both support 3.2+3.3, with |
30 |
3.3 being the IUSE default. AB depends on AA[${PYTHON_USEDEP}]. |
31 |
|
32 |
Now, A-2 gets 3.4 support and 3.4 becomes the IUSE default. Now emerge |
33 |
-1vDtuN ab gives: |
34 |
|
35 |
emerge: there are no ebuilds built with USE flags to satisfy |
36 |
"dev-python/aa[python_targets_python3_3(-),python_single_target_python3_3(+)]". !!! |
37 |
One of the following packages is required to complete your request: |
38 |
- dev-python/aa-2::mgorny (Change USE: +python_single_target_python3_3, |
39 |
this change violates use flag constraints defined by dev-python/aa-2: |
40 |
'exactly-one-of ( python_single_target_python3_2 |
41 |
python_single_target_python3_3 python_single_target_python3_4 ) |
42 |
python_single_target_python3_2? ( python_targets_python3_2 ) |
43 |
python_single_target_python3_3? ( python_targets_python3_3 ) |
44 |
python_single_target_python3_4? ( python_targets_python3_4 )') |
45 |
(dependency required by "dev-python/ab-1::mgorny" [installed]) |
46 |
(dependency required by "ab" [argument]) |
47 |
|
48 |
This happens both when PST USE-deps are '?' and '='. |
49 |
|
50 |
Now, assuming that user actually adds 3.3, he gets regular REQUIRED_USE |
51 |
conflict. He can solve it by removing 3.4 *explicitly*. Now he can |
52 |
upgrade. Note that PYTHON_TARGETS has 3.3+3.4 now (see issue below). |
53 |
|
54 |
Now good news, everyone! AB just gained 3.4 support, and therefore |
55 |
switched default again. Now portage at least suggests the right thing |
56 |
to do: |
57 |
|
58 |
The following USE changes are necessary to proceed: |
59 |
(see "package.use" in the portage(5) man page for more details) |
60 |
# required by dev-python/ab-2::mgorny |
61 |
# required by ab (argument) |
62 |
>=dev-python/aa-2 python_single_target_python3_4 -python_single_target_python3_3 |
63 |
|
64 |
This is good so far. Now, let's imagine we have three packages -- AA, |
65 |
AB and AC. AC also depends on AA and supports 3.2+3.3. This means that |
66 |
once AB and AA again 3.4 support, Portage ends up having a real |
67 |
conflict: |
68 |
|
69 |
!!! Multiple package instances within a single package slot have been |
70 |
pulled !!! into the dependency graph, resulting in a slot conflict: |
71 |
|
72 |
dev-python/aa:0 |
73 |
|
74 |
(dev-python/aa-2:0/0::mgorny, installed) pulled in by |
75 |
dev-python/aa[python_targets_python3_3(-),-python_single_target_python3_2(+),python_single_target_python3_3(+)] |
76 |
required by (dev-python/ac-1:0/0::mgorny, installed) |
77 |
|
78 |
(dev-python/aa-2:0/0::mgorny, ebuild scheduled for merge) pulled in by |
79 |
dev-python/aa[python_targets_python3_2(-)?,python_targets_python3_3(-)?,python_targets_python3_4(-)?,python_single_target_python3_2(+)=,python_single_target_python3_3(+)=,python_single_target_python3_4(+)=] |
80 |
required by (dev-python/ab-2:0/0::mgorny, ebuild scheduled for merge) |
81 |
|
82 |
|
83 |
Not good at all. Portage still suggests enabling 3.4 on AA but that |
84 |
only makes things worse. If you force 3.3 on AB, it lets you continue. |
85 |
|
86 |
Once AC gets 3.4, Portage says to switch AA to 3.4. Once you do that, |
87 |
it tells you to switch it to 3.3 (because of AB). Guess what it tells |
88 |
you to do next :). |
89 |
|
90 |
> > The other issue comes into game in two cases I've seen: |
91 |
> > |
92 |
> > A. when we try to improve setting of PYTHON_SINGLE_TARGET, we force |
93 |
> > the user to enable matching PYTHON_TARGET anyway -- so in the end |
94 |
> > manual intervention is required, |
95 |
> |
96 |
> That would seem to be the exception rather than the norm. This would |
97 |
> only happen if we somehow defaulted PYTHON_SINGLE_TARGET to something |
98 |
> that is not in PYTHON_TARGETS by default. How would that ever happen? |
99 |
|
100 |
Forget about this. I guess we can enable the same PYTHON_TARGET |
101 |
and PYTHON_SINGLE_TARGET via IUSE defaults. |
102 |
|
103 |
> > B. they cause issues with REQUIRED_USE on other packages (like libpeas |
104 |
> > that supports only one version of python2 and one of python3). Even |
105 |
> > though PYTHON_SINGLE_TARGET results in effective use of a single impl, |
106 |
> > PYTHON_TARGET USE-dep requests full PYTHON_TARGETS match on the dep. |
107 |
> > Therefore, the user needs to disable other implementations anyway to |
108 |
> > get the expected result. |
109 |
> |
110 |
> I don't understand this part. Can you please explain it? Maybe an example? |
111 |
|
112 |
gedit and libpeas, with gedit depending on libpeas. libpeas supports |
113 |
one version of Python 2 and one of Python 3, and gedit just one |
114 |
in general: |
115 |
|
116 |
libpeas is REQUIRED_USE=?? ( 2.* ) ?? ( 3.* ) |
117 |
gedit is REQUIRED_USE=^^ ( 3.* ) |
118 |
|
119 |
So libpeas needs python-r1 with specific REQUIRED_USE. gedit would be |
120 |
a candidate for python-single-r1 but... |
121 |
|
122 |
p-s-r1 enforces ^^ only on PYTHON_SINGLE_TARGET. So I end up with |
123 |
something like: |
124 |
|
125 |
PYTHON_TARGETS="3.3 3.4" PYTHON_SINGLE_TARGET="3.4" |
126 |
|
127 |
and this enforces dependency on libpeas[3.3,3.4] which contradicts its |
128 |
REQUIRED_USE. So we need also REQUIRED_USE=^^ ( 3.* ). But basically, |
129 |
the whole mess with the second variable doesn't really help here. |
130 |
|
131 |
-- |
132 |
Best regards, |
133 |
Michał Górny |