From 0dd535daeafc28cf05ad4b121651c9470efefd23 Mon Sep 17 00:00:00 2001 From: "L. E. Segovia" Date: Thu, 8 Feb 2024 01:14:54 +0000 Subject: shell/new_call: Fix output streams contents being hidden from the user on error subprocess.check_call, for some reason, does not log appropriately the contents of stdout on error, nor it crashes out when a shell is required. This is the cause of a hidden failure when issuing `ld` to prelink all objects on macOS, because I specified a glob that would be expanded by the shell, and this step never occurs because it's already passed verbatim to `sh`. Part-of: --- cerbero/utils/shell.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cerbero/utils/shell.py b/cerbero/utils/shell.py index 5ad20ce6..2cbf109a 100644 --- a/cerbero/utils/shell.py +++ b/cerbero/utils/shell.py @@ -212,8 +212,8 @@ def new_call(cmd, cmd_dir=None, fail=True, logfile=None, env=None, verbose=False else: stdin = None try: - subprocess.check_call( - cmd, cwd=cmd_dir, env=env, stdout=logfile, stderr=subprocess.STDOUT, stdin=stdin, shell=shell + subprocess.run( + cmd, cwd=cmd_dir, env=env, stdout=logfile, stderr=subprocess.STDOUT, stdin=stdin, shell=shell, check=True ) except SUBPROCESS_EXCEPTIONS as e: returncode = getattr(e, 'returncode', -1) -- cgit v1.2.3