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