Gentoo Archives: gentoo-python

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

Replies

Subject Author
Re: [gentoo-python] python-r1 <-> python.eclass package dependencies "Michał Górny" <mgorny@g.o>