Gentoo Archives: gentoo-dev

From: Mart Raudsepp <leio@g.o>
To: gentoo-dev@l.g.o
Subject: Re: [gentoo-dev] EAPI-3 draft: slot operator support
Date: Thu, 09 Apr 2009 11:08:09
Message-Id: 1239275263.988.25.camel@localhost
In Reply to: Re: [gentoo-dev] EAPI-3 draft: slot operator support by "Tiziano Müller"
1 On N, 2009-04-09 at 11:30 +0200, Tiziano Müller wrote:
2 > Am Donnerstag, den 09.04.2009, 05:25 +0300 schrieb Mart Raudsepp:
3 > > Hello,
4 > >
5 > >
6 > > This thread is for any discussion about the slot operator support item
7 > > in EAPI-3 draft.
8 > >
9 > > The premise is good what := and :* allow for, but I'm concerned about
10 > > the syntax possibly ending up being suboptimal in relation to the syntax
11 > > we come up in the future for covering the cases not covered now.
12 > >
13 > >
14 > > Such cases are for example:
15 > >
16 > > * A library package has slots 2.4, 2.6 and 2.8. An application works
17 > > with either 2.6 or 2.8, but needs a recompile for changed ABI. It does
18 > > not work with 2.4 - it has API missing that it needs.
19 > DEPEND=RDEPEND=">=cat/lib-2.6:="
20
21 This is an abuse of the version number. There is no actual guarantee
22 that SLOT 2.6 revisions carry a 2.6* version number, etc.
23
24 > > * Same case as previous, but additionally the library has a version with
25 > > slot 3.0 - it is a complete redesign and applications working with 2.8
26 > > have no chance of working. So need to express a list of acceptable SLOTs
27 > > or a minimum and maximum (but slots aren't really guaranteed to be
28 > > numeric and versionable).
29 > slot operators won't help here, so it remains:
30 > RDEPEND="|| ( cat/lib:2.6 cat/lib:2.8 )"
31
32 The package additionally needs to know which one the package manager
33 picked for it, to instruct the build system to actually use that
34 version.
35 Without this the whole := deal is pretty useless for many cases.
36
37 > with ranged dependencies:
38 > RDEPEND="cat/lib[>=2.6&<3]:="
39
40 Version/slot mixing abuse
41
42 > or slot ranges:
43 > RDEPEND="cat/lib:[2.6|2.8]="
44 > or
45 > RDEPEND="cat/lib:=[2.6|2.8]"
46 > (depends on how we want to define the syntax)
47
48 I guess that would go along with the := proposed now and therefore be an
49 evolution and not a problem to do := now. At least for this case.
50
51 > > * Same case as previous (either of them), but if using SLOT 2.6, it
52 > > needs to be at least >=libr/ary-2.6.5:2.6 and if SLOT 2.8 at least
53 > > >=libr/ary-2.8.3:2.8. A re-compile if switching provider may or may not
54 > > be necessary (considering both cases separately)
55 > slot operators won't help here, so it remains:
56 > RDEPEND="|| ( >=cat/lib-2.8.3:2.8 >=cat/lib-2.6.5:2.6 )"
57
58 That doesn't work for the same reason cat/lib or || ( cat/lib:2.6
59 cat/lib:2.8 ) doesn't.
60
61 > again with ranged dependencies (somebody please check this):
62 > RDEPEND="cat/lib[<3.0&(>=2.8.3|>=2.6.5)]:="
63 > or
64 > RDEPEND="cat/lib[<3.0&(>=2.8.3|>=2.6.5)]:*"
65 >
66 > or maybe combined with slot ranges:
67 > RDEPEND="cat/lib[>=2.8.3|>=2.6.5]:=[2.8|2.6]
68
69 There is no relation between 2.8.3 and slot 2.8 here really.
70 We do not declare anywhere how SLOT naming related to version numbers
71 it's used in. So none of those examples work for me.
72
73 > please note: the ebuild maintainer has to make sure that the package has
74 > to use the best-matching version, otherwise even the slot specifiers are
75 > worthless.
76
77 The package manager needs to tell the ebuild which version it went with,
78 or this doesn't work right. If you assume best matching version always,
79 then all this slot operator deal becomes superfluous. Maintainers should
80 then simply always depend on just the latest version and there is
81 minimal benefits to slot operators and the complexity in the readability
82 might not be worth it.
83
84 > Real-world example for that:
85 > DEPEND="sys-libs/db:="
86 > RDEPEND="${RDEPEND}"
87 >
88 > By the time of installation you have sys-libs/db:{4.6,4.7} installed,
89 > then your app has to use sys-libs/db:4.7.
90 > (best_version should provide that information as far as I know).
91 >
92 > >
93 > > * A library provides slots 1.2, 1.4 and 1.6. An application can work
94 > > with all of them, but needs a recompile if upgrading from being linked
95 > > against 1.2 to newer. 1.4 and 1.6 are runtime interchangeable. Very rare
96 > > possibility of this though, involving dlopen and more. Probably
97 > > acceptable to declare rebuild need for all changes.
98 > Yes.
99 >
100 > > Are we sure := and :* is the syntax that makes sense once we try to
101 > > cover some of the above with new syntax?
102 > Yes. It's quiet extendable (as seen above).
103 >
104 > >
105 > > Perhaps some forward thinking is sensible here to not end up with having
106 > > to deprecate the := and :* syntax soon after its introduction.
107 > Done.
108
109
110 I see no need for :* based on the examples provided and can't think of
111 any real world cases for it either right now.
112 There is that theoretical case when some package does dynamic usage of
113 the library through dlopen and handles the ABI differences, but even
114 then there is no guarantee (and it is quite unlikely) that it can handle
115 a future ABI SLOT of the library, and so using :* is unsafe, and :=[list
116 of known to work ABI SLOTs] should be used instead.
117
118
119 --
120 Mart Raudsepp
121 Gentoo Developer
122 Mail: leio@g.o
123 Weblog: http://planet.gentoo.org/developers/leio

Attachments

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