From 7bb67d062aff55d580a5f4204f4c3124f6ce5f75 Mon Sep 17 00:00:00 2001 From: Jan Lindemann Date: Tue, 26 Dec 2017 22:27:25 +0000 Subject: [PATCH] build.py: Change hung invocation to subprocess.Popen() Pass an array to Popen(), shell=False, close_fds=True, stderr=None, this fixes a hung zombie child. Signed-off-by: Jan Lindemann --- scripts/build.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/scripts/build.py b/scripts/build.py index 6c00d5a7..3e1f5d01 100644 --- a/scripts/build.py +++ b/scripts/build.py @@ -122,7 +122,8 @@ def calculate_order(order, modules, prereq_types): def run_make(module, target): global cur_project cur_project=cur_project+1 - make_cmd = "make " + target + " 2>&1" + #make_cmd = "make " + target + " 2>&1" + make_cmd = [ "make", target ] path = find_proj_path_cached(module) delim_len=120 delim='---- %d/%d: running %s in %s -' % (cur_project, len(order), make_cmd, path) @@ -130,7 +131,7 @@ def run_make(module, target): print(',' + delim + ' >') os.chdir(path) - p = subprocess.Popen(make_cmd, shell=True, stdout=subprocess.PIPE) + p = subprocess.Popen(make_cmd, shell=False, stdout=subprocess.PIPE, stderr=None, close_fds=True) for line in iter(p.stdout.readline, ''): sys.stdout.write('| ' + line) # avoid extra newlines from print() sys.stdout.flush()