1
0
Fork 0
mirror of https://git.sr.ht/~kivikakk/niar synced 2024-12-22 06:52:24 +00:00

cmdrunner: report exit statuses.

This commit is contained in:
Asherah Connor 2024-09-27 17:44:19 +10:00
parent 6a0c97d1f5
commit 944321f5d9
2 changed files with 8 additions and 4 deletions

View file

@ -123,13 +123,15 @@ class CommandRunner:
failed = []
for cu, proc in runnables:
if proc is not None and proc.wait() != 0:
failed.append(cu)
if proc is not None:
status = proc.wait()
if status != 0:
failed.append((cu, status))
if failed:
logger.error("the following process(es) failed:")
for cu in failed:
logger.error(f" {formatted(cu)}")
for (cu, status) in failed:
logger.error(f" {formatted(cu)} (status={status})")
raise CommandFailedError(f"failed {step} step")
for cu, _ in runnables:

View file

@ -286,6 +286,8 @@ def main(np: Project, args):
except KeyboardInterrupt:
print(file=sys.stderr)
logger.log(logging.INFO, "aborting on KeyboardInterrupt")
except CommandFailedError:
logger.log(logging.INFO, "aborting on CommandFailedError")
def _make_yosys_relative(path):