Gentoo Archives: gentoo-dev

From: Marien Zwart <marienz@g.o>
To: gentoo-dev@l.g.o
Subject: Re: [gentoo-dev] [RFC] Dynamic SLOTs
Date: Sun, 17 Jun 2012 10:52:56
Message-Id: 1339930310.20709.18.camel@cyclops.marienz.net
In Reply to: [gentoo-dev] [RFC] Dynamic SLOTs by "Michał Górny"
1 On zo, 2012-06-17 at 09:26 +0200, Michał Górny wrote:
2 > I'm attaching a reStructuredText version of the spec. You can view it
3 > rendered as a gist[1]. But please keep the replies on the list, rather
4 > than forking the gist.
5
6 I've only thought about this a little, but some thoughts so far:
7
8 A common operation in an ebuild will be (say) "get the selected version
9 of python". That's easy enough if there's only one kind of dynamic slot
10 being used by the ebuild (just use CURRENT_SLOTS directly), but if the
11 ebuild supports more than one kind of dynamic slot you need a helper
12 function that picks the selected value of that one kind of slot out of
13 CURRENT_SLOTS, either relying on the naming scheme or on a list of
14 supported values of that kind of slot hardcoded in the helper function
15 (in an eclass). That seems a little fragile. Your "dynamic slot groups"
16 idea could help with this, by having that list sit in a more sensible
17 place than in an eclass, and perhaps by having the package mangler
18 provide a variable per slot group (a little like how USE_EXPAND works).
19
20 I really dislike the implicit dependencies. First of all: it is entirely
21 possible for ebuild A supporting dynamic slots for (say) python to have
22 a build-time dependency on ebuild B that supports dynamic slots (also
23 for python), but only to get at a utility to run, not to use B as a
24 library. In that case we don't want to force slots to match, and (as you
25 point out) that may not even be possible if the two packages don't
26 support the same slots. Also, it just breaks down completely if you
27 don't use your "slot groups" idea: if A has DYNAMIC_SLOTS="|| ( py2.6
28 py2.7 )" and B has DYNAMIC_SLOTS="|| ( ruby1.8 ruby1.9 )" it makes no
29 sense to require the dynamic slot setting to match, but if A has
30 DYNAMIC_SLOTS="|| ( py2.5 py2.6 )" and B has "|| ( py2.7 py3.2 )" then
31 we do need them to match, and the user has requested an impossible
32 situation (he needs to use versions of A and B that have at least one
33 supported python version in common). Without "slot groups" the package
34 manager cannot tell these two cases apart.
35
36 I think it'd make more sense to have those slot groups, per-slot group
37 variables like DYNAMIC_SLOTS_PYTHON="py2.7 py3.2" resulting in
38 CURRENT_SLOT_PYTHON getting set, and an addition to the dependency
39 syntax that lets you depend on a matching named dynamic slot. That makes
40 your DYNAMIC_SLOTS="|| ( py2.6 py2.7 ruby1.8 ruby1.9 )" example
41 impossible, but I think it'd be uncommon for that approach to make
42 sense: I think it'd usually make more sense to split that into two
43 packages, one per language.
44
45
46 --
47 Marien Zwart

Replies

Subject Author
Re: [gentoo-dev] [RFC] Dynamic SLOTs "Michał Górny" <mgorny@g.o>