Gentoo Archives: gentoo-portage-dev

From: Brian Harring <ferringb@×××××.com>
To: gentoo-portage-dev@l.g.o
Subject: Re: [gentoo-portage-dev] Portage phase hooks patch
Date: Sun, 23 Jul 2006 05:41:59
Message-Id: 20060723053927.GA7985@seldon
In Reply to: Re: [gentoo-portage-dev] Portage phase hooks patch by Marius Mauch
1 On Sun, Jul 23, 2006 at 06:09:31AM +0200, Marius Mauch wrote:
2 > On Sat, 22 Jul 2006 16:52:38 -0700
3 > Zac Medico <zmedico@g.o> wrote:
4 >
5 > > -----BEGIN PGP SIGNED MESSAGE-----
6 > > Hash: SHA1
7 > >
8 > > Mike Kelly wrote:
9 > >
10 > > > In my case, I feel this functionality would be very useful as it
11 > > > allows for me to integrate my GLEP 27 implementation into portage
12 > > > without portage needing to worry about my implementation specifics,
13 > > > which may well change in later versions. I am sure there are other
14 > > > practical ways in which these hooks could be used.
15 > > >
16 > > > Patch at:
17 > > > http://soc.gentoo.org/viewcvs.py/*checkout*/glep0027/patches/portage-hooks.patch
18 > > >
19 > > > See bug# 141215.
20 > > >
21 > >
22 > > I like the idea. My main concern is that, like /etc/portage/bashrc,
23 > > this creates lots of potential for foreign code to interfere with the
24 > > internal workings of the ebuild environment. At a minimum, I think
25 > > there should be something in the `emerge --info` output that
26 > > indicates whether or not any phase hooks exist.
27 > >
28 > > Traditionally, configurable files that affect portage behavior go
29 > > mostly in /etc/portage. I see that your intention is to
30 > > make /var/libexec/portage/hooks/ a location for third-party packages
31 > > to install hooks, so it makes sense to keep those separate from hooks
32 > > that the user might install. I know that portage-utils currently
33 > > installs a post-sync hook in /etc/portage/postsync.d/q-reinitialize,
34 > > so there is some inconsistency there. We need to develop a
35 > > consistent policy for appropriate locations of files like these.
36
37 Lemme see if I follow this. The build execution *was*-
38 Start of 2.0.51:
39 pkg_setup
40 src_unpack
41 src_compile
42 src_test (feature controlled)
43 src_install
44 pkg_preinst
45 pkg_postinst
46
47 Start of 2.1:
48 pre_pkg_setup (user controlled)
49 pkg_setup
50 post_pkg_setup (user controlled)
51 pre_src_unpack (user controlled)
52 src_unpack
53 post_src_unpack (user controlled)
54 pre_src_compile (user controlled)
55 src_compile
56 post_src_compile (user controlled)
57 pre_src_test (user and feature controlled)
58 src_test (feature controlled)
59 post_src_test (user and feature controlled)
60 pre_src_install (user controlled)
61 src_install
62 post_src_install (user controlled)
63 pre_pkg_preinst (user controlled)
64 pkg_preinst
65 post_pkg_preinst (user controlled)
66 pre_pkg_postinst (user controlled)
67 pkg_postinst
68 post_pkg_postinst (user controlled)
69
70
71 And what is being suggested is:
72 pre_pkg_setup (system controlled)
73 pre_pkg_setup (user controlled)
74 pkg_setup
75 post_pkg_setup (user controlled)
76 post_pkg_setup (system controlled)
77 pre_src_unpack (system controlled)
78 pre_src_unpack (user controlled)
79 src_unpack
80 post_src_unpack (user controlled)
81 post_src_unpack (system controlled)
82 pre_src_compile (system controlled)
83 pre_src_compile (user controlled)
84 src_compile
85 post_src_compile (user controlled)
86 post_src_compile (system controlled)
87 pre_src_test (system and feature controlled)
88 pre_src_test (user and feature controlled)
89 src_test (feature controlled)
90 post_src_test (user and feature controlled)
91 post_src_test (system and feature controlled)
92 pre_src_install (system controlled)
93 pre_src_install (user controlled)
94 src_install
95 post_src_install (user controlled)
96 post_src_install (system controlled)
97 pre_pkg_preinst (system controlled)
98 pre_pkg_preinst (user controlled)
99 pkg_preinst
100 post_pkg_preinst (user controlled)
101 post_pkg_preinst (system controlled)
102 pre_pkg_postinst (system controlled)
103 pre_pkg_postinst (user controlled)
104 pkg_postinst
105 post_pkg_postinst (user controlled)
106 post_pkg_postinst (system controlled)
107
108
109 May I ask what the next revision shall be? Because I'd expect the
110 next request to be a post user hook, hook; that way any the author can
111 ensure that the they're changes are last (till users bitch, and
112 request their own hook that is last in the stacking).
113
114 Sarcasm aside, hopefully y'all see the point that hooks have their own
115 issues, and one cannot just slap more hooks in without considering the
116 resultant mess (bluntly).
117
118
119 > I still think that those hooks should go into the tree rather than
120 > being installed by packages.
121
122 They're called eclasses ;)
123
124 If after transferring that level of control to the tree, then my
125 original suggestion (from way the hell back) of moving the actual
126 ebuild template into the tree should be taken; fundamentally, no
127 different; eapi actually sets it up better.
128
129
130 > That's mainly so they get increased
131 > visibility and gives us (us being Gentoo, not just Portage) more
132 > access and control over them, like we have with eclasses.
133
134 Eclasses exist already... base ebuild template is effectively an
135 eclass also, shove that into the tree and modify it rather then
136 further phase expansion (although I poke a hole in that below).
137
138
139 > This also moves responsibility from hook authors to pkgmanager authors
140 > (the package mamanger has to support the hook format in the tree, not
141 > the hook has to support (all of) the specific package manager hook
142 > formats). I know Mike has taken care of Paludis support already, but
143 > look at a larger scale:
144 > a) n hook authors supporting m package manager interfaces: O(n*m)
145 > b) n hook authors and m package managers supoprting one repository
146 > interface: O(n+m)
147 > Also with a) you have to play what I call the "catch up game", e.g. a
148 > new package manager gets out and all hooks have to account for a new
149 > interface (even if it's just a new path).
150 > Of course a) has the "drawback" that it requires a solid spec of the
151 > interface, but that's something we want anyway.
152
153 It also has the drawback that via transferring control over to the
154 tree, the pkg manager cannot do proper cleanup.
155
156 What you say?
157
158 What happens if $PKGMANGER adds user blah for building xyz, xyz fails?
159 Proper course of action would be to punt this unused user if it's
160 refcount is just xyz, no?
161
162 Transfer control of fundamental features like that to delegation
163 hooks, you either have to add more hooks so the delegation target can
164 cleanup after itself, or you plain don't do cleanup.
165
166 So... pretty much I'm saying that at least my usage of dynusers, I
167 won't be supporting the hook route- reasons were given above. Funny
168 thing is that pkgcores support would be _better_, but wouldn't be
169 considered 'compliant' because of the intended decrees above.
170
171 What other hooks are actually required?
172
173 And finally, I'd suggest this get ran past devs in general- expanding
174 the phase hooks for ebuilds (this is just that) isn't something that
175 should be done lightly; the original pre/post were done as a
176 concession to users for an upcoming (at the time) breakage of their
177 existing functionality, not as an actual phase expansion for ebuilds
178 to use (yes java eclass uses it, but their usage of it would die at
179 the exact moment the env issues were fixed).
180
181 ~harring

Replies

Subject Author
[gentoo-portage-dev] Re: Portage phase hooks patch Mike Kelly <pioto@×××××.org>