mirror of
https://git.sr.ht/~kivikakk/niar
synced 2024-12-22 11:52:24 +00:00
cmdrunner: report exit statuses.
This commit is contained in:
parent
6a0c97d1f5
commit
944321f5d9
|
@ -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:
|
||||||
|
|
|
@ -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):
|
||||||
|
|
Loading…
Reference in a new issue