Skip to content

Commit eef85a7

Browse files
authored
Improve logging in swift_build_support/shell.py (#74592)
Currently, when a command fails with this message ``` ERROR: command terminated with a non-zero exit status 1, aborting ``` it's unclear at all which exact command terminated, which makes it very hard to debug issues in the build script.
1 parent e701223 commit eef85a7

File tree

1 file changed

+4
-4
lines changed
  • utils/swift_build_support/swift_build_support

1 file changed

+4
-4
lines changed

utils/swift_build_support/swift_build_support/shell.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -88,8 +88,8 @@ def call(command, stderr=None, env=None, dry_run=None, echo=True):
8888
subprocess.check_call(command, env=_env, stderr=stderr)
8989
except subprocess.CalledProcessError as e:
9090
_fatal_error(
91-
"command terminated with a non-zero exit status " +
92-
str(e.returncode) + ", aborting")
91+
f"command `{command}` terminated with a non-zero exit status "
92+
f"{str(e.returncode)}, aborting")
9393
except OSError as e:
9494
_fatal_error(
9595
"could not execute '" + quote_command(command) +
@@ -138,8 +138,8 @@ def capture(command, stderr=None, env=None, dry_run=None, echo=True,
138138
if optional:
139139
return None
140140
_fatal_error(
141-
"command terminated with a non-zero exit status " +
142-
str(e.returncode) + ", aborting")
141+
f"command `{command}` terminated with a non-zero exit status "
142+
f"{str(e.returncode)}, aborting")
143143
except OSError as e:
144144
if optional:
145145
return None

0 commit comments

Comments
 (0)