From 7d4778038a0f2bfa9639ee2bb773677c219e8e65 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 | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/cerbero/utils/shell.py b/cerbero/utils/shell.py index ff0729d5..8e415970 100644 --- a/cerbero/utils/shell.py +++ b/cerbero/utils/shell.py @@ -198,9 +198,9 @@ 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) + subprocess.run( + cmd, cwd=cmd_dir, env=env, stdout=logfile, stderr=subprocess.STDOUT, stdin=stdin, check=True + ) except SUBPROCESS_EXCEPTIONS as e: returncode = getattr(e, 'returncode', -1) if not fail: -- cgit v1.2.3