1
0
Fork 0
mirror of https://git.sr.ht/~kivikakk/niar synced 2024-12-22 17:02:25 +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 = [] failed = []
for cu, proc in runnables: for cu, proc in runnables:
if proc is not None and proc.wait() != 0: if proc is not None:
failed.append(cu) status = proc.wait()
if status != 0:
failed.append((cu, status))
if failed: if failed:
logger.error("the following process(es) failed:") logger.error("the following process(es) failed:")
for cu in failed: for (cu, status) in failed:
logger.error(f" {formatted(cu)}") logger.error(f" {formatted(cu)} (status={status})")
raise CommandFailedError(f"failed {step} step") raise CommandFailedError(f"failed {step} step")
for cu, _ in runnables: for cu, _ in runnables:

View file

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