1 |
-----BEGIN PGP SIGNED MESSAGE----- |
2 |
Hash: SHA256 |
3 |
|
4 |
Hey all -- so I've noticed that there are a lot of packages using |
5 |
python-single-r1.eclass which are python-2 only -- ie PYTHON_COMPAT=( |
6 |
python2_{6,7} ) in most cases. Effectively this means either an |
7 |
end-user needs to tie PYTHON_SINGLE_TARGET on their system to |
8 |
"python2_7", or they need to set the flag explicitly through |
9 |
/etc/portage/package.use all the time. |
10 |
|
11 |
As python-single-r1.eclass is meant to ensure that a package is bound |
12 |
to just one implementation when multiple implementations are possible, |
13 |
usually because it is too difficult to make the package multibuild, it |
14 |
would make sense to me that if there is actually just one possible |
15 |
implementation an ebuild can be satisfied with regardless of the |
16 |
PYTHON_TARGETS and PYTHON_SINGLE_TARGET selections, that the ebuild |
17 |
should be able to just depend on and use it regardless of what |
18 |
PYTHON_SINGLE_TARGET is set to globally. |
19 |
|
20 |
Simple example of situation -- assuming a properly-written |
21 |
distcc-3.1-r9.ebuild (which the in-tree version apparently isn't): |
22 |
|
23 |
> PYTHON_TARGETS="python2_7 python3_3 python3_4" \ |
24 |
> PYTHON_SINGLE_TARGET="python3_3" \ emerge -av sys-devel/distcc |
25 |
> |
26 |
> These are the packages that would be merged, in order: |
27 |
> |
28 |
> Calculating dependencies | |
29 |
> |
30 |
> !!! Problem resolving dependencies for sys-devel/distcc ... done! |
31 |
> |
32 |
> !!! The ebuild selected to satisfy "distcc" has unmet |
33 |
> requirements. - sys-devel/distcc-3.1-r9::gentoo USE="gtk -avahi |
34 |
> -hardened -ipv6 -selinux -xinetd" ABI_X86="64" |
35 |
> PYTHON_SINGLE_TARGET="-python2_7" PYTHON_TARGETS="python2_7" |
36 |
> |
37 |
> The following REQUIRED_USE flag constraints are unsatisfied: |
38 |
> python_single_target_python2_7 |
39 |
> |
40 |
> The above constraints are a subset of the following complete |
41 |
> expression: python_single_target_python2_7? ( |
42 |
> python_targets_python2_7 ) exactly-one-of ( |
43 |
> python_single_target_python2_7 ) |
44 |
|
45 |
|
46 |
There are two ways to deal with this in-ebuild -- the first would be |
47 |
to adjust the ebuilds to python-r1 but not multibuild them, which |
48 |
means that the ebuilds are python-single but not actually implemented |
49 |
in a python-single way. The other is to adjust python-single-r1 so |
50 |
that if there is only one possible implementation (ie, PYTHON_COMPAT |
51 |
just has one entry, or only one such entry is in _PYTHON_ALL_IMPLS) |
52 |
then the PYTHON_SINGLE_TARGET setting is ignored. |
53 |
|
54 |
The main issue that this may cause is that the python_single_target_* |
55 |
use dependencies are no longer fully deterministic at all times, and |
56 |
are rather now determined based on the supported python implementation |
57 |
list in _python_impl_supported() from python-utils-r1 -- ie, when that |
58 |
list changes, some packages may suddenly require PYTHON_SINGLE_TARGET |
59 |
be set while others just-as-suddenly won't need it. This may mean |
60 |
some extra rebuilds for users on "emerge -N", especially as the flags |
61 |
are dropped. |
62 |
|
63 |
Please note that documentation is likely going to need updating; I |
64 |
tried but more work is going to be required on that front. The eerror |
65 |
section at the bottom of python-setup is particularily nasty and |
66 |
likely needs adjusting. Otherwise though, functionality seems to work |
67 |
as expected without any side-effects in my 10 minutes of testing. |
68 |
|
69 |
Thoughts and feedback appreciated -- I think incorporating this will |
70 |
really help out end-users that don't want to remain locked to python-2.7 |
71 |
|
72 |
|
73 |
-----BEGIN PGP SIGNATURE----- |
74 |
Version: GnuPG v2 |
75 |
|
76 |
iF4EAREIAAYFAlRRLzkACgkQ2ugaI38ACPBnPQEAmq0mB+jzbKc/M2y971d5SdvV |
77 |
+jFtXvJgWEmKMbABKQsBALImzNqOBirDomrPYrYLHc/JeblZUkWvVwNkQMZ3Qwyl |
78 |
=T/jY |
79 |
-----END PGP SIGNATURE----- |