Gentoo Archives: gentoo-python

From: "Michał Górny" <mgorny@g.o>
To: gentoo-python@l.g.o
Cc: python@g.o
Subject: [gentoo-python] python-r1 <-> python.eclass package dependencies
Date: Sat, 10 Nov 2012 16:42:30
Message-Id: 20121110174322.656f1d67@pomiocik.lan
1 Hello,
2
3 As some of you are aware already, there is a significant difference
4 in handling Python implementation choice between python.eclass
5 and python-r1 / p-d-ng.
6
7 The python.eclass packages use USE_PYTHON (undocumented variable)
8 or the eselected Python2+3, and store that choice implicitly.
9 Everything works on the assumption that implementations don't change
10 or user runs python-updater.
11
12 The python-r1 / p-d-ng packages use explicit USE flags to choose
13 implementation. The choice is thus explicitly exported and other
14 packages can use USE dependencies to enforce matching implementations.
15
16 The problems arise whenever python-r1 package depends on package using
17 the python.eclass, or the other way round. There is no clear way to
18 enforce the same implementations being used, so everything falls down
19 to user.
20
21 In order to solve the most common problems due to that, I have
22 published a news item explaining how PYTHON_TARGETS work and what needs
23 to be done with them.
24
25 In the discussion with other Gentoo Python devs, it was assumed that
26 USE_PYTHON should not be considered public and thus not be described
27 in the message. Sadly, it seems that this resulted in people actually
28 trying to disable Python3 using PYTHON_TARGETS and seeing random
29 failures due to python.eclass enforcing it anyway.
30
31
32 I believe we should thoroughly think what should be done now in order
33 to solve the issues best for the transition time. Here are a few
34 solutions I can think of.
35
36 1) lard both eclasses with USE_PYTHON <-> PYTHON_TARGETS consistency
37 checks. This should be pretty easy for python-r1, harder for
38 python.eclass (anyone volunteering to touch it in thick gloves?).
39
40 In other words, we just warn users whenever they need to do something
41 to ensure things work.
42
43
44 2) make python.eclass respect PYTHON_TARGETS.
45
46 Sadly, due to PMS limitations we can't tell if PYTHON_TARGETS was set
47 by user or has the default value. So we either can:
48
49 a) stop using USE_PYTHON and eselect defaults, start using
50 PYTHON_TARGETS only, pull in correct Python versions, tell users to run
51 python-updater;
52
53 b) prefer PYTHON_TARGETS over USE_PYTHON and the default (but only
54 if PYTHON_TARGETS != default PYTHON_TARGETS, so we're on thin ice here).
55
56
57 3) make python.eclass respect and export PYTHON_TARGETS in IUSE.
58
59 Like the above but instead of running the fragile and broken
60 python-updater, we simply force rebuild of all packages. People can
61 start using USE-deps in the meantime, everyone becomes a bit happier
62 in the further plane. Sadly, this means every Python package is going
63 to need being rebuilt.
64
65
66 Please also note that 2 & 3 mean mass-changing behavior of stable
67 packages. Not something I'd do in a short timeframe where the issue
68 should be best fixed.
69
70 Any other ideas? Any +1, -1s?
71
72 --
73 Best regards,
74 Michał Górny

Attachments

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

Replies