From 8a99cdb45fc522fa5a279377f4575358add60d89 Mon Sep 17 00:00:00 2001 From: gzyang Date: Thu, 17 Jun 2021 10:57:20 +0800 Subject: [PATCH] deadlock bugfix caused by stderr buffer blocking --- hb/__init__.py | 2 +- hb/common/utils.py | 10 +--------- 2 files changed, 2 insertions(+), 10 deletions(-) diff --git a/hb/__init__.py b/hb/__init__.py index 345a8f4..511901f 100755 --- a/hb/__init__.py +++ b/hb/__init__.py @@ -42,4 +42,4 @@ CONFIG_STRUCT = { "device_path": None, "patch_cache": None } -VERSION = '0.4.0' +VERSION = '0.4.1' diff --git a/hb/common/utils.py b/hb/common/utils.py index 029ef78..5a7bed3 100755 --- a/hb/common/utils.py +++ b/hb/common/utils.py @@ -94,7 +94,7 @@ def exec_command(cmd, log_path='out/build.log', **kwargs): with open(log_path, 'at', encoding='utf-8') as log_file: process = subprocess.Popen(cmd, stdout=subprocess.PIPE, - stderr=subprocess.PIPE, + stderr=subprocess.STDOUT, encoding='utf-8', **kwargs) for line in iter(process.stdout.readline, ''): @@ -110,14 +110,6 @@ def exec_command(cmd, log_path='out/build.log', **kwargs): ret_code = process.returncode if ret_code != 0: - with open(log_path, 'at', encoding='utf-8') as log_file: - for line in iter(process.stderr.readline, ''): - if 'ninja: warning' in line: - log_file.write(line) - continue - hb_error(line) - log_file.write(line) - if is_log_filter: get_failed_log(log_path) -- GitLab