summaryrefslogtreecommitdiffstats
path: root/bitbake/lib/bb/build.py
diff options
context:
space:
mode:
authorRichard Purdie <richard.purdie@linuxfoundation.org>2012-06-22 12:55:55 +0100
committerRichard Purdie <richard.purdie@linuxfoundation.org>2012-06-25 14:57:16 +0100
commita87aa7b7af4f43d86b4d89f90a9c3b134d12f006 (patch)
tree75e4c166c0818c955a25a7f7d9b361c50065552f /bitbake/lib/bb/build.py
parent15a31a93ba382037786aaf9d8105d8cf10c278c0 (diff)
downloadpoky-a87aa7b7af4f43d86b4d89f90a9c3b134d12f006.tar.gz
bitbake: process: Improve _logged_communicate buffering
There are two problems with the _logged_communicate that are both caused as a result of buffering I/O issues: 1) log truncation when python fails 2) While a bitbake task is running it is impossible to see what is going on if it is only writing a small incremental log that is smaller than the buffer, or you get only a partial log, up until the task exists. It is worse in the case that stderr and stdout are separate file handles, because previous code blocks on the read of stdout and then stderr, serially. The right approach is simply to use select() to determine if there is data available and also flush the log before exiting. This is based on a patch from Jason Wessel <jason.wessel@windriver.com> with some changes to flush upon exit, abstract the non blocking file descriptor setup and drop the buffer size parameter. (Bitbake rev: 361fb71e907aa84c28ecec79fefc6ca39c39172f) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake/lib/bb/build.py')
-rw-r--r--bitbake/lib/bb/build.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/bitbake/lib/bb/build.py b/bitbake/lib/bb/build.py
index 2cb7a9301b..bea2926085 100644
--- a/bitbake/lib/bb/build.py
+++ b/bitbake/lib/bb/build.py
@@ -135,7 +135,8 @@ class LogTee(object):
135 135
136 def __repr__(self): 136 def __repr__(self):
137 return '<LogTee {0}>'.format(self.name) 137 return '<LogTee {0}>'.format(self.name)
138 138 def flush(self):
139 self.outfile.flush()
139 140
140def exec_func(func, d, dirs = None): 141def exec_func(func, d, dirs = None):
141 """Execute an BB 'function'""" 142 """Execute an BB 'function'"""