Gentoo Archives: gentoo-dev

From: Kent Fredric <kentfredric@×××××.com>
To: gentoo-dev <gentoo-dev@l.g.o>
Subject: [gentoo-dev] "Lazy" use flags?
Date: Tue, 09 Feb 2016 12:27:26
Message-Id: CAATnKFAFmEJkXmJTQSPKznrQ=MXF8oocyzWgZ_a2mt9zjgF55g@mail.gmail.com
1 There's a frequent irritation I experience with the revolving door of
2 REQUIRED_USE -> auto-unmask:
3
4 There's no mechanism in place to automatically stop using a "REQUIRED"
5 use flag when it ceases to be necessary.
6
7 So you find yourself doing things like:
8
9 - I want X
10 - X only supports python 2.7
11 - X thus requires a dependency that supports both 2.7 and 3.5 to set
12 USE= for python 2.7
13 - So you add a USE in your package.use for that dependency.
14 - This creates a cascade of requiring python 2.7, sometimes extending
15 to pull extra dependencies for back-ports.
16
17 Later, X adds Python 3.5 support.
18
19 And now you have redundant USE flags in place, and those USE flags
20 pull in dependencies you no longer need in order to support a python
21 2.7 featureset.
22
23 Now, this is not about "python", this is just the general pattern of
24 ebuilds saying "I need this", and then requiring me to manually
25 acknowledge "I need this" when I don't actually want this myself,
26 similar to how packages "I need" go in the world file and don't get
27 depcleaned, and packages I "don't need" are handled by portage
28 automatically satisfying dependencies.
29
30 And you have to invest a respectable amount of effort to prune these
31 un-needed dependencies and features which portage now thinks "you
32 want", even long after the reason for that is gone.
33
34 What I'd like is a middle ground, a USE specification that can be
35 stated in package.use that portage interprets as a "permission to
36 enable" flag, a USE flag that is treated as "ON" if any dependency
37 states it needs it on, and that is treated as "OFF" as soon as there
38 are no dependencies in the graph that need it on.
39
40 Or vice versa.
41
42 Naturally, this needn't be part of PMS, because this pertains to
43 nothing about the package dependency specification itself, only a
44 feature for user convenience in the portage interface.
45
46 I would love to be able to stop maintaining my reasonably large set of
47 package.env tricks which I have to regularly update so that things I
48 don't need will get expunged when I cease to need them, and I'd love
49 to be able to say something like
50
51 PYTHON_TARGETS="python3_5 python2_7?" and have portage treat the
52 former as "always on" and the latter as "On if a dependency or
53 REQUIRED_USE constraint indicated it was needed".
54
55 Though it may not be so straight forward to implement, and is likely
56 to complicate backtracking.... though in theory it could make things
57 simpler.
58
59 So I table this query to the dev ml in the event somebody else sees
60 merit in the idea.
61
62 --
63 Kent
64
65 KENTNL - https://metacpan.org/author/KENTNL

Replies

Subject Author
Re: [gentoo-dev] "Lazy" use flags? Daniel Campbell <zlg@g.o>