Gentoo Archives: gentoo-python

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

Attachments

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

Replies

Subject Author
Re: [gentoo-python] python-r1 <-> python.eclass package dependencies Matthew Summers <quantumsummers@g.o>