Skip to contentSkip to conversation

cooker: Fire BuildCompleted before finishing the command

PATCH New Richard Purdie 1 participant 1 message Jun 25, 2015

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 cooker: Fire BuildCompleted before finishing the command

Some handlers hook on BuildComplete so it avoids certain event races to finish the command after the BuildComplete event is sent out.

This means the UI is available to handle events until the command completes.

What appears to be a race on one of the sanity tests for event handlers triggered this change although the failure is hard to reproduce.

[YOCTO #7921]

bitbake/lib/bb/cooker.py +2 -2
index d42b389..0dd3296 100644
@@ -1306,8 +1306,8 @@ class BBCooker:
                 return False
 
             if not retval:
-                self.command.finishAsyncCommand(msg)
                 bb.event.fire(bb.event.BuildCompleted(len(rq.rqdata.runq_fnid), buildname, item, failures), self.expanded_data)
+                self.command.finishAsyncCommand(msg)
                 return False
             if retval is True:
                 return True
@@ -1339,8 +1339,8 @@ class BBCooker:
                 return False
 
             if not retval:
-                self.command.finishAsyncCommand(msg)
                 bb.event.fire(bb.event.BuildCompleted(len(rq.rqdata.runq_fnid), buildname, targets, failures), self.data)
+                self.command.finishAsyncCommand(msg)
                 return False
             if retval is True:
                 return True