Gentoo Archives: gentoo-python

From: "Jesus Rivero (Neurogeek)" <neurogeek@g.o>
To: Mike Gilbert <floppym@g.o>
Cc: "Michał Górny" <mgorny@g.o>, gentoo-python@l.g.o, python@g.o
Subject: [gentoo-python] Re: Handling packages not supporting multiple Python implementations
Date: Thu, 25 Oct 2012 21:25:53
Message-Id: CAD3zpD=-s_YiX=Ru6uA2tQ+3Ezz4EXO9y4G5yUQsZkdk+rMjaQ@mail.gmail.com
In Reply to: [gentoo-python] Re: Handling packages not supporting multiple Python implementations by Mike Gilbert
1 On Thu, Oct 25, 2012 at 5:00 PM, Mike Gilbert <floppym@g.o> wrote:
2 > On Tue, Oct 23, 2012 at 5:58 PM, Michał Górny <mgorny@g.o> wrote:
3 >> Hello,
4 >>
5 >> After starting to deploy python-r1 on packages supporting multiple
6 >> Python implementations, I believe it is time to start thinking about
7 >> those packages which don't support that. Firstly, I would like to gain
8 >> a general feedback/ideas on the possible solutions, without getting too
9 >> deep into the technical details of it.
10 >>
11 >> As far as I can think, we have the following possibilities:
12 >>
13 >>
14 >> 1) Assume that installing stuff for a single Python implementation is
15 >> deprecated and let the packages rot with the old eclass.
16 >>
17 >> It is probably the simplest solution (i.e. not doing anything to
18 >> address the issue) but truth be told, I doubt this will actually work.
19 >> People will just keep using the old eclass which doesn't really do much
20 >> good for those packages...
21 >>
22 >> And even if some people will actually start supporting multiple
23 >> implementations... that may be even worse. Just look at dev-libs/boost
24 >> to see what I mean.
25 >>
26 >>
27 >> 2) Use a xor-type REQUIRED_USE for those packages.
28 >>
29 >> Put the whole set of PYTHON_TARGETS but add a REQUIRED_USE='^^ ( ... )'
30 >> for them, effectively requesting only a single implementation being
31 >> enabled.
32 >>
33 >> I believe that this is quite a good solution, at least from
34 >> the dependency point of view. We clearly express which Python
35 >> implementations are supported by a particular package and which one was
36 >> enabled. We can express cross-package dependencies cleanly.
37 >>
38 >> The problem lies in user-friendliness. Although with the current
39 >> default (python2_7 only) it wouldn't cause any trouble, whenever user
40 >> enables more than a single implementation, every single-implementation
41 >> package will require package.use adjustment. This will become an even
42 >> more widespread issue when we decide to re-enable Python 3.
43 >>
44 >> To be honest, I don't see any good way around that.
45 >>
46 >>
47 >> 3) Use implicit implementation selection (like python.eclass).
48 >>
49 >> Well, as some say, this is a very good solution since it's well tested.
50 >> Its limitations and brokenness are obvious. Just I doubt it is really
51 >> worth the effort to write something that bad.
52 >>
53 >> The main problem here is that the chosen Python implementation is
54 >> implicit. Binary packages don't express it. Cross-package dependencies
55 >> don't express it. User changes the implementation, stuff breaks
56 >> silently and you end up with some kind of python-updater (why a tool
57 >> to fix breakage is called 'updater'?!).
58 >>
59 >>
60 >> Do you have any more ideas? Opinions?
61 >>
62 >
63 > Like you, I really can't come up with an ideal solution here.
64 >
65 > We really have 2 classes of packages here:
66 >
67 > 1. Packages that don't care what version of python you use, but
68 > install files outside of site-packages.
69 >
70 > 2. Packages that build code (like libraries) against a specific
71 > version of python/libpython.
72 >
73 > The implicit implementation selection works fine for #1, but not so well for #2.
74
75 I wonder if we could have a "special target" that could expand to the
76 current eselected python version. That way, the package not supporting
77 a multiple targets, could be treated the same as those who do.
78
79 Something like:
80
81 PYTHON_COMPAT=( python_current ), or something like that.
82
83 --
84 Jesus Rivero (Neurogeek)
85 Gentoo Developer

Replies