Gentoo Archives: gentoo-portage-dev

From: "Michał Górny" <mgorny@g.o>
To: gentoo-portage-dev@l.g.o
Subject: Re: [gentoo-portage-dev] [PATCH] Support disabling docompress for binary package builds
Date: Sun, 04 Nov 2018 08:20:49
Message-Id: 1541319637.17323.1.camel@gentoo.org
In Reply to: Re: [gentoo-portage-dev] [PATCH] Support disabling docompress for binary package builds by Zac Medico
1 On Sat, 2018-11-03 at 15:44 -0700, Zac Medico wrote:
2 > On 11/03/2018 01:10 AM, Michał Górny wrote:
3 > > On Fri, 2018-11-02 at 19:35 -0700, Zac Medico wrote:
4 > > > On 11/02/2018 12:35 PM, Michał Górny wrote:
5 > > > > On Fri, 2018-11-02 at 12:22 -0700, Zac Medico wrote:
6 > > > > > On 11/02/2018 12:16 PM, Michał Górny wrote:
7 > > > > > > On Fri, 2018-11-02 at 11:49 -0700, Zac Medico wrote:
8 > > > > > > > On 11/01/2018 02:50 AM, Michał Górny wrote:
9 > > > > > > > > diff --git a/lib/portage/package/ebuild/doebuild.py b/lib/portage/package/ebuild/doebuild.py
10 > > > > > > > > index 9706de422..d7b535698 100644
11 > > > > > > > > --- a/lib/portage/package/ebuild/doebuild.py
12 > > > > > > > > +++ b/lib/portage/package/ebuild/doebuild.py
13 > > > > > > > > @@ -674,7 +674,7 @@ def doebuild(myebuild, mydo, _unused=DeprecationWarning, settings=None, debug=0,
14 > > > > > > > > "config", "info", "setup", "depend", "pretend",
15 > > > > > > > > "fetch", "fetchall", "digest",
16 > > > > > > > > "unpack", "prepare", "configure", "compile", "test",
17 > > > > > > > > - "install", "rpm", "qmerge", "merge",
18 > > > > > > > > + "install", "instprep", "rpm", "qmerge", "merge",
19 > > > > > > > > "package", "unmerge", "manifest", "nofetch"]
20 > > > > > > > >
21 > > > > > > > > if mydo not in validcommands:
22 > > > > > > > > @@ -1402,6 +1402,7 @@ def _spawn_actionmap(settings):
23 > > > > > > > > "compile": {"cmd":ebuild_sh, "args":{"droppriv":droppriv, "free":nosandbox, "sesandbox":sesandbox, "fakeroot":0}},
24 > > > > > > > > "test": {"cmd":ebuild_sh, "args":{"droppriv":droppriv, "free":nosandbox, "sesandbox":sesandbox, "fakeroot":0}},
25 > > > > > > > > "install": {"cmd":ebuild_sh, "args":{"droppriv":0, "free":0, "sesandbox":sesandbox, "fakeroot":fakeroot}},
26 > > > > > > > > +"instprep": {"cmd":misc_sh, "args":{"droppriv":0, "free":0, "sesandbox":sesandbox, "fakeroot":fakeroot}},
27 > > > > > > > > "rpm": {"cmd":misc_sh, "args":{"droppriv":0, "free":0, "sesandbox":0, "fakeroot":fakeroot}},
28 > > > > > > > > "package": {"cmd":misc_sh, "args":{"droppriv":0, "free":0, "sesandbox":0, "fakeroot":fakeroot}},
29 > > > > > > > > }
30 > > > > > > >
31 > > > > > > > The feature seems find but the instprep phase is not needed if we use
32 > > > > > > > MiscFunctionsProcess instead of EbuildPhase. Here's a list of odd things
33 > > > > > > > about the instprep ebuild phase implementation as it is:
34 > > > > > > >
35 > > > > > > > 1) You can call instprep explicitly via the ebuild(1) command, but I
36 > > > > > > > doubt that we really want or need to allow that.
37 > > > > > >
38 > > > > > > I was actually wondering about that. I suppose it might be useful for
39 > > > > > > debugging purposes.
40 > >
41 > > Ok, I've rechecked it and ebuild(1) currently rejects it as not a valid
42 > > phase name.
43 >
44 > I have your patches applied, and for me it treats 'instprep' as a valid
45 > phase which I'm able to call. It also lists it in the list of available
46 > phases if I choose an invalid phase named 'foo', since 'instprep' is
47 > listed in validcommands:
48 >
49 > !!! doebuild: 'foo' is not one of the following valid commands:
50 > !!! clean cleanrm compile config configure depend
51 > !!! digest fetch fetchall help info install
52 > !!! instprep manifest merge nofetch package postinst
53 > !!! postrm preinst prepare prerm pretend qmerge
54 > !!! rpm setup test unmerge unpack
55 >
56 > > So we can either ignore the problem until somebody finds it
57 > > useful to call it directly, or work on it. Would the existing patch be
58 > > ok, provided that ebuild(1) doesn't allow calling prepinst manually?
59 >
60 > Lets clarify our intention here, since apparently it works for me but
61 > not for you when you tested. I think it's fine as-is, but let's make
62 > sure that the behavior is what we collectively intend.
63
64 My mistake. I typed 'prepinst' instead of 'instprep' ;-).
65
66 >
67 > > > Sure. In fact, we could split out separate instcompress and inststrip
68 > > > phases. I suppose we could split instprep into multiple phases in the
69 > > > future, if we find a use for it.
70 > > >
71 > > > > > > However, since I wasn't able to figure out how to
72 > > > > > > fully integrate it with the phase machinery, I went for the minimal set
73 > > > > > > of code that wouldn't be definitive either way.
74 > > > > > >
75 > > > > > > > 2) Unlinke other ebuild phases, the doebuild function doesn't created a
76 > > > > > > > .instpreped file to indicate when the instprep phase has executed.
77 > > > > > >
78 > > > > > > I suppose I can try to do that if that's desirable.
79 > > >
80 > > > Note that a .instpreped file could be useful as a means to prevent
81 > > > people from triggering a QA notice about pre-compressed or pre-stripped
82 > > > files if they happen to pass an instprep argument to the ebuild(1)
83 > > > command more than once. Maybe this case is unlikely enough that we can
84 > > > safely neglect it?
85 > >
86 > > That should be easy enough to implement. What was definitely harder for
87 > > me to comprehend, are phase dependencies. I wasn't sure whether adding
88 > > them to actionmap wouldn't make it possible for 'preinst' to be called
89 > > automatically before 'package'.
90 >
91 > The actionmap_deps map is just the edges of a directed dependency graph,
92 > and it currently only covers up to the 'install' phase. The 'package'
93 > phase currently depends on 'install', which should remain as-is, right?
94 >
95 > This change will cause dependencies of 'instprep' to be invoked
96 > automatically:
97 >
98 > --- a/lib/portage/package/ebuild/doebuild.py
99 > +++ b/lib/portage/package/ebuild/doebuild.py
100 > @@ -656,6 +656,7 @@ def doebuild(myebuild, mydo,
101 > _unused=DeprecationWarning, settings=None, debug=0,
102 > "compile":["configure"],
103 > "test": ["compile"],
104 > "install":["test"],
105 > + "instprep":["install"],
106 > "rpm": ["install"],
107 > "package":["install"],
108 > "merge" :["install"],
109 >
110 > There's no need to make 'merge' depend on 'instprep', since treewalk
111 > implicitly invokes 'instprep' when 'merge' is called. Adding a
112 > dependency on 'instprep' would cause it to be invoked *twice* (once by
113 > spawnebuild and again by treewalk).
114
115 Ok, that makes sense. I'll update the patch with this and ebuild.1
116 as requested in followup mail.
117
118 --
119 Best regards,
120 Michał Górny

Attachments

File name MIME type
signature.asc application/pgp-signature