Gentoo Archives: gentoo-portage-dev

From: Mike Kelly <pioto@×××××.org>
To: gentoo-portage-dev@l.g.o
Subject: [gentoo-portage-dev] Re: Portage phase hooks patch
Date: Mon, 24 Jul 2006 17:53:25
Message-Id: 20060724135223.7c7d2974@mk65-desktop.pioto.org
In Reply to: Re: [gentoo-portage-dev] Portage phase hooks patch by Brian Harring
1 On Sat, 22 Jul 2006 22:39:28 -0700
2 Brian Harring <ferringb@×××××.com> wrote:
3
4 > On Sun, Jul 23, 2006 at 06:09:31AM +0200, Marius Mauch wrote:
5 > > On Sat, 22 Jul 2006 16:52:38 -0700
6 > > Zac Medico <zmedico@g.o> wrote:
7 > >
8 > > > -----BEGIN PGP SIGNED MESSAGE-----
9 > > > Hash: SHA1
10 > > >
11 > > > I like the idea. My main concern is that,
12 > > > like /etc/portage/bashrc, this creates lots of potential for
13 > > > foreign code to interfere with the internal workings of the
14 > > > ebuild environment. At a minimum, I think there should be
15 > > > something in the `emerge --info` output that indicates whether or
16 > > > not any phase hooks exist.
17
18 True, adding hooks does have the potential for messing up some of the
19 internals of the ebuild. But, that is really a necessary part of their
20 operation; their whole point is that they can provide some indirect
21 access to that information to an external application.
22
23 > > > Traditionally, configurable files that affect portage behavior go
24 > > > mostly in /etc/portage. I see that your intention is to
25 > > > make /var/libexec/portage/hooks/ a location for third-party
26 > > > packages to install hooks, so it makes sense to keep those
27 > > > separate from hooks that the user might install. I know that
28 > > > portage-utils currently installs a post-sync hook
29 > > > in /etc/portage/postsync.d/q-reinitialize, so there is some
30 > > > inconsistency there. We need to develop a consistent policy for
31 > > > appropriate locations of files like these.
32 >
33 > Lemme see if I follow this. The build execution *was*-
34 > Start of 2.0.51:
35 > pkg_setup
36 > src_unpack
37 >...
38 > May I ask what the next revision shall be? Because I'd expect the
39 > next request to be a post user hook, hook; that way any the author
40 > can ensure that the they're changes are last (till users bitch, and
41 > request their own hook that is last in the stacking).
42 >
43 > Sarcasm aside, hopefully y'all see the point that hooks have their
44 > own issues, and one cannot just slap more hooks in without
45 > considering the resultant mess (bluntly).
46
47 Yes, I would like there to be some unified location for all these
48 hooks. At the moment, my hooks patch would only affect ebuild phases,
49 so it would have nothing to do with that post_sync hook, but I wouldn't
50 be adverse to extending the idea to other parts of portage.
51
52 > > I still think that those hooks should go into the tree rather than
53 > > being installed by packages.
54 >
55 > They're called eclasses ;)
56
57 The problem with having these in the tree is that they should be able
58 to take advantage of the unique features of each package manager.
59 Otherwise, they really are just eclasses.
60
61 > It also has the drawback that via transferring control over to the
62 > tree, the pkg manager cannot do proper cleanup.
63 >
64 > What you say?
65 >
66 > What happens if $PKGMANGER adds user blah for building xyz, xyz
67 > fails? Proper course of action would be to punt this unused user if
68 > it's refcount is just xyz, no?
69 >
70 > Transfer control of fundamental features like that to delegation
71 > hooks, you either have to add more hooks so the delegation target can
72 > cleanup after itself, or you plain don't do cleanup.
73
74 Agreed, I would like to have better ability to clean up after myself.
75 However, this cleanup would be entirely dependent upon the current
76 implementation of my scripts, which could change at a different time
77 than a portage release - making my development stall because I won't be
78 able to make changes to one of the package managers I support.
79
80 Perhaps a simple ${EBUILD_PHASE}_fail hook could be added. For example,
81 change the pkg_${myarg} line to pkg_${myarg} || run_hooks ${myarg}
82 fail, where run_hooks is some theoretical function to run all the
83 proper hooks.
84
85 Although, once fully developed, the eselect utility for my particular
86 package should be able to check for these inconsistencies and repair
87 them afterwards.
88
89 > And finally, I'd suggest this get ran past devs in general- expanding
90 > the phase hooks for ebuilds (this is just that) isn't something that
91 > should be done lightly; the original pre/post were done as a
92 > concession to users for an upcoming (at the time) breakage of their
93 > existing functionality, not as an actual phase expansion for ebuilds
94 > to use (yes java eclass uses it, but their usage of it would die at
95 > the exact moment the env issues were fixed).
96
97 Agreed. I'll be making a post to gentoo-dev shortly.
98
99 --
100 Mike Kelly
101 --
102 gentoo-portage-dev@g.o mailing list

Replies

Subject Author
Re: [gentoo-portage-dev] Re: Portage phase hooks patch Marius Mauch <genone@g.o>