build.py: Now flushing stdout in make every now and then to avoid pipe filling up

Signed-off-by: Jan Lindemann <jan@janware.com>
This commit is contained in:
Jan Lindemann 2016-09-16 13:34:00 +00:00
commit 8a73ad22ab

View file

@ -100,10 +100,10 @@ def run_make(module, target):
print(',---------- running ' + make_cmd + ' in ' + path + ' -------------------------- >')
os.chdir(path)
p = subprocess.Popen(make_cmd, shell=True, stdout=subprocess.PIPE)
p.wait()
for line in iter(p.stdout.readline,''):
for line in iter(p.stdout.readline, ''):
sys.stdout.write('| ' + line) # avoid extra newlines from print()
sys.stdout.flush()
sys.stdout.flush()
p.wait()
print('`---------- running ' + make_cmd + ' in ' + path + ' -------------------------- <')
if p.returncode:
print(make_cmd + ' failed')