Skip to contentSkip to conversation

cooker: pass exception to finishAsyncCommand

PATCH New Elliot Smith 1 participant 1 message Feb 29, 2016

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 cooker: pass exception to finishAsyncCommand

From: Richard Purdie <[email protected]>

An invalid task causes bitbake to exit incorrectly, firing a CommandCompleted event rather than a CommandFailed one. This means that clients listening for CommandFailed events are unable to detect the build failure even though one occurred.

Passing an exception string to finishAsyncCommand when a task fails causes the CommandFailed event to be fired correctly.

[YOCTO #9087]

---
 bitbake/lib/bb/cooker.py | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
bitbake/lib/bb/cooker.py +2 -2
index 96cefc7..3014697 100644
@@ -1349,7 +1349,7 @@ class BBCooker:
                 failures += len(exc.args)
                 retval = False
             except SystemExit as exc:
-                self.command.finishAsyncCommand()
+                self.command.finishAsyncCommand(str(exc))
                 return False
 
             if not retval:
@@ -1385,7 +1385,7 @@ class BBCooker:
                 failures += len(exc.args)
                 retval = False
             except SystemExit as exc:
-                self.command.finishAsyncCommand()
+                self.command.finishAsyncCommand(str(exc))
                 return False
 
             if not retval:
Signature · 12 lines
1.9.3

---------------------------------------------------------------------
Intel Corporation (UK) Limited
Registered No. 1134945 (England)
Registered Office: Pipers Way, Swindon SN3 1RJ
VAT No: 860 2173 47

This e-mail and any attachments may contain confidential material for
the sole use of the intended recipient(s). Any review or distribution
by others is strictly prohibited. If you are not the intended
recipient, please contact the sender and delete all copies.