Gentoo Archives: gentoo-dev

From: Brian Harring <ferringb@×××××.com>
To: Ciaran McCreesh <ciaran.mccreesh@××××××××××.com>
Cc: gentoo-dev@l.g.o
Subject: Re: [gentoo-dev] pkg_pretend USE validation and VALID_USE alternative
Date: Thu, 01 Apr 2010 07:58:25
Message-Id: 20100401075608.GJ11663@hrair
In Reply to: Re: [gentoo-dev] pkg_pretend USE validation and VALID_USE alternative by Ciaran McCreesh
1 On Thu, Apr 01, 2010 at 08:41:02AM +0100, Ciaran McCreesh wrote:
2 > On Thu, 1 Apr 2010 00:31:09 -0700
3 > > As demonstrated, that cycle is easily broken. A lot of the cycles
4 > > users run into originate that way also.
5 >
6 > Congratulations. You just turned on 'build' and 'bootstrap', and turned
7 > off 'acl'.
8
9 Actually, I'm well aware I did. See, if PMS wasn't developed in a
10 void you'd know build, bootstrap, acl and friends were already a known
11 issue with use cycle breaking.
12
13 Thing is, in checking the problem through we couldn't find a single
14 instance where it was the *wrong* thing to do.
15
16 Build, boostrap, acl, etc, they're relevant only when you've got
17 basically a from scratch system, or are rebuilding enough things you
18 need to revert to that level.
19
20 Meaning it's the right damn thing to do- same thing the user would
21 have to do.
22
23
24 > > And as I've already laid out in the bug, pkg_pretend has it's own set
25 > > of issues when compared to pkg_setup due to it being non temporal,
26 > > thus having high false positive potentials.
27 >
28 > These are exactly the same issues that pkg_setup has. You can't block a
29 > useful feature simply because developers could theoretically screw
30 > things up by using it.
31
32 Ciaran, seriously stop lieing. Your own words disprove this claim,
33 I quote from pms/ebuild-functions.tex:
34
35 """
36 The \t{pkg\_pretend} function may be used to carry out sanity
37 checks early on in the install process. For example, if an ebuild
38 requires a particular kernel configuration, it may perform that
39 check in \t{pkg\_pretend} and call \t{eerror} and then \t{die} with
40 appropriate messages if the requirement is not met.
41
42 \t{pkg\_pretend} is run separately from the main phase function
43 sequence, and does not participate in any kind of environment saving.
44 There is no guarantee that any of an ebuild's dependencies will
45 be met at this stage, and no guarantee that the system state will not
46 have changed substantially before the next phase is executed.
47 """
48
49 It's ironic that the only example PMS can give for this functionality
50 is als one that should not be implemented in pkg_pretend, but I
51 digress. Pure/simple, as I've explained repeatedly:
52
53 pkg_setup: ran just before the build of the pkg, after the pkg's
54 DEPENDS are all built. Meaning you *can* do has_version checks,
55 kernel config checks, etc, because the proceeding deps are now
56 satisfied.
57
58 pkg_pretend: ran before *every* *single* *build* has been ran, meaning
59 the has_version check, the kernel config check, etc, all can invalidly
60 die.
61
62 Had they been pkg_setup (check after DEPENDs are satisfied), the
63 majority of the checks would pass, but because they're ran prior to
64 DEPENDs satisfied, users will have to wind up breaking what was a
65 single emerge invocation into multiple to satisfy pkg_pretend being
66 wrong.
67
68
69 > > The main council push for pkg_pretend was to move use constraint
70 > > checking to pre build. VALID_USE does that cleaner and enabling use
71 > > cycle breaking to be built; as such I'm pushing it up to them unless
72 > > someone can find significant *real* flaws.
73 >
74 > No, VALID_USE addresses a *subset* of the issues. It's not a
75 > replacement for pkg_pretend.
76
77 Cherry picking the argument again. Main != whole, meaning the
78 majority reason I could see w/in council logs for supporting
79 pkg_pretend was USE constraint validation.
80
81 As I've said, and as you seem to finally understand, VALID_USE isn't a
82 replacement for pkg_pretend- it just replaces the *main* usage of it.
83
84
85 > > > When in the distant future Portage
86 > > > becomes able to deal with cycle breaking, ebuilds can be converted
87 > > > to use something like VALID_USE when they're also updated to export
88 > > > information on which of their flags can safely be toggled.
89 > >
90 > > You're being short sighted. VALID_USE is useful now for representing
91 > > use states that are allowed; that data itself is useful for use cycle
92 > > breaking. Added bonus of enabling better functionality via a
93 > > superior solutions, basically.
94 >
95 > Simply adding VALID_USE won't let you do cycle breaking. You also need
96 > extensive lists of which flags for which packages can safely be toggled
97 > and when without breaking the system, and the only way you'll get those
98 > lists is if developers care enough to update their ebuilds to provide
99 > them.
100
101 That's one view, but sure, I'll run with it.
102
103 The thing is, *without* VALID_USE you cannot do use cycle breaking
104 *period*. executable vs data for the representation of the
105 constraints (as I've spelled out for you 3 times now).
106
107 So your arguement against VALID_USE basically comes down to "it may
108 not be able to do USE cycle breaking"- fine, I disagree, but whatever.
109
110 pkg_pretend however completely disallows even *doing* use cycle
111 breaking. How in the hell is that a better next step?
112
113 ~harring

Replies

Subject Author
Re: [gentoo-dev] pkg_pretend USE validation and VALID_USE alternative Gilles Dartiguelongue <eva@g.o>
Re: [gentoo-dev] pkg_pretend USE validation and VALID_USE alternative Ciaran McCreesh <ciaran.mccreesh@××××××××××.com>