Skip to content

Commit

Permalink
cmdrunner: report exit statuses.
Browse files Browse the repository at this point in the history
  • Loading branch information
kivikakk committed Sep 27, 2024
1 parent 6a0c97d commit 944321f
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
10 changes: 6 additions & 4 deletions niar/cmdrunner.py
Original file line number Diff line number Diff line change
Expand Up @@ -123,13 +123,15 @@ def run_cus(self, cus, step):

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:
Expand Down
2 changes: 2 additions & 0 deletions niar/cxxrtl.py
Original file line number Diff line number Diff line change
Expand Up @@ -286,6 +286,8 @@ def rtlil_to_cc():
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):
Expand Down

0 comments on commit 944321f

Please sign in to comment.