Gentoo Archives: gentoo-user

From: Alan McKinnon <alan.mckinnon@×××××.com>
To: gentoo-user@l.g.o
Subject: Re: [gentoo-user] dynamic deps, wtf are they exactly
Date: Sun, 27 Sep 2015 19:35:20
Message-Id: 560844D0.90302@gmail.com
In Reply to: Re: [gentoo-user] dynamic deps, wtf are they exactly by Michael Orlitzky
1 On 27/09/2015 19:26, Michael Orlitzky wrote:
2 > On 09/27/2015 11:07 AM, Alan McKinnon wrote:
3 >> Does anyone here know what dynamic deps are exactly, how they work and
4 >> can describe them?
5 >>
6 >> There's lots of talk over on -dev about getting rid of them and the
7 >> closest description is from Ciaran, something like:
8 >>
9 >> "ancient shit that never worked right, involving phases of the moon"
10 >>
11 >
12 > "Dynamic dependencies" is a portage option. The abridged version is:
13 > whenever you go to install/update something, some of its dependencies
14 > may already exist on your machine. For example, if I go to install gimp
15 > right now, gtk is already there.
16 >
17 > With dynamic deps, portage will scan (that is, execute) all of the
18 > ebuilds for installed packages that could affect the dependency graph.
19 > If any of those ebuilds have changed, portage will use the new
20 > information rather than the info present when you originally installed
21 > the package. So if the gtk ebuild (that I installed a month ago) has
22 > been altered, portage will re-read it on the fly, ignoring what was in
23 > there a month ago.
24 >
25 > too short; didn't explain?
26
27 Nope, I see a problem already :-)
28
29 If portage can't reliably tell if the ebuild changed, the cache may or
30 may not be valid and portage wouldn't know.
31
32
33 > When you install a package, its dependencies are recorded in the VDB:
34 >
35 > $ cat /var/db/pkg/app-editors/nano-2.3.6/RDEPEND
36 > >=sys-libs/ncurses-5.9-r1[unicode] sys-apps/file
37 >
38 > That's nice, because now if you want to install or update something
39 > else, portage doesn't have to re-execute every ebuild/eclass that could
40 > possibly affect the new thing -- it only has to check the VDB.
41 >
42 > But, if I'm the maintainer of nano and I change that ncurses dependency
43 > (let's say I drop it), then I have to make a revision bump on nano.
44 > Otherwise, the wrong dependency would stay recorded on everyone's
45 > system, and portage would happily use the recorded deps.
46 >
47 > I guess at some point there were a bunch of devs who were messing with
48 > dependencies and not bothering to make revision bumps. This can cause
49 > users pain, so portage added a new option to ignore the cache and rescan
50 > every single relevant ebuild/eclass for sneaky dependency changes. This
51 > ensures that portage has the correct dependencies in its head while it's
52 > doing resolution, but is much slower.
53 >
54 > And then that mode was made default, which is where we are today. It
55 > doesn't sound that bad so far -- just a tradeoff between speed and the
56 > risk of using an incorrect cached dependency.
57 >
58 > Buuuuuuutttttt dynamic-deps mode doesn't always kick in. It interacts
59 > weirdly with subslots and other things. If portage can't find the same
60 > ebuild to scan, it will find one that "looks like it." If that doesn't
61 > work, it's supposed to fall back to the cache. Nobody has a flow chart
62 > of exactly how this works. It's all in the code and there's no
63 > specification.
64 >
65 > And, there are other package managers besides portage. When developers
66 > rely on dynamic deps and skip revision bumps, they're screwing users of
67 > paludis and pkgcore (and you, now that you have dynamic deps disabled).
68 > None of the magic is mentioned in the PMS, so you really can't rely on
69 > it and revbumps are needed regardless.
70
71
72 Now it all makes sense, as a bonus I now see why why so many senior devs
73 are so pedantic about revbumps (they have reason).
74
75 Now that I know what the symptom will be, are bug reports useful?
76
77
78 --
79 Alan McKinnon
80 alan.mckinnon@×××××.com

Replies

Subject Author
Re: [gentoo-user] dynamic deps, wtf are they exactly Michael Orlitzky <mjo@g.o>