Gentoo Archives: gentoo-python

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

Replies