aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--bitbake/lib/bb/ui/buildinfohelper.py17
-rw-r--r--bitbake/lib/bb/ui/toasterui.py19
2 files changed, 18 insertions, 18 deletions
diff --git a/bitbake/lib/bb/ui/buildinfohelper.py b/bitbake/lib/bb/ui/buildinfohelper.py
index d59d6a5f896..37e15551f97 100644
--- a/bitbake/lib/bb/ui/buildinfohelper.py
+++ b/bitbake/lib/bb/ui/buildinfohelper.py
@@ -1015,7 +1015,17 @@ class BuildInfoHelper(object):
self.internal_state['build'] = build_obj
+ # create target information
+ target_information = {}
+ target_information['targets'] = event._pkgs
+ target_information['build'] = build_obj
+
+ self.internal_state['targets'] = self.orm_wrapper.get_or_create_targets(target_information)
+
+ def save_build_layers_and_variables(self, event):
# save layer version information for this build
+ build_obj = self.internal_state['build']
+
if not 'lvs' in self.internal_state:
logger.error("Layer version information not found; Check if the bitbake server was configured to inherit toaster.bbclass.")
else:
@@ -1024,13 +1034,6 @@ class BuildInfoHelper(object):
del self.internal_state['lvs']
- # create target information
- target_information = {}
- target_information['targets'] = event._pkgs
- target_information['build'] = build_obj
-
- self.internal_state['targets'] = self.orm_wrapper.get_or_create_targets(target_information)
-
# Save build configuration
data = self.server.runCommand(["getAllKeysWithFlags", ["doc", "func"]])[0]
diff --git a/bitbake/lib/bb/ui/toasterui.py b/bitbake/lib/bb/ui/toasterui.py
index 5382935f82b..fcfa255de6d 100644
--- a/bitbake/lib/bb/ui/toasterui.py
+++ b/bitbake/lib/bb/ui/toasterui.py
@@ -103,6 +103,7 @@ _evt_list = [
"bb.command.CommandFailed",
"bb.cooker.CookerExit",
"bb.event.BuildCompleted",
+ "bb.event.BuildInit",
"bb.event.BuildStarted",
"bb.event.CacheLoadCompleted",
"bb.event.CacheLoadProgress",
@@ -231,19 +232,15 @@ def main(server, eventHandler, params):
# pylint: disable=protected-access
# the code will look into the protected variables of the event; no easy way around this
- # we treat ParseStarted as the first event of toaster-triggered
- # builds; that way we get the Build Configuration included in the log
- # and any errors that occur before BuildStarted is fired
- if isinstance(event, bb.event.ParseStarted):
+ # create a build object in buildinfohelper from either BuildInit (if available)
+ # or BuildStarted (for jethro and previous versions)
+ if isinstance(event, (bb.event.BuildStarted, bb.event.BuildInit)):
if not (build_log and build_log_file_path):
build_log, build_log_file_path = _open_build_log(log_dir)
- continue
-
- if isinstance(event, bb.event.BuildStarted):
- if not (build_log and build_log_file_path):
- build_log, build_log_file_path = _open_build_log(log_dir)
-
- buildinfohelper.store_started_build(event, build_log_file_path)
+ buildinfohelper.store_started_build(event, build_log_file_path)
+ # get additional data from BuildStarted
+ if isinstance(event, bb.event.BuildStarted):
+ buildinfohelper.save_build_layers_and_variables(event)
continue
if isinstance(event, (bb.build.TaskStarted, bb.build.TaskSucceeded, bb.build.TaskFailedSilent)):