Gentoo Archives: gentoo-python

From: Brian Harring <ferringb@×××××.com>
To: Micha?? G??rny <mgorny@g.o>
Cc: gentoo-python@l.g.o, python@g.o
Subject: Re: [gentoo-python] python-r1 <-> python.eclass package dependencies
Date: Sun, 11 Nov 2012 07:52:54
Message-Id: 20121111075248.GA23241@localhost.corp.google.com
In Reply to: [gentoo-python] python-r1 <-> python.eclass package dependencies by "Michał Górny"
1 On Sat, Nov 10, 2012 at 05:43:22PM +0100, Micha?? G??rny wrote:
2 > Hello,
3 >
4 > As some of you are aware already, there is a significant difference
5 > in handling Python implementation choice between python.eclass
6 > and python-r1 / p-d-ng.
7 >
8 > The python.eclass packages use USE_PYTHON (undocumented variable)
9 > or the eselected Python2+3, and store that choice implicitly.
10 > Everything works on the assumption that implementations don't change
11 > or user runs python-updater.
12 >
13 > The python-r1 / p-d-ng packages use explicit USE flags to choose
14 > implementation. The choice is thus explicitly exported and other
15 > packages can use USE dependencies to enforce matching implementations.
16 >
17 > The problems arise whenever python-r1 package depends on package using
18 > the python.eclass, or the other way round. There is no clear way to
19 > enforce the same implementations being used, so everything falls down
20 > to user.
21 >
22 > In order to solve the most common problems due to that, I have
23 > published a news item explaining how PYTHON_TARGETS work and what needs
24 > to be done with them.
25 >
26 > In the discussion with other Gentoo Python devs, it was assumed that
27 > USE_PYTHON should not be considered public and thus not be described
28 > in the message. Sadly, it seems that this resulted in people actually
29 > trying to disable Python3 using PYTHON_TARGETS and seeing random
30 > failures due to python.eclass enforcing it anyway.
31 >
32 >
33 > I believe we should thoroughly think what should be done now in order
34 > to solve the issues best for the transition time. Here are a few
35 > solutions I can think of.
36
37 Honestly... if we care this much about USE_PYTHON, then we should use
38 it, rather than PYTHON_TARGETS.
39
40 Mind you, I'm aware someone ignored repeatedly being told "do not
41 fucking use periods in the targets- it cannot be allowed as a use flag
42 due to compatibility issues in profiles"- meaning we have to dig
43 out of a mess that was foresaw, but such is life.
44
45 Fixing USE_PYTHON is simpler than trying to get users to migrate to a
46 new var, let alone keep those two vars in sync.
47
48 To get there, we'd have to basically accept 2.6/2_6 in USE_PYTHON w/in
49 python.eclass (a modification I will sort if others won't), have it
50 spit warnings, then flip it to a USE_EXPAND target.
51
52 Portage, fortunately, is lose in this department- you can have a
53 USE_EXPAND target w/ invalid use chars in it. It's just not usable in
54 use dependencies nor IUSE, making it a dead setting if it uses invalid
55 chars.
56
57 So... thus:
58
59 1) make python.eclass know of both forms of USE_PYTHON (with periods,
60 without).
61 2) convert USE_PYTHON to a use expanded target
62 3) convert python.eclass to use it.
63
64 I realize this deprecates/kills PYTHON_TARGETS; my intention here
65 isn't to piss on the var you added, it's to choose the less disruptive
66 option here- lesser of two evils. Starting from scratch,
67 PYTHON_TARGETS would be fine- unfortunately we need to map existing
68 users (and usage) from python.eclass into the replacement,
69 constraining our choises a bit.
70
71 Counter arguments? To be clear, this is the path I strongly suggest
72 we take- if you can punch holes in the logic/arguments from above, I'd
73 definitely back down, but the use of PYTHON_TARGETS here feels like
74 we're setting ourselves up for unnecessary pain. Keep in mind not
75 *all* of python.eclass notions/setup has to be chucked- we can
76 translate certain parts of it across to ease developer/user pains.
77
78
79 > 1) lard both eclasses with USE_PYTHON <-> PYTHON_TARGETS consistency
80 > checks. This should be pretty easy for python-r1, harder for
81 > python.eclass (anyone volunteering to touch it in thick gloves?).
82 >
83 > In other words, we just warn users whenever they need to do something
84 > to ensure things work.
85 >
86 >
87 > 2) make python.eclass respect PYTHON_TARGETS.
88 >
89 > Sadly, due to PMS limitations we can't tell if PYTHON_TARGETS was set
90 > by user or has the default value. So we either can:
91 >
92 > a) stop using USE_PYTHON and eselect defaults, start using
93 > PYTHON_TARGETS only, pull in correct Python versions, tell users to run
94 > python-updater;
95
96 Just a note; we /never/ should listen to eselect defaults, only USE
97 enforced configuration; I'm appreciative you've not replicated that
98 python.eclass idiocy since it craps all over
99 deterministic/reproducible builds.
100
101 ~harring

Replies