1 |
On Sun, Sep 16, 2012 at 12:03:36AM +0200, Micha?? G??rny wrote: |
2 |
> On Sat, 15 Sep 2012 13:33:18 -0700 |
3 |
> Brian Harring <ferringb@×××××.com> wrote: |
4 |
> > To demonstrate the gain of this, we basically take the existing |
5 |
> > tree's deps, and re-render it into a unified DEPENDENCIES form. |
6 |
> |
7 |
> But in order to do this, we first have to decide exactly what kind |
8 |
> of dependencies do we want to have. Then convert the tree to |
9 |
> a separate-variable form with new dependencies. Then we can compare |
10 |
> it with the DEPENDENCIES form and decide which one is better. |
11 |
|
12 |
Funny you mentioned that, I just finished tweaking pquery to generate |
13 |
real world example unified dependencies; these *are* accurate, just to |
14 |
be clear. |
15 |
|
16 |
Dumps are at |
17 |
http://dev.gentoo.org/~ferringb/unified-dependencies-example/ . |
18 |
|
19 |
Herds, if you want to see what your pkgs would look like, look at |
20 |
http://dev.gentoo.org/~ferringb/unified-dependencies-example/herds/ . |
21 |
|
22 |
If you'd like to see an *example effect* it has on what gets displayed |
23 |
to the user (aka, after all major use conditionals are stripped), look |
24 |
at |
25 |
http://dev.gentoo.org/~ferringb/unified-dependencies-example/user-visible.txt |
26 |
; warning, that's a 55MB file. The syntax in use there isn't great, |
27 |
but as said, it's an example. |
28 |
|
29 |
Total cache savings from doing this for a full tree conversion, for |
30 |
our existing md5-cache format is 2.73MB (90 byes per cache entry). |
31 |
Calculating the savings from the ebuild/eclass standpoint is dependent |
32 |
on how the deps are built up, so I skipped that. |
33 |
|
34 |
The algorithim used is fairly stupid, but reasonably effectively; |
35 |
essentially it intersects the top level of each individual type of |
36 |
dep, breaking out common groupings. |
37 |
|
38 |
In other words, it won't pick up this: |
39 |
DEPEND="x? ( dev-util/diffball dev-util/bsdiff )" |
40 |
RDEPEND="x? ( dev-util/diffball )" |
41 |
|
42 |
and convert it into thus |
43 |
DEPENDENCIES=" |
44 |
dep:build,run? ( |
45 |
x? ( |
46 |
dev-util/diffball |
47 |
dep:run? ( |
48 |
dev-util/diffball |
49 |
) |
50 |
) |
51 |
)" |
52 |
|
53 |
Additionally, the form used here makes *no assumption about default |
54 |
context*; in any final solution we use, a default context would be |
55 |
wise- say build,run. Again, an example of what I mean. |
56 |
|
57 |
If we said "in the absense of a context, the default is dep:build,run" |
58 |
the following: |
59 |
|
60 |
DEPEND="dev-util/diffball dev-util/bsdiff" |
61 |
RDEPEND="dev-util/diffball de-vutil/bsdiff x? ( sys-apps/pkgcore )" |
62 |
PDEPEND="dev-python/snakeoil" |
63 |
|
64 |
would be: |
65 |
DEPENDENCIES=" |
66 |
dev-util/diffball |
67 |
dev-util/bsdiff |
68 |
dep:run? ( x? ( sys-apps/pkgcore ) ) |
69 |
dep:post? ( dev-python/snakeoil ) |
70 |
" |
71 |
|
72 |
The quicky algo I used assumes no default context, thus it writes |
73 |
this: |
74 |
DEPENDENCIES=" |
75 |
dep:build,run? ( |
76 |
dev-util/diffball |
77 |
dev-util/bsdiff |
78 |
) |
79 |
dep:run? ( x? ( sys-apps/pkgcore ) ) |
80 |
dep:post? ( dev-python/snakeoil ) |
81 |
" |
82 |
|
83 |
Etc. |
84 |
|
85 |
~harring |