Gentoo Archives: gentoo-dev

From: Thomas Sachau <tommy@g.o>
To: gentoo-dev@l.g.o
Subject: Re: [gentoo-dev] Actions of python team, especially Arfrever wrt python eclass and python-3*
Date: Sun, 06 Jun 2010 10:41:04
Message-Id: 4C0B7B1C.3000009@gentoo.org
In Reply to: Re: [gentoo-dev] Actions of python team, especially Arfrever wrt python eclass and python-3* by Graham Murray
1 Am 06.06.2010 08:36, schrieb Graham Murray:
2 > Thomas Sachau <tommy@g.o> writes:
3 >
4 >> Since python-3* is currently useless and not required for any package, the dependency should by
5 >> default only pull in python-2* like this:
6 >>
7 >> =dev-lang/python-2*
8 >>
9 >> With that, the default way would not pull in a package, which is not needed or used. And if there
10 >> will be any package, which really requires python-3*, it simply requests it in (R)DEPEND of the
11 >> ebuild, which then would overwrite the default value of the eclass and pull in python-3*.
12 >
13 > That would not work. For example if package 'bar' supports both python-2
14 > and python-3, your mechanism will only build in python-2 support. That
15 > is fine until package 'foo' comes along which uses 'bar' but also
16 > requires python-3 - thus not only must python-3 be pulled in as a result
17 > of foo's (R)DEPEND but also 'bar' must be rebuilt with python-3 support.
18
19 And that is, how it should be done. Think for example of a package foo, which has a "png" USE flag,
20 which will pull in libpng. By default disabled, it results in disabled png support and libpng not
21 pulled in. Now, when some other package requires foo with png USE flag enabled, you will have to
22 recompile foo with png USE flag and you will have to install libpng. We have the usedeps of EAPI-2
23 for it and the package manager does handle it, depending on the user requests.
24
25 But for optional python-3 support, you cannot control it easily with your package manager because of
26 the current way, how it is implemented.
27
28 >
29 > This could be done by adding python2 and python3 USE flags to packages
30 > which support both and only have python2 enabled by default. Then 'foo'
31 > could have a conditional (R)DEPEMD on 'bar[python3]', but that would
32 > require the user to change the USE flags whereas the current system
33 > handles everything automatically.
34
35 And automagic behind the scene is exactly, what should not happen. The user should be able to
36 control optional dependencies, it should be the same for python like for any other package.
37
38 My base proposal for this is something like this:
39
40 Every package defines the language(s), where it could be installed for multiple slots, e.g.:
41
42 MULTI_SLOT="python" or
43 MULTI_SLOT="python ruby"
44
45 Additionally, it should define the supported slots, something like this:
46
47 SUPPORTED_RUBY_SLOTS="1.8 1.9" or
48 SUPPORTED_PYTHON_SLOTS="2.5 2.6 3.0 3.1"
49
50 Now the package manager should take those vars and convert them to some expanded USE vars like:
51
52 RUBY_SLOTS="1.8 1.9" or
53 PYTHON_SLOTS="2.5 2.6 3.0 3.1"
54
55 By default, the current active version should be enabled, the others disabled. In addition, every
56 dependency, which requires ruby/python should get internal usedeps, so that they require the same
57 slots as this package. Every enabled slot should of course pull in that slot of the language.
58
59 With this way, every user can select, which slots he wants to use and which slots should be
60 installed. And if any package requires an installed version for a specific slot, it can be set in
61 (R)DEPEND (e.g. like DEPEND=" python? ( dev-db/foo[pyhon_slot_2.6] )")
62
63 It would also reduce the amount of code, since we would not have to implement multi-slot support in
64 many different eclasses and it would additionally move the dependency control back to the package
65 manager unlike the current python implementation.
66
67 I currently have a branch of portage ("multilib-portage"), which can install a package for different
68 platforms, it could be extended to implement the above idea and i plan to do that. Since i am the
69 only person working on it and me only having limited time and knowledge, it could still take some
70 time, if noone else wants to step in and help with it.
71
72 --
73 Thomas Sachau
74
75 Gentoo Linux Developer

Attachments

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

Replies