<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On 14 October 2015 at 10:09, Elliot Smith <span dir="ltr"><<a href="mailto:elliot.smith@intel.com" target="_blank">elliot.smith@intel.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">From: Michael Wood <<a href="mailto:michael.g.wood@intel.com">michael.g.wood@intel.com</a>><br>
<span class=""><br>
When we're building using toaster as just a listener to bitbake<br>
(analysis mode) we need to handle the case where the toaster configuration data<br>
isn't present so we don't need to try and update the existing information.<br></span></blockquote><div><br></div><div>I submitted this upstream as was (I decided toaster is probably OK as a subject), and have added it to toaster-next.</div><div><br></div><div>Elliot</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class="">
<br>
</span>Signed-off-by: Michael Wood <<a href="mailto:michael.g.wood@intel.com">michael.g.wood@intel.com</a>><br>
Signed-off-by: Elliot Smith <<a href="mailto:elliot.smith@intel.com">elliot.smith@intel.com</a>><br>
<span class="">---<br>
bitbake/lib/bb/ui/buildinfohelper.py | 34 ++++++++++++++++++++++------------<br>
1 file changed, 22 insertions(+), 12 deletions(-)<br>
<br>
diff --git a/bitbake/lib/bb/ui/buildinfohelper.py b/bitbake/lib/bb/ui/buildinfohelper.py<br>
</span>index 2d76403..a8c884d 100644<br>
--- a/bitbake/lib/bb/ui/buildinfohelper.py<br>
+++ b/bitbake/lib/bb/ui/buildinfohelper.py<br>
@@ -298,9 +298,13 @@ class ORMWrapper(object):<br>
<span class=""> break<br>
<br>
<br>
-<br>
- if created and must_exist:<br>
- raise NotExisting("Recipe object created when expected to exist", recipe_information)<br>
+ # If we're in analysis mode then we are wholly responsible for the data<br>
+ # and therefore we return the 'real' recipe rather than the build<br>
+ # history copy of the recipe.<br>
+ if recipe_information['layer_version'].build is not None and \<br>
+ recipe_information['layer_version'].build.project == \<br>
+ Project.objects.get_default_project():<br>
+ return recipe<br>
<br>
return built_recipe<br>
<br>
</span>@@ -333,14 +337,20 @@ class ORMWrapper(object):<br>
<span class=""> assert 'priority' in layer_version_information<br>
assert 'local_path' in layer_version_information<br>
<br>
+ # If we're doing a command line build then associate this new layer with the<br>
+ # project to avoid it 'contaminating' toaster data<br>
+ project = None<br>
+ if build_obj.project == Project.objects.get_default_project():<br>
+ project = build_obj.project<br>
+<br>
layer_version_object, _ = Layer_Version.objects.get_or_create(<br>
- build = build_obj,<br>
- layer = layer_obj,<br>
- branch = layer_version_information['branch'],<br>
- commit = layer_version_information['commit'],<br>
- priority = layer_version_information['priority'],<br>
- local_path = layer_version_information['local_path'],<br>
- )<br>
+ build = build_obj,<br>
+ layer = layer_obj,<br>
+ branch = layer_version_information['branch'],<br>
+ commit = layer_version_information['commit'],<br>
+ priority = layer_version_information['priority'],<br>
+ local_path = layer_version_information['local_path'],<br>
+ project=project)<br>
<br>
self.layer_version_objects.append(layer_version_object)<br>
<br>
</span>@@ -845,7 +855,7 @@ class BuildInfoHelper(object):<br>
<span class=""> logger.warn("Could not match layer version for recipe path %s : %s", path, self.orm_wrapper.layer_version_objects)<br>
<br>
#mockup the new layer<br>
- unknown_layer, _ = Layer.objects.get_or_create(name="__FIXME__unidentified_layer", layer_index_url="")<br>
+ unknown_layer, _ = Layer.objects.get_or_create(name="Unidentified layer", layer_index_url="")<br>
unknown_layer_version_obj, _ = Layer_Version.objects.get_or_create(layer = unknown_layer, build = self.internal_state['build'])<br>
<br>
# append it so we don't run into this error again and again<br>
</span>@@ -1067,7 +1077,7 @@ class BuildInfoHelper(object):<br>
<span class=""> task_information['disk_io'] = taskstats['disk_io']<br>
if 'elapsed_time' in taskstats:<br>
task_information['elapsed_time'] = taskstats['elapsed_time']<br>
- self.orm_wrapper.get_update_task_object(task_information, True) # must exist<br>
+ self.orm_wrapper.get_update_task_object(task_information)<br>
<br>
def update_and_store_task(self, event):<br>
assert 'taskfile' in vars(event)<br>
--<br>
</span>1.9.3<br>
<br>
---------------------------------------------------------------------<br>
Intel Corporation (UK) Limited<br>
Registered No. 1134945 (England)<br>
Registered Office: Pipers Way, Swindon SN3 1RJ<br>
VAT No: 860 2173 47<br>
<br>
This e-mail and any attachments may contain confidential material for<br>
the sole use of the intended recipient(s). Any review or distribution<br>
by others is strictly prohibited. If you are not the intended<br>
recipient, please contact the sender and delete all copies.<br>
<br>
</blockquote></div><br><br clear="all"><div><br></div>-- <br><div class="gmail_signature"><div dir="ltr"><div>Elliot Smith<br>Software Engineer<br>Intel Open Source Technology Centre</div></div></div>
</div></div>