Patchwork [bitbake-devel] hob: populate error_msg when hob receives a CommandFailed event

login
register
mail settings
Submitter Cristiana Voicu
Date Nov. 1, 2013, 9:18 a.m.
Message ID <1383297526-16557-1-git-send-email-cristiana.voicu@intel.com>
Download mbox | patch
Permalink /patch/60949/
State New
Headers show

Comments

Cristiana Voicu - Nov. 1, 2013, 9:18 a.m.
When Hob receives a bb.command.CommandFailed event, it doesn't show any error,
because the error_msg is empty. If so, it is hard to detect the issue, because
Hob continues to run till it blocks because of an information gap.

[YOCTO #5097]
Signed-off-by: Cristiana Voicu <cristiana.voicu@intel.com>
---
 bitbake/lib/bb/ui/crumbs/hobeventhandler.py |    6 ++++++
 1 file changed, 6 insertions(+)

Patch

diff --git a/bitbake/lib/bb/ui/crumbs/hobeventhandler.py b/bitbake/lib/bb/ui/crumbs/hobeventhandler.py
index 7854742..2a629e2 100644
--- a/bitbake/lib/bb/ui/crumbs/hobeventhandler.py
+++ b/bitbake/lib/bb/ui/crumbs/hobeventhandler.py
@@ -97,6 +97,7 @@  class HobHandler(gobject.GObject):
 
         self.server = server
         self.error_msg = ""
+        self.lastCommand = ""
         self.initcmd = None
         self.parsing = False
 
@@ -111,6 +112,7 @@  class HobHandler(gobject.GObject):
             self.generating = False
 
     def runCommand(self, commandline):
+        self.lastCommand = commandline[0]
         try:
             result, error = self.server.runCommand(commandline)
             if error:
@@ -252,6 +254,10 @@  class HobHandler(gobject.GObject):
             self.current_phase = None
             self.run_next_command()
         elif isinstance(event, bb.command.CommandFailed):
+            if self.error_msg == "":
+                self.error_msg = "The command \"" + self.lastCommand
+                self.error_msg += "\" was sent to bitbake server but it failed. Please"
+                self.error_msg += " check the code executed by this command in bitbake."
             self.commands_async = []
             self.display_error()
         elif isinstance(event, (bb.event.ParseStarted,