summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--bitbake/lib/bb/server/process.py7
-rw-r--r--bitbake/lib/bb/ui/knotty.py21
2 files changed, 23 insertions, 5 deletions
diff --git a/bitbake/lib/bb/server/process.py b/bitbake/lib/bb/server/process.py
index 4d3d1a4308..8699765a31 100644
--- a/bitbake/lib/bb/server/process.py
+++ b/bitbake/lib/bb/server/process.py
@@ -365,7 +365,12 @@ class ServerCommunicator():
365 logger.info("No reply from server in 30s") 365 logger.info("No reply from server in 30s")
366 if not self.recv.poll(30): 366 if not self.recv.poll(30):
367 raise ProcessTimeout("Timeout while waiting for a reply from the bitbake server (60s)") 367 raise ProcessTimeout("Timeout while waiting for a reply from the bitbake server (60s)")
368 return self.recv.get() 368 ret, exc = self.recv.get()
369 # Should probably turn all exceptions in exc back into exceptions?
370 # For now, at least handle BBHandledException
371 if exc and "BBHandledException" in exc:
372 raise bb.BBHandledException()
373 return ret, exc
369 374
370 def updateFeatureSet(self, featureset): 375 def updateFeatureSet(self, featureset):
371 _, error = self.runCommand(["setFeatures", featureset]) 376 _, error = self.runCommand(["setFeatures", featureset])
diff --git a/bitbake/lib/bb/ui/knotty.py b/bitbake/lib/bb/ui/knotty.py
index a3507afb7c..a91e4fd15c 100644
--- a/bitbake/lib/bb/ui/knotty.py
+++ b/bitbake/lib/bb/ui/knotty.py
@@ -380,14 +380,27 @@ _evt_list = [ "bb.runqueue.runQueueExitWait", "bb.event.LogExecTTY", "logging.Lo
380 "bb.event.BuildBase", "bb.build.TaskStarted", "bb.build.TaskSucceeded", "bb.build.TaskFailedSilent", 380 "bb.event.BuildBase", "bb.build.TaskStarted", "bb.build.TaskSucceeded", "bb.build.TaskFailedSilent",
381 "bb.build.TaskProgress", "bb.event.ProcessStarted", "bb.event.ProcessProgress", "bb.event.ProcessFinished"] 381 "bb.build.TaskProgress", "bb.event.ProcessStarted", "bb.event.ProcessProgress", "bb.event.ProcessFinished"]
382 382
383def drain_events_errorhandling(eventHandler):
384 # We don't have logging setup, we do need to show any events we see before exiting
385 event = True
386 logger = bb.msg.logger_create('bitbake', sys.stdout)
387 while event:
388 event = eventHandler.waitEvent(0)
389 if isinstance(event, logging.LogRecord):
390 logger.handle(event)
391
383def main(server, eventHandler, params, tf = TerminalFilter): 392def main(server, eventHandler, params, tf = TerminalFilter):
384 393
385 if not params.observe_only: 394 try:
386 params.updateToServer(server, os.environ.copy()) 395 if not params.observe_only:
396 params.updateToServer(server, os.environ.copy())
387 397
388 includelogs, loglines, consolelogfile, logconfigfile = _log_settings_from_server(server, params.observe_only) 398 includelogs, loglines, consolelogfile, logconfigfile = _log_settings_from_server(server, params.observe_only)
389 399
390 loglevel, _ = bb.msg.constructLogOptions() 400 loglevel, _ = bb.msg.constructLogOptions()
401 except bb.BBHandledException:
402 drain_events_errorhandling(eventHandler)
403 return 1
391 404
392 if params.options.quiet == 0: 405 if params.options.quiet == 0:
393 console_loglevel = loglevel 406 console_loglevel = loglevel