aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--bitbake/lib/bb/ui/buildinfohelper.py19
-rw-r--r--bitbake/lib/toaster/bldcontrol/localhostbecontroller.py9
2 files changed, 19 insertions, 9 deletions
diff --git a/bitbake/lib/bb/ui/buildinfohelper.py b/bitbake/lib/bb/ui/buildinfohelper.py
index 0cb6f684f93..9469cbbc6ae 100644
--- a/bitbake/lib/bb/ui/buildinfohelper.py
+++ b/bitbake/lib/bb/ui/buildinfohelper.py
@@ -778,8 +778,13 @@ class BuildInfoHelper(object):
self.orm_wrapper = ORMWrapper()
self.has_build_history = has_build_history
self.tmp_dir = self.server.runCommand(["getVariable", "TMPDIR"])[0]
- self.brbe = self.server.runCommand(["getVariable", "TOASTER_BRBE"])[0]
- self.project = self.server.runCommand(["getVariable", "TOASTER_PROJECT"])[0]
+
+ # this is set for Toaster-triggered builds by localhostbecontroller
+ # via toasterui
+ self.brbe = None
+
+ self.project = None
+
logger.debug(1, "buildinfohelper: Build info helper inited %s" % vars(self))
@@ -789,8 +794,6 @@ class BuildInfoHelper(object):
def _get_build_information(self, build_log_path):
build_info = {}
- # Generate an identifier for each new build
-
build_info['machine'] = self.server.runCommand(["getVariable", "MACHINE"])[0]
build_info['distro'] = self.server.runCommand(["getVariable", "DISTRO"])[0]
build_info['distro_version'] = self.server.runCommand(["getVariable", "DISTRO_VERSION"])[0]
@@ -799,9 +802,7 @@ class BuildInfoHelper(object):
build_info['cooker_log_path'] = build_log_path
build_info['build_name'] = self.server.runCommand(["getVariable", "BUILDNAME"])[0]
build_info['bitbake_version'] = self.server.runCommand(["getVariable", "BB_VERSION"])[0]
- build_info['brbe'] = self.server.runCommand(["getVariable", "TOASTER_BRBE"])[0]
build_info['project'] = self.project = self.server.runCommand(["getVariable", "TOASTER_PROJECT"])[0]
-
return build_info
def _get_task_information(self, event, recipe):
@@ -913,7 +914,6 @@ class BuildInfoHelper(object):
build_information = self._get_build_information(build_log_path)
# Update brbe and project as they can be changed for every build
- self.brbe = build_information['brbe']
self.project = build_information['project']
build_obj = self.orm_wrapper.create_build_object(build_information, self.brbe, self.project)
@@ -1425,3 +1425,8 @@ class BuildInfoHelper(object):
if not connection.features.autocommits_when_autocommit_is_off:
transaction.set_autocommit(True)
+
+ # unset the brbe; this is to prevent subsequent command-line builds
+ # being incorrectly attached to the previous Toaster-triggered build;
+ # see https://bugzilla.yoctoproject.org/show_bug.cgi?id=9021
+ self.brbe = None
diff --git a/bitbake/lib/toaster/bldcontrol/localhostbecontroller.py b/bitbake/lib/toaster/bldcontrol/localhostbecontroller.py
index 2215d7af24b..0c2dede4844 100644
--- a/bitbake/lib/toaster/bldcontrol/localhostbecontroller.py
+++ b/bitbake/lib/toaster/bldcontrol/localhostbecontroller.py
@@ -290,12 +290,17 @@ class LocalhostBEController(BuildEnvironmentController):
# get the bb server running with the build req id and build env id
bbctrl = self.getBBController()
- # set variables
+ # set variables; TOASTER_BRBE is not set on the server, as this
+ # causes events from command-line builds to be attached to the last
+ # Toaster-triggered build; instead, TOASTER_BRBE is fired as an event so
+ # that toasterui can set it on the buildinfohelper;
+ # see https://bugzilla.yoctoproject.org/show_bug.cgi?id=9021
for var in variables:
- bbctrl.setVariable(var.name, var.value)
if var.name == 'TOASTER_BRBE':
bbctrl.triggerEvent('bb.event.MetadataEvent("SetBRBE", "%s")' \
% var.value)
+ else:
+ bbctrl.setVariable(var.name, var.value)
# Add 'toaster' and 'buildhistory' to INHERIT variable
inherit = {item.strip() for item in bbctrl.getVariable('INHERIT').split()}