Gentoo Archives: gentoo-dev

From: Zac Medico <zmedico@g.o>
To: gentoo-dev@l.g.o
Subject: Re: [gentoo-dev] Re: have portage be quiet by default
Date: Tue, 15 Nov 2011 20:11:59
Message-Id: 4EC2C76B.4070302@gentoo.org
In Reply to: [gentoo-dev] Re: have portage be quiet by default by Duncan <1i5t5.duncan@cox.net>
1 On 11/14/2011 03:17 PM, Duncan wrote:
2 > Zac Medico posted on Mon, 14 Nov 2011 07:22:19 -0800 as excerpted:
3 >
4 >> On 11/14/2011 12:47 AM, Dirkjan Ochtman wrote:
5 >>> On Mon, Nov 14, 2011 at 02:59, Zac Medico <zmedico@g.o> wrote:
6 >>>> Well, it's much easier to gather interest and get feedback if we
7 >>>> deploy the change and ask questions later.
8 >>>
9 >>> I like the new output, but find it kind of annoying that there's very
10 >>> little feedback on how far the progress is within a single job. Perhaps
11 >>> we could show the currently executing ebuild phase in order to give a
12 >>> little more feedback? Maybe most packages are completely dominated by
13 >>> src_compile(), but for smaller packages it would be helpful, IMO.
14 >>
15 >> I think that would be an interesting option. I imagine that it would be
16 >> too much information for many people, so I don't think that we'd want to
17 >> enable it by default.
18 >
19 > Thanks for thinking "out of the box". =:^)
20 >
21 > This is one thing that I've found frustrating with parallel emerging,
22 > myself.
23 >
24 > The first thing I discovered were that some phases (at least the merge
25 > phase, and I believe install) aren't counted, so the numbers don't
26 > entirely add up (complete + running + not-started + failed <> total).
27 > Thus, some packages appear to be simply sitting there doing nothing.
28
29 This behavior is discussed in the "When packages are built in parallel
30 with the --jobs option, why aren't some packages installed immediately
31 after they have finished building? They are installed only after a long
32 delay." section of the FAQ [1].
33
34 > When a whole bunch of packages are in that state, it appears emerge is
35 > doing nothing but consuming cycles and real-time, for no visible reason
36 > at all.
37
38 I haven't noticed anything like that. You can send a SIGUSR1 signal to
39 the emerge process and that will cause it drop to a pdb shell so you can
40 poke around and see what's happening.
41
42 > Since for a number of packages (I seem to notice it most on kde packages,
43 > but perhaps it's all C++ or most CMAKE or some such, plus of course
44 > primarily data packages that don't have a significant build phase but
45 > install many or large files) the install phase can be as intense as the
46 > build phase if not more so, so if some phases aren't counted in
47 > "running", then I'd definitely prefer they be counted /somewhere/.
48
49 The src_install phase is counted along with all of the earlier phases.
50
51 > Of course, listing the number of packages in each phase (which in single-
52 > mode would by definition list the phase the single package is in) would
53 > cure the above issue at the same time.
54 >
55 > Another problem, but one I'm not sure how to fix (tho the interactive
56 > display would offer opportunities here), is that it'd be nice to get a
57 > list of completed packages, in-process packages, and still not started
58 > packages. That doesn't so easily fit in a neat summary, but as noted,
59 > the interactive proposal introduces quite some opportunity, here.
60 >
61 > Alternatively, since often the real info desired is the status of a
62 > particular package, it'd be useful to have either an interactive command
63 > or a simple separate querying command, that can be run to query the
64 > status of a particular package.
65 >
66 > *** Which brings up an alternative to the whole interactive emerges idea
67 > as well -- what about a separate command, say "emerging", that when run,
68 > would simply output a bunch of detail on any pending emerges?
69 >
70 > This would certainly offer a safer initial implementation, as well, since
71 > it's less likely to break the current setup due to bugs, etc. Another
72 > noted benefit is that it leaves the existing defaults alone, so it's not
73 > going to be threatening anyone's sacred cows (or scripted assumptions) in
74 > terms of how portage has always behaved. =:^)
75 >
76 >
77 > So, perhaps improve the current "quiet" display marginally, either
78 > including all phases in "running" or adding another listing so the
79 > numbers add up, but more importantly...
80 >
81 > *** Add a new "emerging" (name up for bikeshedding) command, that
82 > displays a nice multiline summary, perhaps something like this (the
83 > second emerge command was for a failure in the first, with a second
84 > attempt made before completion of the main emerge @world has completed):
85 >
86 > Current emerge status:
87 >
88 > 2 emerge command(s) running.
89 > 7 emerge jobs outstanding.
90 >
91 > Commands:
92 >
93 > ** emerge --upgrade --deep --newuse --keep-going @world
94 >
95 > Status:
96 >
97 > 123 of 257 jobs complete, 1 failed, 6 running, 120 not yet started,
98 > 7 dependencies removed due to failures.
99 >
100 > Running (6):
101 >
102 > 1 pkgsetup (cat-egory/package-ver)
103 >
104 > 1 configure (cat-egory/package-ver, cat-egory/package-ver)
105 >
106 > 2 build (cat-egory/package-ver, cat-egory/package-ver)
107 >
108 > 1 install (cat-egory/package-ver)
109 >
110 > 1 merge (cat-egory/package-ver)
111 >
112 > Failed (1):
113 >
114 > dev-libs/boost-1.47.0-r1
115 >
116 > Complete (123):
117 >
118 > <list in nice columns>
119 > ...
120 >
121 > Not started (120):
122 >
123 > <list in nice columns>
124 > ...
125 >
126 > Removed dependencies due to failure (7):
127 >
128 > <list in nice columns>
129 > ...
130 >
131 >
132 > ** emerge -u1 boost
133 >
134 > Status:
135 >
136 > 0 of 1 jobs complete, 1 running.
137 >
138 > Running (1):
139 >
140 > 1 build (dev-libs/boost-1.47.0-r1)
141 > Obviously the first implementation might not have all the information
142 > above, and there might have been some nice information I missed and other
143 > information that could be displayed better, but it's a very cool idea
144 > even if I /do/ say so myself. =:^)
145 >
146 > Note that zeroed-out listings aren't displayed, so the the --oneshot
147 > doesn't list failed, not yet started, etc, and inactive phases are also
148 > not displayed.
149 >
150 > Also note how easy this sort of detailed display would make it to retry
151 > failed jobs and the resulting removed dependencies, once the failure has
152 > been resolved.
153 >
154 > "emerging" could have a "repeat" mode as well as one-shot, with a polling-
155 > delay parameter set to something sane like 30 or 60 seconds by default.
156 > That way, I wouldn't have to feed it to "watch" =:^)
157
158 I'm not sure how many people would use an interface like that in
159 practice, but I wouldn't be opposed to adding support for something like
160 that. Since I'm not really interested in using an interface like that
161 myself, so I don't feel inspired to implement it myself.
162
163 > Because this is a separate command, worries about TMI/TLI should be
164 > eliminated. Additionally, it should go some way toward easing the whole
165 > quiet/noisy debate as well, since there's now another command available
166 > with an intermediate level of information.
167 >
168 > Something like this:
169 >
170 > edisplaylog
171 > If we then throw in one more tool, I'll call it edisplaylog for lack of a
172 > better name, that reads make.conf to find the elog dir, and can
173 > automatically pick out the latest log for a package, thus eliminating the
174 > trouble of doing it manually, that should help eliminate another
175 > objection to quiet-by-default. So...
176 >
177 > edisplaylog boost
178 >
179 > ... would find the last elog for boost and display it.
180 >
181 > To make things easy for the user, simply ...
182 >
183 > edisplaylog
184 >
185 > ... could be made to filetime search and display the last active log in
186 > tail -f mode. If after say a couple seconds of no activity, it re-polled
187 > the log dir and switched to displaying a different log (have it list the
188 > log it's displaying at the top) if it was newer, that could pretty much
189 > replace "noisy" mode entirely. =:^)
190 >
191 > Obviously running simply "edisplaylog" by itself during a parallel-jobs
192 > emerge would be nearly as confusing as portage not automatically going
193 > into quiet mode for parallel emerging would be, tho not quite since it
194 > would display the logfile name at the top, but "edisplaylog <pkg>" would
195 > still be very useful, ESPECIALLY for those using --keep-going, so they
196 > could track down and fix whatever failed a build before the parallel
197 > emerge spit out the results at the end.
198 >
199 > Talking about which... an "edisplaylog failed" mode, which would
200 > automatically find the last failure and displayed the log for it, could
201 > be very helpful as well. =:^)
202
203 That sounds pretty handy.
204
205 > Obviously all these ideas entail a lot of coding, and I realize it's easy
206 > to sit here and make requests without doing the coding, but implementing
207 > them as separate commands first and incremental implementation should
208 > help a lot, and I hadn't seen anything like this proposed yet, so...
209 >
210 > I'll close with a thanks to Zac and everyone else who has already made
211 > portage the great tool it is today, because without them, we'd obviously
212 > not be having this discussion in the first place. =:^)
213 >
214
215 [1] http://www.gentoo.org/proj/en/portage/doc/faq.xml#doc_chap1_sect9
216 --
217 Thanks,
218 Zac

Replies

Subject Author
[gentoo-dev] Re: have portage be quiet by default Duncan <1i5t5.duncan@×××.net>