Gentoo Archives: gentoo-dev

From: Duncan <1i5t5.duncan@×××.net>
To: gentoo-dev@l.g.o
Subject: [gentoo-dev] Re: revbumping ebuilds after USE dependency changes
Date: Mon, 29 Jul 2013 00:40:16
Message-Id: pan$74096$84a9cc15$5c414eac$f1c40d80@cox.net
1 Michał Górny posted on Sun, 28 Jul 2013 11:11:13 +0200 as excerpted:
2
3 > With a proper design, you have two 'repos': one with ebuilds,
4 > and the other consisting purely of installed packages (vardb/system).
5 > What's important, per definition vardb is self-satisfactory. That is,
6 > dependencies of every installed package are supposed to be satisfied by
7 > installed packages purely.
8 >
9 > Now, what portage does is implicitly applying _some_ of the metadata
10 > from the ebuild tree to vardb without rebuilding the package. In some
11 > cases. As an effect, vardb is no longer self-satisfactory,
12 > and represents something between the package that was built and the
13 > current ebuild.
14 >
15 > Ciaran has already elaborated a bit on the potential issues. It gets
16 > most dangerous when you create some meaningful changes without a
17 > revbump. I'll give you a simple example that I can think of.
18 >
19 > Say, you fix a semi-build-time issue of linking against unnecessary dep.
20 > Users who build the ebuild from now on benefit by having less deps. The
21 > dep is less problematic than rebuilding the package, so users who built
22 > it before prefer to wait for next version.
23 >
24 > But in this case, portage may implicitly update the deps from ebuild
25 > without rebuilding it. This means that users who still link against the
26 > dep, may end up with the dep removed and program broken.
27
28 This is an extremely good explanation (much better and shorter than I
29 would/could have done, I believe). Thanks.
30
31 The one thing it's missing, and that's more on the practical than
32 theoretical end I believe the explanation was targeting, is that these
33 days, portage's depclean has an additional level of caution/safety built-
34 in, that in practice limits the damage quite a bit from what the above
35 theory would predict, very likely in response to complaints about that
36 very problem.
37
38 I haven't checked the details and depclean does run far faster than
39 revdep-rebuild so whatever it's doing isn't as thorough, but depclean now
40 does at least some actual on-system checking before removing a package,
41 and will refuse to remove a package it otherwise would (no database deps
42 requiring it so the database says it's fine to remove) with an
43 explanation of what's actually linked against it, if depclean's pre-clean
44 scans indicate that removing the package would otherwise leave an
45 unsatisfied/dangling linkage, asking you to rebuild the depending package
46 first to remove that in-practice-but-not-in-database dependency.
47
48 This behavior can actually be a bit frustrating if the depending package
49 in question has an "automagic" dependency that will link against a
50 package if it finds it installed, but doesn't declare it as a dep, as the
51 requested rebuild won't solve the undeclared dependency in that case, so
52 the depended package must be removed manually (using emerge --unmerge,
53 which doesn't do this scan and has a nice scary warning to that effect)
54 and the automagic-depending package rebuilt AFTER the depended package as
55 been removed.
56
57 That's actually how I ended up finding out how well depclean's scans
58 work, since it said to rebuild a package that didn't declare a
59 dependency, which I did, but that didn't solve the problem as it was an
60 automagic dependency that was linked in as long as the files were found
61 on the system to link against. The gentoo automagic-dependency bug I
62 filed was initially closed as invalid, too, because the gentoo package
63 maintaining dev wasn't in fact aware of depclean's then rather new
64 ability to catch such problems, either. But I reopened, mentioning
65 depclean's (then) new scanning and asking him to actually try it and to
66 consult with Zac if he had questions about the (then) new behavior, which
67 he evidently did, as the bug was fixed properly, automagic dependency
68 converted into a USE flag covered dependency, with a comment to the bug
69 thanking me for re-opening and alerting him to the problem. =:^)
70
71 Altho I believe it's limited to elf-dependency checking and arguably
72 isn't the best theoretical solution, in practice depclean's solution is
73 rather nice, since it catches both dynamic-dep problems like those in
74 this thread, and automagic-linking issues that no pure database solution
75 could catch, since by definition, automagic dependencies are not declared
76 in the database, or they'd be declared dependencies not automagic
77 dependencies. (By the same token, it should catch dependencies for
78 independently compiled and installed packages that are obviously not in
79 the database except possibly via package.provided, as well. =:^)
80
81 But I do believe depclean's scan won't catch python/perl/ruby/shell/etc
82 dependencies, only elf-binary. That remains a problem, but one that for
83 many gentooers anyway, isn't actually too big a deal in practice.
84
85 --
86 Duncan - List replies preferred. No HTML msgs.
87 "Every nonfree program has a lord, a master --
88 and if you use the program, he is your master." Richard Stallman

Replies