From ebaa3e3f5140d99ae1d42a69021edda0b6f379e1 Mon Sep 17 00:00:00 2001 From: Richard Purdie Date: Fri, 9 Oct 2020 17:40:44 +0100 Subject: bitbake: tinfoil: When sending commands we need to process events The server may be displaying useful information for the user through log messages so we should display anything that has been sent. Its either this or expecting every UI to implement this code around every command call which isn't good API. [YOCTO #14054] (Bitbake rev: 64ae9d7e2fad804dd9e12706c6d76b4b22f9586b) Signed-off-by: Richard Purdie --- bitbake/lib/bb/tinfoil.py | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'bitbake') diff --git a/bitbake/lib/bb/tinfoil.py b/bitbake/lib/bb/tinfoil.py index 2fb1bb7d27..763c329810 100644 --- a/bitbake/lib/bb/tinfoil.py +++ b/bitbake/lib/bb/tinfoil.py @@ -461,7 +461,16 @@ class Tinfoil: commandline = [command] if params: commandline.extend(params) - result = self.server_connection.connection.runCommand(commandline) + try: + result = self.server_connection.connection.runCommand(commandline) + finally: + while True: + event = self.wait_event() + if not event: + break + if isinstance(event, logging.LogRecord): + if event.taskpid == 0 or event.levelno > logging.INFO: + self.logger.handle(event) if result[1]: raise TinfoilCommandFailed(result[1]) return result[0] -- cgit v1.2.3-54-g00ecf