Gentoo Archives: gentoo-dev

From: Brian Harring <ferringb@×××××.com>
To: gentoo-dev@l.g.o
Subject: Re: [gentoo-dev] Re: example conversion of gentoo-x86 current deps to unified dependencies
Date: Sun, 30 Sep 2012 22:16:12
Message-Id: 20120930221518.GG2180@localhost
In Reply to: Re: [gentoo-dev] Re: example conversion of gentoo-x86 current deps to unified dependencies by Ian Stakenvicius
1 Pardon the belated response; responding to emails that are quick where
2 possible, but lagging on -dev. Missed this one however...
3
4 On Wed, Sep 19, 2012 at 09:16:02AM -0400, Ian Stakenvicius wrote:
5 > -----BEGIN PGP SIGNED MESSAGE-----
6 > Hash: SHA256
7 >
8 > On 19/09/12 09:09 AM, Michael Orlitzky wrote:
9 > > On 09/19/2012 06:59 AM, Duncan wrote:
10 > >> Ben de Groot posted on Wed, 19 Sep 2012 12:22:06 +0800 as
11 > >> excerpted:
12 > >>
13 > >>> On 16 September 2012 21:15, Brian Harring <ferringb@×××××.com>
14 > >>> wrote:
15 > >>
16 > >>>> So... basically, people are already doing this manually with
17 > >>>> their own intermediate vars.
18 > >>>
19 > >>> And this works fine, so it doesn't warrant a cosmetic change.
20 > >>
21 > >> @ferringb:
22 > >>
23 > >> yngwin has a point that I've not seen addressed.
24 > >>
25 > >> What /is/ wrong with the whole CDEPEND intermediate var idea? It
26 > >> seems to work and /I/ don't know of any problems with it (and it
27 > >> would appear, neither does yngwin), yet you talk about it as if
28 > >> there's something wrong with it.
29 > >>
30 > >> And while we're at it, do DEPEND="$RDEPEND ..." style solutions
31 > >> have the same problems (or lack thereof)?
32 > >
33 > > The problem appears as we introduce more DEPEND variables (which is
34 > > what prompted the proposal, IIRC). If we have ADEPEND, BDEPEND,
35 > > CDEPEND, and DDEPEND, and there's only some (i.e. not total)
36 > > sharing going on then the COMMON_DEPEND pattern starts to fall
37 > > apart. You potentially need,
38 > >
39 > > AB_DEPEND AC_DEPEND AD_DEPEND BC_DEPEND BD_DEPEND CD_DEPEND
40 > > ABC_DEPEND ABD_DEPEND ACD_DEPEND BCD_DEPEND ABCD_DEPEND
41 > > (COMMON_DEPEND)
42 > >
43 > > This obviously gets worse as more DEPEND vars are introduced.
44 > >
45 >
46 > Well not really, no -- the additional *DEPENDs that are being proposed
47 > (or at least mentioned) for new EAPI will either remove atoms from
48 > COMMON_DEPEND/DEPEND/RDEPEND or will be used so tersely that a
49 > COMMON_DEPEND or other intermediate variable won't really be necessary
50 > for them.
51
52 It depends on the dep type actually, and how we're viewing those deps-
53 if they must be complete or not.
54
55 Consider test depends for example. Either we can specify it as "in
56 addition to depend"- which sucks, because it's entirely possible for a
57 DEPEND target to not be required for TDEPEND.
58
59 While that's a corner case, it's actually easy to address; just
60 require TDEPEND to be comprehensive for the test phase.
61
62 Thus DEPEND and TDEPEND suddenly share a lot, and TDEPEND shares part
63 of RDEPEND.
64
65 Moving on to a real world example... PDEPEND. Currently a full graph
66 resolution requires pulling RDEPEND and PDEPEND, collapsing them, and
67 ensuring they're fullfilled for anything that is already installed
68 (ie, PDEPEND is required after the transaction is completed).
69
70 In our current separated var setup, this as said, this requires the PM
71 to track/handle it separately. However, were PDEPEND to be
72 complete/full- that would mean the PM could just render for dep:post
73 and know "this is what is necessary outside of the transactional block
74 of building/installing it".
75
76 So RDEPEND and PDEPEND actually share a *shitton*- they're the same
77 contents in 97% of the tree. Meaning dep:run,post? for 97% of the
78 tree, w/ 3% needing to have an addition dep:post? section.
79
80 Offhand, comprehensive deps make things easier for devs- it gives them
81 the ability to be crystal-freaking-clear as to what's needed at each
82 stage; via them doing so, it means the resolver has a greater space to
83 dig itself out of fucked up situations if necessary.
84
85 Additionally, it actually makes life easier for PM authors. If we had
86 TDEPEND (test), this is how things would go; note this is written for
87 just an install, not a replacement (replace is similar, just noisier
88 deflecting from my point):
89
90 1) ensure DEPEND is satisfied
91 2) run phases setup -> compile
92 3) ensure TDEPEND is satisfied; Implicitly, DEPEND in the process (if
93 there is a cycle induced by TDEPEND + DEPEND being required, we have
94 no way out of it).
95 4) run install phase
96 5) ensure RDEPEND is satisfied. No longer care about TDEPEND/DEPEND.
97 6) run pkg_preinst, merge, pkg_postinst.
98 7) a transaction is opened up, that must be completed before the PM
99 exits; before that exit, RDEPEND must still be satisfied, as must
100 PDEPEND.
101
102 With what I'm suggesting.
103 1) ensure dep:build is satisfied
104 2) run phases setup -> compile
105 3) Ensure dep:test is satisfied. If cycle breaking is necessary,
106 anything in dep:build but not dep:test can be pulled.
107 4) install phase
108 5) ensure dep:run is satisfied. Again, if cycle breaking is
109 necessary, punt whatever isn't in dep:run as necessary to break that
110 cycle.
111 6) pkg_preinst, merge, pkg_postinst.
112 7) transactional block; ensure dep:post is satisfied before exiting
113 said transaction.
114
115 That's for install; for the PM considering a pre-installed pkg, it
116 converts from;
117 1) ensure RDEPEND and PDEPEND are satisfied
118
119 to
120 1) ensure dep:post is satisfied.
121
122 Tbh, I'm not sure I'm communicating these gains as well as I could be;
123 at first glance, I'm pretty sure people will say "what's the
124 difference?" because the gains/difference there are subtle.
125
126 From a PM level, I can tell you this shift to complete deps per stage
127 *does* make things easier via simplifying the rules at each step
128 (namely, render for this form, that's what's required for this point
129 on), while giving full control to devs to be dead on accurate in their
130 deps specified (which the PM can then exploit for better cycle
131 breaking).
132
133 The point I'm trying to make here is that each dep phase
134 should be authorative; in doing so, you start getting
135 a lot of potential subsets (DEPEND is a subset of TDEPEND, TDEPEND
136 isn't completely, but mostly a subset of RDEPEND as RDEPEND is a
137 likely a superset of DEPEND; PDEPEND is a superset of RDEPEND).
138
139 So... you could do COMMON_DEPEND, COMMON_TDEPEND, COMMON_RDEPEND in
140 the ebuild. Or you could just use a syntax form that allows you to
141 directly inline that up front, rather than having to muck around w/
142 intermediate vars.
143
144
145 > Besides, this isn't actually a -problem- as there's nothing which
146 > really requires one to use such helpers; ebuild writers just, well,
147 > can. :)
148
149 Getting to this point; yes, people could hack around it manually.
150 Pretty sure that hasn't been in doubt.
151
152 The question is what do we *gain* from making them do so. No one here
153 has stated what we gain from COMMON_DEPENDS in comparison to
154 DEPENDENCIES (where they can just inline it).
155
156 And as I'm trying to lay out, where dependencies *should* be going
157 towards, this issue will get worse if we're doing it out of band from
158 DEPENDENCIES.
159
160 ~harring

Replies