summaryrefslogtreecommitdiffstats
path: root/bitbake/lib/bb/ui
diff options
context:
space:
mode:
authorAlexandru DAMIAN <alexandru.damian@intel.com>2015-02-05 13:18:06 +0000
committerRichard Purdie <richard.purdie@linuxfoundation.org>2015-02-10 23:07:48 +0000
commitda8110a86ad8b57b8c41873d40aeac346ee66b88 (patch)
tree0c25d2757da8ed119316af0886ebb64818bdc8cd /bitbake/lib/bb/ui
parent0c89846dafa229b5af9653d6e141011c35451825 (diff)
downloadpoky-da8110a86ad8b57b8c41873d40aeac346ee66b88.tar.gz
bitbake: toaster: improve logging facilities for toaster
This patch improves the logging facilities for toaster in order to help diagnose bugs that happen on user machines. The logs are stored now under "/tmp/toaster_$$" where $$ is a PID-based unique identifier. On shutdown, toaster will automatically erase all logs unless errors are listed in the log file. On error, Toaster provides suggestions on what to do. This patch includes a minor fix found as a result of logging improvements. (Bitbake rev: 8a8248f7b7e30469f592e2f8adbf6ce21e8685c5) 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.py47
1 files changed, 35 insertions, 12 deletions
diff --git a/bitbake/lib/bb/ui/buildinfohelper.py b/bitbake/lib/bb/ui/buildinfohelper.py
index 4e2d4a7dec..491fd1566d 100644
--- a/bitbake/lib/bb/ui/buildinfohelper.py
+++ b/bitbake/lib/bb/ui/buildinfohelper.py
@@ -656,18 +656,41 @@ class BuildInfoHelper(object):
656 assert path.startswith("/") 656 assert path.startswith("/")
657 assert 'build' in self.internal_state 657 assert 'build' in self.internal_state
658 658
659 def _slkey(layer_version): 659 if self.brbe is None:
660 assert isinstance(layer_version, Layer_Version) 660 def _slkey_interactive(layer_version):
661 return len(layer_version.layer.local_path) 661 assert isinstance(layer_version, Layer_Version)
662 662 return len(layer_version.layer.local_path)
663 # Heuristics: we always match recipe to the deepest layer path that 663
664 # we can match to the recipe file path 664 # Heuristics: we always match recipe to the deepest layer path in the discovered layers
665 for bl in sorted(self.orm_wrapper.layer_version_objects, reverse=True, key=_slkey): 665 for lvo in sorted(self.orm_wrapper.layer_version_objects, reverse=True, key=_slkey_interactive):
666 if (path.startswith(bl.layer.local_path)): 666 # we can match to the recipe file path
667 return bl 667 if path.startswith(lvo.layer.local_path):
668 668 return lvo
669 #if we get here, we didn't read layers correctly; mockup the new layer 669
670 unknown_layer, created = Layer.objects.get_or_create(name="unknown", local_path="/", layer_index_url="") 670 else:
671 br_id, be_id = self.brbe.split(":")
672 from bldcontrol.bbcontroller import getBuildEnvironmentController
673 from bldcontrol.models import BuildRequest
674 bc = getBuildEnvironmentController(pk = be_id)
675
676 def _slkey_managed(layer_version):
677 return len(bc.getGitCloneDirectory(layer_version.giturl, layer_version.commit) + layer_version.dirpath)
678
679 # Heuristics: we match the path to where the layers have been checked out
680 for brl in sorted(BuildRequest.objects.get(pk = br_id).brlayer_set.all(), reverse = True, key = _slkey_managed):
681 localdirname = os.path.join(os.path.join(bc.be.sourcedir, bc.getGitCloneDirectory(brl.giturl, brl.commit)), brl.dirpath)
682 if path.startswith(localdirname):
683 #logger.warn("-- managed: matched path %s with layer %s " % (path, localdirname))
684 # we matched the BRLayer, but we need the layer_version that generated this br
685 for lvo in self.orm_wrapper.layer_version_objects:
686 if brl.name == lvo.layer.name:
687 return lvo
688
689 #if we get here, we didn't read layers correctly; dump whatever information we have on the error log
690 logger.error("Could not match layer version for recipe path %s : %s" % (path, self.orm_wrapper.layer_version_objects))
691
692 #mockup the new layer
693 unknown_layer, created = Layer.objects.get_or_create(name="__FIXME__unidentified_layer", local_path="/", layer_index_url="")
671 unknown_layer_version_obj, created = Layer_Version.objects.get_or_create(layer = unknown_layer, build = self.internal_state['build']) 694 unknown_layer_version_obj, created = Layer_Version.objects.get_or_create(layer = unknown_layer, build = self.internal_state['build'])
672 695
673 return unknown_layer_version_obj 696 return unknown_layer_version_obj