diff options
author | Alexandru DAMIAN <alexandru.damian@intel.com> | 2015-03-12 12:44:05 +0000 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2015-03-21 00:00:23 +0000 |
commit | a273d8f1510a8a711e5f2b28b51f058cffd4bff7 (patch) | |
tree | cb421d9018506afef0b7bf54ce691aac2e00a2e0 /bitbake/lib/bb/ui | |
parent | c5e9654ac908537ad0b14e0804be312e7c6f5be8 (diff) | |
download | poky-a273d8f1510a8a711e5f2b28b51f058cffd4bff7.tar.gz |
bitbake: toasterui: improve info in the toaster_ui.log
We improve logging and signalling of errors in the
toaster_ui.log to facilitate debugging on remote systems.
(Bitbake rev: 3cd248f99b90367bd41aab81e255fc1912434890)
Signed-off-by: Alexandru DAMIAN <alexandru.damian@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake/lib/bb/ui')
-rw-r--r-- | bitbake/lib/bb/ui/buildinfohelper.py | 12 | ||||
-rw-r--r-- | bitbake/lib/bb/ui/toasterui.py | 8 |
2 files changed, 16 insertions, 4 deletions
diff --git a/bitbake/lib/bb/ui/buildinfohelper.py b/bitbake/lib/bb/ui/buildinfohelper.py index cf8c444fdf..b511abe7ad 100644 --- a/bitbake/lib/bb/ui/buildinfohelper.py +++ b/bitbake/lib/bb/ui/buildinfohelper.py | |||
@@ -33,6 +33,7 @@ from toaster.orm.models import Task_Dependency, Package_Dependency | |||
33 | from toaster.orm.models import Recipe_Dependency | 33 | from toaster.orm.models import Recipe_Dependency |
34 | from bb.msg import BBLogFormatter as format | 34 | from bb.msg import BBLogFormatter as format |
35 | from django.db import models | 35 | from django.db import models |
36 | from pprint import pformat | ||
36 | import logging | 37 | import logging |
37 | 38 | ||
38 | from django.db import transaction, connection | 39 | from django.db import transaction, connection |
@@ -282,7 +283,6 @@ class ORMWrapper(object): | |||
282 | # we might have a race condition here, as the project layers may change between the build trigger and the actual build execution | 283 | # we might have a race condition here, as the project layers may change between the build trigger and the actual build execution |
283 | # but we can only match on the layer name, so the worst thing can happen is a mis-identification of the layer, not a total failure | 284 | # but we can only match on the layer name, so the worst thing can happen is a mis-identification of the layer, not a total failure |
284 | 285 | ||
285 | from pprint import pformat | ||
286 | # note that this is different | 286 | # note that this is different |
287 | buildrequest = BuildRequest.objects.get(pk = br_id) | 287 | buildrequest = BuildRequest.objects.get(pk = br_id) |
288 | for brl in buildrequest.brlayer_set.all(): | 288 | for brl in buildrequest.brlayer_set.all(): |
@@ -467,7 +467,7 @@ class ORMWrapper(object): | |||
467 | Package_Dependency.objects.bulk_create(packagedeps_objs) | 467 | Package_Dependency.objects.bulk_create(packagedeps_objs) |
468 | 468 | ||
469 | if (len(errormsg) > 0): | 469 | if (len(errormsg) > 0): |
470 | raise Exception(errormsg) | 470 | logger.warn("buildinfohelper: target_package_info could not identify recipes: \n%s" % errormsg) |
471 | 471 | ||
472 | def save_target_image_file_information(self, target_obj, file_name, file_size): | 472 | def save_target_image_file_information(self, target_obj, file_name, file_size): |
473 | target_image_file = Target_Image_File.objects.create( target = target_obj, | 473 | target_image_file = Target_Image_File.objects.create( target = target_obj, |
@@ -885,9 +885,13 @@ class BuildInfoHelper(object): | |||
885 | assert localfilepath.startswith("/") | 885 | assert localfilepath.startswith("/") |
886 | 886 | ||
887 | recipe_information = self._get_recipe_information_from_taskfile(taskfile) | 887 | recipe_information = self._get_recipe_information_from_taskfile(taskfile) |
888 | recipe_object = Recipe.objects.get(layer_version = recipe_information['layer_version'], | 888 | try: |
889 | recipe_object = Recipe.objects.get(layer_version = recipe_information['layer_version'], | ||
889 | file_path__endswith = recipe_information['file_path'], | 890 | file_path__endswith = recipe_information['file_path'], |
890 | name = recipename) | 891 | name = recipename) |
892 | except Recipe.DoesNotExist: | ||
893 | logger.error("Could not find recipe for recipe_information %s name %s" % (pformat(recipe_information), name)) | ||
894 | raise | ||
891 | 895 | ||
892 | task_information = {} | 896 | task_information = {} |
893 | task_information['build'] = self.internal_state['build'] | 897 | task_information['build'] = self.internal_state['build'] |
@@ -1127,7 +1131,7 @@ class BuildInfoHelper(object): | |||
1127 | Task_Dependency.objects.bulk_create(taskdeps_objects) | 1131 | Task_Dependency.objects.bulk_create(taskdeps_objects) |
1128 | 1132 | ||
1129 | if (len(errormsg) > 0): | 1133 | if (len(errormsg) > 0): |
1130 | raise Exception(errormsg) | 1134 | logger.warn("buildinfohelper: dependency info not identify recipes: \n%s" % errormsg) |
1131 | 1135 | ||
1132 | 1136 | ||
1133 | def store_build_package_information(self, event): | 1137 | def store_build_package_information(self, event): |
diff --git a/bitbake/lib/bb/ui/toasterui.py b/bitbake/lib/bb/ui/toasterui.py index df9f362284..db119cea67 100644 --- a/bitbake/lib/bb/ui/toasterui.py +++ b/bitbake/lib/bb/ui/toasterui.py | |||
@@ -327,9 +327,17 @@ def main(server, eventHandler, params ): | |||
327 | except Exception as e: | 327 | except Exception as e: |
328 | # print errors to log | 328 | # print errors to log |
329 | import traceback | 329 | import traceback |
330 | from pprint import pformat | ||
330 | exception_data = traceback.format_exc() | 331 | exception_data = traceback.format_exc() |
331 | logger.error("%s\n%s" % (e, exception_data)) | 332 | logger.error("%s\n%s" % (e, exception_data)) |
332 | 333 | ||
334 | exc_type, exc_value, tb = sys.exc_info() | ||
335 | if tb is not None: | ||
336 | curr = tb | ||
337 | while curr is not None: | ||
338 | logger.warn("Error data dump %s\n%s\n" % (traceback.format_tb(curr,1), pformat(curr.tb_frame.f_locals))) | ||
339 | curr = curr.tb_next | ||
340 | |||
333 | # save them to database, if possible; if it fails, we already logged to console. | 341 | # save them to database, if possible; if it fails, we already logged to console. |
334 | try: | 342 | try: |
335 | buildinfohelper.store_log_exception("%s\n%s" % (str(e), exception_data)) | 343 | buildinfohelper.store_log_exception("%s\n%s" % (str(e), exception_data)) |