Pass BRBE to buildinfohelper as soon as it's set
cover Pass BRBE to buildinfohelper as soon as it's set
This fixes 'hanging' builds in UI when build is failed on early stages (recipe parsing or processing configuration).
See also https://lists.yoctoproject.org/pipermail/toaster/2015-December/003464.html
http://git.yoctoproject.org/cgit.cgi/poky-contrib/log/?h=ed/toaster/trigger-metadata-event
Ed Bartosh (3):
toaster: implement BitbakeController.triggerEvent
toaster: trigger SetBRBE event
toasterui: process SetBRBE event
lib/bb/ui/toasterui.py | 2 ++ lib/toaster/bldcontrol/bbcontroller.py | 3 +++ lib/toaster/bldcontrol/localhostbecontroller.py | 3 +++ 3 files changed, 8 insertions(+)
Signature · 1 line
2.1.4
PATCH 1/3 toaster: implement BitbakeController.triggerEvent
From: Ed Bartosh <[email protected]>
This API will be used to pass data from Toaster to toaster_ui and buildinfohelper.
--- lib/toaster/bldcontrol/bbcontroller.py | 3 +++ 1 file changed, 3 insertions(+)
lib/toaster/bldcontrol/bbcontroller.py +3 -0
@@ -55,6 +55,9 @@ class BitbakeController(object): def getVariable(self, name): return self._runCommand(["getVariable", name]) + def triggerEvent(self, event): + return self._runCommand(["triggerEvent", event]) + def build(self, targets, task = None): if task is None: task = "build"
Signature · 1 line
2.1.4
PATCH 2/3 toaster: trigger SetBRBE event
In reply to Michael WoodFrom: Ed Bartosh <[email protected]>
Triggered MetadataEvent "SetBRBE" when TOASTER_BRBE variable is set on bitbake server. This should make buildinfohelper aware of the build request id, which is used to properly report build status and failures back to Toaster.
--- lib/toaster/bldcontrol/localhostbecontroller.py | 3 +++ 1 file changed, 3 insertions(+)
lib/toaster/bldcontrol/localhostbecontroller.py +3 -0
@@ -287,6 +287,9 @@ class LocalhostBEController(BuildEnvironmentController): # set variables for var in variables: bbctrl.setVariable(var.name, var.value) + if var.name == 'TOASTER_BRBE': + bbctrl.triggerEvent('bb.event.MetadataEvent("SetBRBE", "%s")' \ + % var.value) # Add 'toaster' and 'buildhistory' to INHERIT variable inherit = {item.strip() for item in bbctrl.getVariable('INHERIT').split()}
Signature · 1 line
2.1.4
PATCH 3/3 toasterui: process SetBRBE event
In reply to Michael WoodFrom: Ed Bartosh <[email protected]>
Currently BRBE is known to toasterui only when build is started. It's passed to it with BuildStarted event. This is too late as if build fails earilier than build starts toasterui can not inform Toaster about the failure.
Set BRBE as soon as it's provided by Toaster.
This should make toasterui to be able to inform Toaster about early build failures, e.g. failures during recipe parsing.
--- lib/bb/ui/toasterui.py | 2 ++ 1 file changed, 2 insertions(+)
lib/bb/ui/toasterui.py +2 -0
@@ -363,6 +363,8 @@ def main(server, eventHandler, params): buildinfohelper.update_artifact_image_file(event) elif event.type == "LicenseManifestPath": buildinfohelper.store_license_manifest_path(event) + elif event.type == "SetBRBE": + buildinfohelper.brbe = buildinfohelper._get_data_from_event(event) else: logger.error("Unprocessed MetadataEvent %s ", str(event)) continue
Signature · 1 line
2.1.4