Gentoo Archives: gentoo-portage-dev

From: Martin Vaeth <martin@×××××.de>
To: gentoo-portage-dev@l.g.o
Subject: [gentoo-portage-dev] Re: Dynamic USE dependencies
Date: Sun, 05 Apr 2015 15:47:15
Message-Id: mfrldn$l2k$1@ger.gmane.org
In Reply to: Re: [gentoo-portage-dev] Dynamic USE dependencies by Zac Medico
1 Zac Medico <zmedico@g.o> wrote:
2 > On 04/02/2015 09:32 AM, Rich Freeman wrote:
3 >> Out of curiosity, what is keeping us from having USE flag dependencies
4 >> handled dynamically, in the same way that package dependencies are?
5 >
6 > It's already able to adjust USE automatically via autounmask support.
7
8 The problem is that once it is in your package.use
9 (no matter whether added manually or with autounmask),
10 it will stay there forever if the user does not analyze the
11 dependencies manually eventually.
12 And this is different from the dependency handling.
13
14 The most obvious example (which presumably also Rich had in mind)
15 is the case of abi_x86_32:
16
17 Assume that you have package foo in your world file which
18 (in version foo-1) depends on package bar. In version foo-2,
19 which appears some years later, it no longer depends on package
20 bar (but e.g. on package bazooka, instead).
21 In this case, "emerge --depclean" will eventually unmerge bar.
22
23 This works nicely.
24
25 However, if foo-1 depends on bar[abi_x86_32(-)] and something
26 else depends on bar[abi_x86_64] then, after upgrading to foo-2,
27 most users wil keep compiling bar with ABI_X86="32 64" forever,
28 because "emerge --depclean" (or any other tool) does not tell
29 them that now they might remove abi_x86_32 from package bar.
30
31 In fact, such a tool *cannot* exist, currently:
32 There is no way to distinguish from package.use what is
33 there because the user *wanted* this feature and what is there
34 "only" because of a (possibly temporary) USE-dependency for
35 another package.
36
37 In other words: The difference between "wanted" and "needed"
38 (reflected usually in the difference between the packages
39 in "world" and those in "/var/db/pkg") is not visible in
40 package.use, in principle.
41
42 So far, this was never a problem, because the number of
43 flags which were there because they were needed (and not,
44 because they were wanted) was rather low.
45 But with the arrival of ABI_X86="32" the situation has changed;
46 100-200 "needed" flags are now normal on many systems.
47
48 One suggestion around this problem would be to use different
49 directories for these two types of use-flags, say
50 "package.use" and "package.use.needed".
51 Perhaps it would make sense that portage --autounmask
52 writes only to "package.use.needed", und that there is
53 a "cleanup" command which removes all data from
54 package.use.needed except for that strictly necessary
55 to resolve the dependencies of the running system
56 (analogously like "emerge --depclean" currently removes
57 unneeded packages).

Replies

Subject Author
Re: [gentoo-portage-dev] Re: Dynamic USE dependencies Rich Freeman <rich0@g.o>