diff options
Diffstat (limited to 'bitbake/lib/bb')
-rw-r--r-- | bitbake/lib/bb/build.py | 8 | ||||
-rw-r--r-- | bitbake/lib/bb/event.py | 1 | ||||
-rw-r--r-- | bitbake/lib/bb/msg.py | 4 | ||||
-rw-r--r-- | bitbake/lib/bb/runqueue.py | 2 |
4 files changed, 12 insertions, 3 deletions
diff --git a/bitbake/lib/bb/build.py b/bitbake/lib/bb/build.py index 77af92abee..f49b2836b6 100644 --- a/bitbake/lib/bb/build.py +++ b/bitbake/lib/bb/build.py @@ -152,6 +152,9 @@ def exec_func(func, d, dirs = None): os.dup2(so.fileno(), oso[1]) os.dup2(se.fileno(), ose[1]) + # Since we've remapped stdout and stderr, its safe for log messages to be printed there now + # exec_func can nest so we have to save state + origstdout = bb.event.useStdout bb.event.useStdout = True locks = [] @@ -179,7 +182,10 @@ def exec_func(func, d, dirs = None): for lock in locks: bb.utils.unlockfile(lock) - bb.event.useStdout = False + sys.stdout.flush() + sys.stderr.flush() + + bb.event.useStdout = origstdout # Restore the backup fds os.dup2(osi[0], osi[1]) diff --git a/bitbake/lib/bb/event.py b/bitbake/lib/bb/event.py index f5ba6eab3c..45458c2d63 100644 --- a/bitbake/lib/bb/event.py +++ b/bitbake/lib/bb/event.py @@ -110,6 +110,7 @@ def fire_from_worker(event, d): if not event.startswith("<event>") or not event.endswith("</event>"): print("Error, not an event %s" % event) return + #print "Got event %s" % event event = pickle.loads(event[7:-8]) fire_ui_handlers(event, d) diff --git a/bitbake/lib/bb/msg.py b/bitbake/lib/bb/msg.py index 5bb30e8dd3..21692d930d 100644 --- a/bitbake/lib/bb/msg.py +++ b/bitbake/lib/bb/msg.py @@ -133,7 +133,9 @@ def error(msgdomain, msg, fn = None): def fatal(msgdomain, msg, fn = None): bb.event.fire(MsgFatal(msg), None) - print('FATAL: %s' % (msg)) + + if bb.event.useStdout: + print('FATAL: %s' % (msg)) sys.exit(1) def plain(msg, fn = None): diff --git a/bitbake/lib/bb/runqueue.py b/bitbake/lib/bb/runqueue.py index 67f265bc80..ef5256f14c 100644 --- a/bitbake/lib/bb/runqueue.py +++ b/bitbake/lib/bb/runqueue.py @@ -1467,5 +1467,5 @@ class runQueuePipe(): while self.read(): continue if len(self.queue) > 0: - print("Warning, worker left partial message") + print("Warning, worker left partial message: %s" % self.queue) self.fd.close() |