Gentoo Archives: gentoo-python

From: Mike Gilbert <floppym@g.o>
To: "Michał Górny" <mgorny@g.o>
Cc: gentoo-python <gentoo-python@l.g.o>, Gentoo Python Project <python@g.o>
Subject: [gentoo-python] Re: The future of PYTHON_SINGLE_TARGET
Date: Sun, 30 Nov 2014 18:12:27
Message-Id: CAJ0EP42VaZr+bQDsEQbV8E=5p0W0fdH0GpKs1yhaeEyaUcjjjA@mail.gmail.com
In Reply to: [gentoo-python] The future of PYTHON_SINGLE_TARGET by "Michał Górny"
1 On Fri, Nov 28, 2014 at 5:59 PM, Michał Górny <mgorny@g.o> wrote:
2 > Friends!
3 >
4 > The current state of python-single-r1 bothered me a lot lately,
5 > and while _AxS_ did some neat improvements to the eclass, it's still
6 > far from perfect solution to our users.
7 >
8 > The PYTHON_SINGLE_TARGET flags were added to make it easier to handle
9 > single-impl packages that support both Python 2 & Python 3 which we
10 > enable both in our profiles. It serves that purpose well -- however, it
11 > isn't that good for single-impl packages that don't support the most
12 > common choice of implementations.
13 >
14 > In particular, it has two major issues:
15 >
16 > 1. We have no sane, clear and universal way of providing users with
17 > sensible defaults. It's always one trade-off over another.
18 >
19 > 2. Matching USE dependencies against multi-impl packages introduces
20 > a second set of USE flags (PYTHON_TARGETS) that are semi-virtual.
21 > Sadly, they introduce confusion and cause issues.
22 >
23 >
24 > As far as the first issue is concerned, I think enough has been said
25 > already. Right now we are fine-tuned for two cases:
26 >
27 > a. packages that support one impl only -- then they have a single
28 > PYTHON_TARGET that's enabled by default,
29 >
30 > b. packages that support python2.7 -- then we have the profile default
31 > of python2.7 for them.
32 >
33 > We have no good way of handling packages that support Python 3 only.
34 >
35
36 I'm thinking we need to move the default PYTHON_SINGLE_TARGET setting
37 from profiles to IUSE defaults computed in the eclass.
38
39 What are the problems associated with that?
40
41 >
42 > The other issue comes into game in two cases I've seen:
43 >
44 > A. when we try to improve setting of PYTHON_SINGLE_TARGET, we force
45 > the user to enable matching PYTHON_TARGET anyway -- so in the end
46 > manual intervention is required,
47
48 That would seem to be the exception rather than the norm. This would
49 only happen if we somehow defaulted PYTHON_SINGLE_TARGET to something
50 that is not in PYTHON_TARGETS by default. How would that ever happen?
51
52 > B. they cause issues with REQUIRED_USE on other packages (like libpeas
53 > that supports only one version of python2 and one of python3). Even
54 > though PYTHON_SINGLE_TARGET results in effective use of a single impl,
55 > PYTHON_TARGET USE-dep requests full PYTHON_TARGETS match on the dep.
56 > Therefore, the user needs to disable other implementations anyway to
57 > get the expected result.
58
59 I don't understand this part. Can you please explain it? Maybe an example?
60
61 > So, what are your thoughts? What are your solutions?
62
63 I don't really understand the problems well enough to propose
64 solutions. Hopefully answering my questions above will help with that.

Replies

Subject Author
Re: [gentoo-python] Re: The future of PYTHON_SINGLE_TARGET "Michał Górny" <mgorny@g.o>