Gentoo Archives: gentoo-dev

From: Daniel Campbell <zlg@g.o>
To: gentoo-dev@l.g.o
Subject: Re: [gentoo-dev] "Lazy" use flags?
Date: Tue, 09 Feb 2016 13:14:55
Message-Id: 56B9E646.4040206@gentoo.org
In Reply to: [gentoo-dev] "Lazy" use flags? by Kent Fredric
1 -----BEGIN PGP SIGNED MESSAGE-----
2 Hash: SHA256
3
4 On 02/09/2016 04:27 AM, Kent Fredric wrote:
5 > There's a frequent irritation I experience with the revolving door
6 > of REQUIRED_USE -> auto-unmask:
7 >
8 > There's no mechanism in place to automatically stop using a
9 > "REQUIRED" use flag when it ceases to be necessary.
10 >
11 > So you find yourself doing things like:
12 >
13 > - I want X - X only supports python 2.7 - X thus requires a
14 > dependency that supports both 2.7 and 3.5 to set USE= for python
15 > 2.7 - So you add a USE in your package.use for that dependency. -
16 > This creates a cascade of requiring python 2.7, sometimes
17 > extending to pull extra dependencies for back-ports.
18 >
19 > Later, X adds Python 3.5 support.
20 >
21 > And now you have redundant USE flags in place, and those USE flags
22 > pull in dependencies you no longer need in order to support a
23 > python 2.7 featureset.
24 >
25 > Now, this is not about "python", this is just the general pattern
26 > of ebuilds saying "I need this", and then requiring me to manually
27 > acknowledge "I need this" when I don't actually want this myself,
28 > similar to how packages "I need" go in the world file and don't
29 > get depcleaned, and packages I "don't need" are handled by portage
30 > automatically satisfying dependencies.
31 >
32 > And you have to invest a respectable amount of effort to prune
33 > these un-needed dependencies and features which portage now thinks
34 > "you want", even long after the reason for that is gone.
35 >
36 > What I'd like is a middle ground, a USE specification that can be
37 > stated in package.use that portage interprets as a "permission to
38 > enable" flag, a USE flag that is treated as "ON" if any dependency
39 > states it needs it on, and that is treated as "OFF" as soon as
40 > there are no dependencies in the graph that need it on.
41 >
42 > Or vice versa.
43 >
44 > Naturally, this needn't be part of PMS, because this pertains to
45 > nothing about the package dependency specification itself, only a
46 > feature for user convenience in the portage interface.
47 >
48 > I would love to be able to stop maintaining my reasonably large set
49 > of package.env tricks which I have to regularly update so that
50 > things I don't need will get expunged when I cease to need them,
51 > and I'd love to be able to say something like
52 >
53 > PYTHON_TARGETS="python3_5 python2_7?" and have portage treat the
54 > former as "always on" and the latter as "On if a dependency or
55 > REQUIRED_USE constraint indicated it was needed".
56 >
57 > Though it may not be so straight forward to implement, and is
58 > likely to complicate backtracking.... though in theory it could
59 > make things simpler.
60 >
61 > So I table this query to the dev ml in the event somebody else
62 > sees merit in the idea.
63 >
64
65 This is an interesting request, and if it was implemented correctly,
66 could reduce the number of blockers we see. It's almost like automatic
67 USE flag resolution.
68
69 The problem I see is syntax. I'm not 100% familiar with portage's
70 internals, so I don't know what sort of effects this would have across
71 an entire depgraph or resolution, etc. But it could be very useful.
72
73 Another concern, though, is it'd result in something similar. Instead
74 of "cat/foo bar baz" and later removing 'baz', you'd have "cat/foo bar
75 ~baz" (with '~baz' as 'enable this if you need to'). You'd still have
76 cruft left in your p.use file, and it would achieve the same result as
77 a well-commented file.
78
79 I've personally taken to creating little "blocks" of USE flags, even
80 if redundant, and adding a comment just above them explaining why I
81 add them. It's not perfect, but if I get curious and check back on it,
82 I'll always know why I added it.
83
84 A possible solution to the file issue is some way of letting the user
85 know prior to merging that a "lazy" USE flag was specified that's no
86 longer needed. That could be somewhat easy to implement, as it would
87 merely check REQUIRED_USE and compare it against any lazy flags. If
88 they match, show the message.
89
90 Regardless, I think it's a neat idea. I'm just not sure if it'd be
91 something easily implementable in portage/emerge.
92
93 - --
94 Daniel Campbell - Gentoo Developer
95 OpenPGP Key: 0x1EA055D6 @ hkp://keys.gnupg.net
96 fpr: AE03 9064 AE00 053C 270C 1DE4 6F7A 9091 1EA0 55D6
97 -----BEGIN PGP SIGNATURE-----
98 Version: GnuPG v2
99
100 iQIcBAEBCAAGBQJWueZFAAoJEAEkDpRQOeFwDxcP/AhRuCsjXm9jjEhT1vfagj9t
101 7imcFj6czggxBno9Bg5lZFkkU80lPG56wTq6MHAMF7DSwj3HxW1dwLbQSSqQHCLJ
102 5VzqXM74h5v4TBK24Fq5ht+sN6U3uO5JmaCv2qXg3xiWu34AapdVsCHq+JO2ew/y
103 quIF18TmpdGbRpnzyXCkdySvqI8GfJYVrFXJsvNN/2H0qgTmS5LQsnqxP6hGhHkc
104 4qg+GQ4cm5JpLNBo58F+2j2c8kXpicZ4cHMk2RCbX/Hv8u/qsNtYcYcAlsOxJVUP
105 0iEVlPboQKMQMdK0Mpbhp/Tok1ydpqErXRwijFs5uB249RmeqniWgNbSJtoHZQh1
106 49VA6fmRo422UaYKb7ZqTK01fSuvC3nRWr3HT/XSb5B4+OrqPUkM7DyElkvBZuQu
107 YJM2QlmBJ/16XjIwVB6hcS5K/PxvPD+9mU5weyVVTSLjcNHDPMq+K7Gunwn/0Rji
108 spBTzZQvFfRtiiufIQIWIWIampfNaTMIWEC5CoLSRstxse9w+Qvn+dPd7XCgfpOt
109 qvF4Qlc715oiGIwF/rGSEq8HHNsW7ZP5YozHTD9Wa7sxl0WxFJWfYJiQ9o7Lclxu
110 2EldNk1DNWiC4SQA2haEm64KrSFHfrT/3RZ3XPDBl2iaTrn2NAo5abJJGLZuCmtZ
111 GdcbzDhYKeZJBH4ZOI2U
112 =x47s
113 -----END PGP SIGNATURE-----

Replies

Subject Author
Re: [gentoo-dev] "Lazy" use flags? Kent Fredric <kentfredric@×××××.com>