summaryrefslogtreecommitdiffstats
path: root/bitbake/lib/bb/ui/toasterui.py
diff options
context:
space:
mode:
authorElliot Smith <elliot.smith@intel.com>2016-07-11 14:47:06 +0100
committerRichard Purdie <richard.purdie@linuxfoundation.org>2016-08-11 00:09:26 +0100
commitdd99cf957da5836dc9b48d200f15a66f0bbce245 (patch)
treee7b8b8fa6b88520aabd6f17bc41cc8410af66761 /bitbake/lib/bb/ui/toasterui.py
parent952ffb3e1f4a00793e0c9c49bc0c8fb8729424c4 (diff)
downloadpoky-dd99cf957da5836dc9b48d200f15a66f0bbce245.tar.gz
bitbake: toaster: show progress of recipe parsing in recent builds area
Modify buildinfohelper and toasterui so that they record the recipe parse progress (from ParseProgress events in bitbake) on the Build object. Note that because the Build object is now created at the point when ParseStarted occurs, it is necessary to set the build name to the empty string initially (hence the migration). The build name can be set when the build properly starts, i.e. at the BuildStarted event. Then use this additional data to determine whether a Build is in a "Parsing" state, and report this in the JSON API. This enables the most recent builds area to show the recipe parse progress. Add additional logic to update the progress bar if the progress for a build object changes. [YOCTO #9631] (Bitbake rev: f33d51d46d70e73e04e325807c1bc4eb68462f7b) Signed-off-by: Elliot Smith <elliot.smith@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake/lib/bb/ui/toasterui.py')
-rw-r--r--bitbake/lib/bb/ui/toasterui.py31
1 files changed, 20 insertions, 11 deletions
diff --git a/bitbake/lib/bb/ui/toasterui.py b/bitbake/lib/bb/ui/toasterui.py
index f399a7d316..7d670bef6f 100644
--- a/bitbake/lib/bb/ui/toasterui.py
+++ b/bitbake/lib/bb/ui/toasterui.py
@@ -102,6 +102,7 @@ _evt_list = [
102 "bb.command.CommandExit", 102 "bb.command.CommandExit",
103 "bb.command.CommandFailed", 103 "bb.command.CommandFailed",
104 "bb.cooker.CookerExit", 104 "bb.cooker.CookerExit",
105 "bb.event.BuildInit",
105 "bb.event.BuildCompleted", 106 "bb.event.BuildCompleted",
106 "bb.event.BuildStarted", 107 "bb.event.BuildStarted",
107 "bb.event.CacheLoadCompleted", 108 "bb.event.CacheLoadCompleted",
@@ -115,6 +116,7 @@ _evt_list = [
115 "bb.event.NoProvider", 116 "bb.event.NoProvider",
116 "bb.event.ParseCompleted", 117 "bb.event.ParseCompleted",
117 "bb.event.ParseProgress", 118 "bb.event.ParseProgress",
119 "bb.event.ParseStarted",
118 "bb.event.RecipeParsed", 120 "bb.event.RecipeParsed",
119 "bb.event.SanityCheck", 121 "bb.event.SanityCheck",
120 "bb.event.SanityCheckPassed", 122 "bb.event.SanityCheckPassed",
@@ -231,19 +233,30 @@ def main(server, eventHandler, params):
231 # pylint: disable=protected-access 233 # pylint: disable=protected-access
232 # the code will look into the protected variables of the event; no easy way around this 234 # the code will look into the protected variables of the event; no easy way around this
233 235
234 # we treat ParseStarted as the first event of toaster-triggered
235 # builds; that way we get the Build Configuration included in the log
236 # and any errors that occur before BuildStarted is fired
237 if isinstance(event, bb.event.ParseStarted): 236 if isinstance(event, bb.event.ParseStarted):
238 if not (build_log and build_log_file_path): 237 if not (build_log and build_log_file_path):
239 build_log, build_log_file_path = _open_build_log(log_dir) 238 build_log, build_log_file_path = _open_build_log(log_dir)
239
240 buildinfohelper.store_started_build(build_log_file_path)
241 buildinfohelper.set_recipes_to_parse(event.total)
240 continue 242 continue
241 243
242 if isinstance(event, bb.event.BuildStarted): 244 # create a build object in buildinfohelper from either BuildInit
243 if not (build_log and build_log_file_path): 245 # (if available) or BuildStarted (for jethro and previous versions)
244 build_log, build_log_file_path = _open_build_log(log_dir) 246 if isinstance(event, (bb.event.BuildStarted, bb.event.BuildInit)):
247 buildinfohelper.save_build_name_and_targets(event)
245 248
246 buildinfohelper.store_started_build(event, build_log_file_path) 249 # get additional data from BuildStarted
250 if isinstance(event, bb.event.BuildStarted):
251 buildinfohelper.save_build_layers_and_variables()
252 continue
253
254 if isinstance(event, bb.event.ParseProgress):
255 buildinfohelper.set_recipes_parsed(event.current)
256 continue
257
258 if isinstance(event, bb.event.ParseCompleted):
259 buildinfohelper.set_recipes_parsed(event.total)
247 continue 260 continue
248 261
249 if isinstance(event, (bb.build.TaskStarted, bb.build.TaskSucceeded, bb.build.TaskFailedSilent)): 262 if isinstance(event, (bb.build.TaskStarted, bb.build.TaskSucceeded, bb.build.TaskFailedSilent)):
@@ -289,10 +302,6 @@ def main(server, eventHandler, params):
289 # timing and error informations from the parsing phase in Toaster 302 # timing and error informations from the parsing phase in Toaster
290 if isinstance(event, (bb.event.SanityCheckPassed, bb.event.SanityCheck)): 303 if isinstance(event, (bb.event.SanityCheckPassed, bb.event.SanityCheck)):
291 continue 304 continue
292 if isinstance(event, bb.event.ParseProgress):
293 continue
294 if isinstance(event, bb.event.ParseCompleted):
295 continue
296 if isinstance(event, bb.event.CacheLoadStarted): 305 if isinstance(event, bb.event.CacheLoadStarted):
297 continue 306 continue
298 if isinstance(event, bb.event.CacheLoadProgress): 307 if isinstance(event, bb.event.CacheLoadProgress):