summaryrefslogtreecommitdiffstats
path: root/bitbake
diff options
context:
space:
mode:
authorMichael Wood <michael.g.wood@intel.com>2015-10-14 10:09:12 +0100
committerRichard Purdie <richard.purdie@linuxfoundation.org>2015-10-16 14:13:22 +0100
commitae82d778e67dc35a9a2a54d9893b0ae5f00bb197 (patch)
tree917a00b89b35c4ea3f8acace3e81cbcabedcd84a /bitbake
parent596c219bf42c20f2ac6281a1216d3d6cdadc7031 (diff)
downloadpoky-ae82d778e67dc35a9a2a54d9893b0ae5f00bb197.tar.gz
bitbake: toaster: buildinfohelper Detect command line builds
When we're building using toaster as just a listener to bitbake (analysis mode) we need to handle the case where the toaster configuration data isn't present so we don't need to try and update the existing information. (Bitbake rev: a22faae2c3a5948356ce3cbc73c34509de65d370) Signed-off-by: Michael Wood <michael.g.wood@intel.com> Signed-off-by: Elliot Smith <elliot.smith@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake')
-rw-r--r--bitbake/lib/bb/ui/buildinfohelper.py34
1 files changed, 22 insertions, 12 deletions
diff --git a/bitbake/lib/bb/ui/buildinfohelper.py b/bitbake/lib/bb/ui/buildinfohelper.py
index 2d76403ecc..a8c884de37 100644
--- a/bitbake/lib/bb/ui/buildinfohelper.py
+++ b/bitbake/lib/bb/ui/buildinfohelper.py
@@ -298,9 +298,13 @@ class ORMWrapper(object):
298 break 298 break
299 299
300 300
301 301 # If we're in analysis mode then we are wholly responsible for the data
302 if created and must_exist: 302 # and therefore we return the 'real' recipe rather than the build
303 raise NotExisting("Recipe object created when expected to exist", recipe_information) 303 # history copy of the recipe.
304 if recipe_information['layer_version'].build is not None and \
305 recipe_information['layer_version'].build.project == \
306 Project.objects.get_default_project():
307 return recipe
304 308
305 return built_recipe 309 return built_recipe
306 310
@@ -333,14 +337,20 @@ class ORMWrapper(object):
333 assert 'priority' in layer_version_information 337 assert 'priority' in layer_version_information
334 assert 'local_path' in layer_version_information 338 assert 'local_path' in layer_version_information
335 339
340 # If we're doing a command line build then associate this new layer with the
341 # project to avoid it 'contaminating' toaster data
342 project = None
343 if build_obj.project == Project.objects.get_default_project():
344 project = build_obj.project
345
336 layer_version_object, _ = Layer_Version.objects.get_or_create( 346 layer_version_object, _ = Layer_Version.objects.get_or_create(
337 build = build_obj, 347 build = build_obj,
338 layer = layer_obj, 348 layer = layer_obj,
339 branch = layer_version_information['branch'], 349 branch = layer_version_information['branch'],
340 commit = layer_version_information['commit'], 350 commit = layer_version_information['commit'],
341 priority = layer_version_information['priority'], 351 priority = layer_version_information['priority'],
342 local_path = layer_version_information['local_path'], 352 local_path = layer_version_information['local_path'],
343 ) 353 project=project)
344 354
345 self.layer_version_objects.append(layer_version_object) 355 self.layer_version_objects.append(layer_version_object)
346 356
@@ -845,7 +855,7 @@ class BuildInfoHelper(object):
845 logger.warn("Could not match layer version for recipe path %s : %s", path, self.orm_wrapper.layer_version_objects) 855 logger.warn("Could not match layer version for recipe path %s : %s", path, self.orm_wrapper.layer_version_objects)
846 856
847 #mockup the new layer 857 #mockup the new layer
848 unknown_layer, _ = Layer.objects.get_or_create(name="__FIXME__unidentified_layer", layer_index_url="") 858 unknown_layer, _ = Layer.objects.get_or_create(name="Unidentified layer", layer_index_url="")
849 unknown_layer_version_obj, _ = Layer_Version.objects.get_or_create(layer = unknown_layer, build = self.internal_state['build']) 859 unknown_layer_version_obj, _ = Layer_Version.objects.get_or_create(layer = unknown_layer, build = self.internal_state['build'])
850 860
851 # append it so we don't run into this error again and again 861 # append it so we don't run into this error again and again
@@ -1067,7 +1077,7 @@ class BuildInfoHelper(object):
1067 task_information['disk_io'] = taskstats['disk_io'] 1077 task_information['disk_io'] = taskstats['disk_io']
1068 if 'elapsed_time' in taskstats: 1078 if 'elapsed_time' in taskstats:
1069 task_information['elapsed_time'] = taskstats['elapsed_time'] 1079 task_information['elapsed_time'] = taskstats['elapsed_time']
1070 self.orm_wrapper.get_update_task_object(task_information, True) # must exist 1080 self.orm_wrapper.get_update_task_object(task_information)
1071 1081
1072 def update_and_store_task(self, event): 1082 def update_and_store_task(self, event):
1073 assert 'taskfile' in vars(event) 1083 assert 'taskfile' in vars(event)