summaryrefslogtreecommitdiffstats
path: root/bitbake
diff options
context:
space:
mode:
Diffstat (limited to 'bitbake')
-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 c049b4a150..81abede803 100644
--- a/bitbake/lib/bb/ui/buildinfohelper.py
+++ b/bitbake/lib/bb/ui/buildinfohelper.py
@@ -832,8 +832,13 @@ class BuildInfoHelper(object):
832 self.orm_wrapper = ORMWrapper() 832 self.orm_wrapper = ORMWrapper()
833 self.has_build_history = has_build_history 833 self.has_build_history = has_build_history
834 self.tmp_dir = self.server.runCommand(["getVariable", "TMPDIR"])[0] 834 self.tmp_dir = self.server.runCommand(["getVariable", "TMPDIR"])[0]
835 self.brbe = self.server.runCommand(["getVariable", "TOASTER_BRBE"])[0] 835
836 self.project = self.server.runCommand(["getVariable", "TOASTER_PROJECT"])[0] 836 # this is set for Toaster-triggered builds by localhostbecontroller
837 # via toasterui
838 self.brbe = None
839
840 self.project = None
841
837 logger.debug(1, "buildinfohelper: Build info helper inited %s" % vars(self)) 842 logger.debug(1, "buildinfohelper: Build info helper inited %s" % vars(self))
838 843
839 844
@@ -843,8 +848,6 @@ class BuildInfoHelper(object):
843 848
844 def _get_build_information(self, build_log_path): 849 def _get_build_information(self, build_log_path):
845 build_info = {} 850 build_info = {}
846 # Generate an identifier for each new build
847
848 build_info['machine'] = self.server.runCommand(["getVariable", "MACHINE"])[0] 851 build_info['machine'] = self.server.runCommand(["getVariable", "MACHINE"])[0]
849 build_info['distro'] = self.server.runCommand(["getVariable", "DISTRO"])[0] 852 build_info['distro'] = self.server.runCommand(["getVariable", "DISTRO"])[0]
850 build_info['distro_version'] = self.server.runCommand(["getVariable", "DISTRO_VERSION"])[0] 853 build_info['distro_version'] = self.server.runCommand(["getVariable", "DISTRO_VERSION"])[0]
@@ -853,9 +856,7 @@ class BuildInfoHelper(object):
853 build_info['cooker_log_path'] = build_log_path 856 build_info['cooker_log_path'] = build_log_path
854 build_info['build_name'] = self.server.runCommand(["getVariable", "BUILDNAME"])[0] 857 build_info['build_name'] = self.server.runCommand(["getVariable", "BUILDNAME"])[0]
855 build_info['bitbake_version'] = self.server.runCommand(["getVariable", "BB_VERSION"])[0] 858 build_info['bitbake_version'] = self.server.runCommand(["getVariable", "BB_VERSION"])[0]
856 build_info['brbe'] = self.server.runCommand(["getVariable", "TOASTER_BRBE"])[0]
857 build_info['project'] = self.project = self.server.runCommand(["getVariable", "TOASTER_PROJECT"])[0] 859 build_info['project'] = self.project = self.server.runCommand(["getVariable", "TOASTER_PROJECT"])[0]
858
859 return build_info 860 return build_info
860 861
861 def _get_task_information(self, event, recipe): 862 def _get_task_information(self, event, recipe):
@@ -967,7 +968,6 @@ class BuildInfoHelper(object):
967 build_information = self._get_build_information(build_log_path) 968 build_information = self._get_build_information(build_log_path)
968 969
969 # Update brbe and project as they can be changed for every build 970 # Update brbe and project as they can be changed for every build
970 self.brbe = build_information['brbe']
971 self.project = build_information['project'] 971 self.project = build_information['project']
972 972
973 build_obj = self.orm_wrapper.create_build_object(build_information, self.brbe, self.project) 973 build_obj = self.orm_wrapper.create_build_object(build_information, self.brbe, self.project)
@@ -1487,3 +1487,8 @@ class BuildInfoHelper(object):
1487 1487
1488 if not connection.features.autocommits_when_autocommit_is_off: 1488 if not connection.features.autocommits_when_autocommit_is_off:
1489 transaction.set_autocommit(True) 1489 transaction.set_autocommit(True)
1490
1491 # unset the brbe; this is to prevent subsequent command-line builds
1492 # being incorrectly attached to the previous Toaster-triggered build;
1493 # see https://bugzilla.yoctoproject.org/show_bug.cgi?id=9021
1494 self.brbe = None
diff --git a/bitbake/lib/toaster/bldcontrol/localhostbecontroller.py b/bitbake/lib/toaster/bldcontrol/localhostbecontroller.py
index a7db1efc65..efd82c325b 100644
--- a/bitbake/lib/toaster/bldcontrol/localhostbecontroller.py
+++ b/bitbake/lib/toaster/bldcontrol/localhostbecontroller.py
@@ -308,12 +308,17 @@ class LocalhostBEController(BuildEnvironmentController):
308 # get the bb server running with the build req id and build env id 308 # get the bb server running with the build req id and build env id
309 bbctrl = self.getBBController() 309 bbctrl = self.getBBController()
310 310
311 # set variables 311 # set variables; TOASTER_BRBE is not set on the server, as this
312 # causes events from command-line builds to be attached to the last
313 # Toaster-triggered build; instead, TOASTER_BRBE is fired as an event so
314 # that toasterui can set it on the buildinfohelper;
315 # see https://bugzilla.yoctoproject.org/show_bug.cgi?id=9021
312 for var in variables: 316 for var in variables:
313 bbctrl.setVariable(var.name, var.value)
314 if var.name == 'TOASTER_BRBE': 317 if var.name == 'TOASTER_BRBE':
315 bbctrl.triggerEvent('bb.event.MetadataEvent("SetBRBE", "%s")' \ 318 bbctrl.triggerEvent('bb.event.MetadataEvent("SetBRBE", "%s")' \
316 % var.value) 319 % var.value)
320 else:
321 bbctrl.setVariable(var.name, var.value)
317 322
318 # Add 'toaster' and 'buildhistory' to INHERIT variable 323 # Add 'toaster' and 'buildhistory' to INHERIT variable
319 inherit = {item.strip() for item in bbctrl.getVariable('INHERIT').split()} 324 inherit = {item.strip() for item in bbctrl.getVariable('INHERIT').split()}