Gentoo Archives: gentoo-dev

From: "Steven J. Long" <slong@××××××××××××××××××.uk>
To: gentoo-dev@l.g.o
Subject: [gentoo-dev] Re: Eclass vs EAPI For Utility Functions (Patching/etc)
Date: Thu, 19 Jun 2014 21:42:16
Message-Id: 20140619220540.GD4582@rathaus.eclipse.co.uk
In Reply to: Re: [gentoo-dev] Eclass vs EAPI For Utility Functions (Patching/etc) by "Michał Górny"
1 On Sun, Jun 15, 2014 at 03:30:10PM +0200, Michał Górny wrote:
2 > Dnia 2014-06-15, o godz. 07:00:15
3 > Rich Freeman napisał(a):
4 >
5 > > The Eclass argument goes like this:
6 > > Eclasses already work in every PM. Half of what we're debating is
7 > > already in eutils. Why move this code into the PM, where it has to be
8 > > re-implemented everywhere? If anything we should be moving more PM
9 > > functionality out and into eclasses where we can have competing
10 > > implementations and more flexibility.
11 >
12 > I think this point is a bit tangential. While eclasses are the obvious
13 > way of having code common between package managers, I don't think
14 > sharing code should be an argument for putting something in an eclass.
15
16 Er, it's the most fundamental argument for using an eclass.
17
18 Thought not between package managers, since they don't factor into the
19 equation, so long as they provide EAPI conformance (theoretically.)
20
21 > Please remember that you can create your own base repository without
22 > having 'gentoo' as master. Then, putting code in eclasses actually
23 > requires you to duplicate it -- unlike code in PM which is shared
24 > between all repos.
25
26 Well that's an argument for certain base functionality being in the PM
27 although I'd note that "in the PM" in most cases, and this one, means
28 "in ebuild.sh or one of its associated BASH modules."
29
30 It's not an argument for sharing script across ebuilds in general, by
31 putting it in the the context for every ebuild.
32
33 As for different master repos, that's an appropriate discussion at
34 at the package-manager code level, but not at the distro level, imo.
35
36 > Now, for the overall point. I think there are a few cases when you want
37 > something in the PM:
38 >
39 > 1. when it's a common thing to do that doesn't require repository-
40 > specific details like relying on some out-of-@system packages,
41 >
42 > 2. when it requires specific interaction with the package manager,
43 >
44 > 3. when it is required by some other PM-specific code.
45
46 That's enforced by the requirement.
47
48 > Keeping it
49 > 'internal' just means having duplicate code between PM and eclasses.
50
51 No: it also means you don't expose it until it's needed. The worst
52 thing in the world is having to rely on variant behaviour according
53 to the phase of the moon, which is about what you get when internal
54 APIs are exposed without cause and consensus.
55
56 Since you're speaking in general terms.
57
58 > I think the only debatable thing here is (1). If we ever decide that
59 > having common stuff in an eclass is feasible, we ought to move all
60 > the common stuff that's possible -- including econf, emake, possibly
61 > some install helpers.
62
63 I'm not sure what that's got to with out-of-@system packages, but it
64 sounds like a bad idea, and counter to your argument about sharing
65 code via the PM, and not eclasses.
66
67 > This may even have more benefits than that. For example, you would fit
68 > the implementation to specific system -- like 'gentoo' repository
69 > eclass would be fit for Gentoo-specific tools. Instead of putting
70 > requirements for a system in PMS and trying to fit PM and profiles
71 > together, we'd just use whatever the repository provides.
72
73 That sounds insane to me. What happened to reproducible builds? Let
74 alone a robust user experience.
75
76 Perhaps at the package-manager code level, but not at the distro level.
77 And it's the Gentoo PMS, so I don't see any conflict.
78
79 Though this appears to be the same "tangent" Rich brought up.
80
81 > Of course this brings another argument -- every single ebuild would
82 > have to source a specific eclass. For EAPI 6, I've focused on going
83 > the opposite way
84
85 So which way do you actually prefer?
86
87 You appear to be arguing for, and implementing, common code by EAPI,
88 in the rest of your mail. Since that's always been the point of
89 them, based on developer consensus about what is truly essential,
90 and what is only needed for a subset of the tree, that's fine by me.
91
92 Just so long as they are essential, and you do have consensus on
93 that.
94
95 > As far as both eapply & eapply_user are concerned
96
97 Why can't we just have epatch and upatch?
98
99
100 =
101 I'm on record as wanting this in the PM, btw, back when we were
102 discussing how it should deal with patches not being applied.
103
104 --
105 #friendly-coders -- We're friendly, but we're not /that/ friendly ;-)

Replies