summaryrefslogtreecommitdiffstats
path: root/bitbake
diff options
context:
space:
mode:
authorAlexandru DAMIAN <alexandru.damian@intel.com>2013-11-19 16:46:41 +0000
committerRichard Purdie <richard.purdie@linuxfoundation.org>2013-11-20 14:05:52 +0000
commite19ee57c962dfa7ce7802e27e16daea53f3052a3 (patch)
tree8909ca9649bd18084d130a117a7e6d0e72b756e3 /bitbake
parent10717e5a0a2918b04af04c7dca31efacd4ae8b7c (diff)
downloadpoky-e19ee57c962dfa7ce7802e27e16daea53f3052a3.tar.gz
bitbake: bitbake: cooker, toaster: mark interrupted builds as failed
This patch changes bitbake to log an error to the command line when the build is interrupted via Ctrl-C. This is needed to inform the user that not all tasks required for the build have been executed, and the build is not complete. Internally, the Bitbake server will return a CommandFailed event that will be logged by Toaster as build failure. (Bitbake rev: 9a658e8b1511f1b9f91663f546f748fdfbc8965f) Signed-off-by: Alexandru DAMIAN <alexandru.damian@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake')
-rw-r--r--bitbake/lib/bb/cooker.py10
-rw-r--r--bitbake/lib/bb/ui/toasterui.py7
2 files changed, 15 insertions, 2 deletions
diff --git a/bitbake/lib/bb/cooker.py b/bitbake/lib/bb/cooker.py
index 524ba1182c..3295f6c822 100644
--- a/bitbake/lib/bb/cooker.py
+++ b/bitbake/lib/bb/cooker.py
@@ -1109,10 +1109,13 @@ class BBCooker:
1109 1109
1110 def buildFileIdle(server, rq, abort): 1110 def buildFileIdle(server, rq, abort):
1111 1111
1112 msg = None
1112 if abort or self.state == state.forceshutdown: 1113 if abort or self.state == state.forceshutdown:
1113 rq.finish_runqueue(True) 1114 rq.finish_runqueue(True)
1115 msg = "Forced shutdown"
1114 elif self.state == state.shutdown: 1116 elif self.state == state.shutdown:
1115 rq.finish_runqueue(False) 1117 rq.finish_runqueue(False)
1118 msg = "Stopped build"
1116 failures = 0 1119 failures = 0
1117 try: 1120 try:
1118 retval = rq.execute_runqueue() 1121 retval = rq.execute_runqueue()
@@ -1125,7 +1128,7 @@ class BBCooker:
1125 1128
1126 if not retval: 1129 if not retval:
1127 bb.event.fire(bb.event.BuildCompleted(len(rq.rqdata.runq_fnid), buildname, item, failures), self.event_data) 1130 bb.event.fire(bb.event.BuildCompleted(len(rq.rqdata.runq_fnid), buildname, item, failures), self.event_data)
1128 self.command.finishAsyncCommand() 1131 self.command.finishAsyncCommand(msg)
1129 return False 1132 return False
1130 if retval is True: 1133 if retval is True:
1131 return True 1134 return True
@@ -1139,10 +1142,13 @@ class BBCooker:
1139 """ 1142 """
1140 1143
1141 def buildTargetsIdle(server, rq, abort): 1144 def buildTargetsIdle(server, rq, abort):
1145 msg = None
1142 if abort or self.state == state.forceshutdown: 1146 if abort or self.state == state.forceshutdown:
1143 rq.finish_runqueue(True) 1147 rq.finish_runqueue(True)
1148 msg = "Forced shutdown"
1144 elif self.state == state.shutdown: 1149 elif self.state == state.shutdown:
1145 rq.finish_runqueue(False) 1150 rq.finish_runqueue(False)
1151 msg = "Stopped build"
1146 failures = 0 1152 failures = 0
1147 try: 1153 try:
1148 retval = rq.execute_runqueue() 1154 retval = rq.execute_runqueue()
@@ -1155,7 +1161,7 @@ class BBCooker:
1155 1161
1156 if not retval: 1162 if not retval:
1157 bb.event.fire(bb.event.BuildCompleted(len(rq.rqdata.runq_fnid), buildname, targets, failures), self.data) 1163 bb.event.fire(bb.event.BuildCompleted(len(rq.rqdata.runq_fnid), buildname, targets, failures), self.data)
1158 self.command.finishAsyncCommand() 1164 self.command.finishAsyncCommand(msg)
1159 return False 1165 return False
1160 if retval is True: 1166 if retval is True:
1161 return True 1167 return True
diff --git a/bitbake/lib/bb/ui/toasterui.py b/bitbake/lib/bb/ui/toasterui.py
index d2dba256c4..8e30a91109 100644
--- a/bitbake/lib/bb/ui/toasterui.py
+++ b/bitbake/lib/bb/ui/toasterui.py
@@ -217,6 +217,13 @@ def main(server, eventHandler, params ):
217 if isinstance(event, (bb.command.CommandCompleted, 217 if isinstance(event, (bb.command.CommandCompleted,
218 bb.command.CommandFailed, 218 bb.command.CommandFailed,
219 bb.command.CommandExit)): 219 bb.command.CommandExit)):
220 if (isinstance(event, bb.command.CommandFailed)):
221 event.levelno = format.ERROR
222 event.msg = event.error
223 event.pathname = ""
224 event.lineno = 0
225 buildinfohelper.store_log_event(event)
226 errors += 1
220 227
221 buildinfohelper.update_build_information(event, errors, warnings, taskfailures) 228 buildinfohelper.update_build_information(event, errors, warnings, taskfailures)
222 229