fix: report the command output when run_cmd fails - #266
Merged
hcallahan-lowrisc merged 1 commit intoSep 23, 2026
Merged
Conversation
martin-velay
marked this pull request as ready for review
September 23, 2026 13:55
hcallahan-lowrisc
approved these changes
Sep 23, 2026
hcallahan-lowrisc
left a comment
Contributor
There was a problem hiding this comment.
I think this is fine, but there might be a small improvement possible to dump the stdout/stderr to a file and then just tail the output into the terminal. It's possible the stdout of the failing command could be very long, so dumping all of that at once might not be ideal.
But I'm happy to come back to that as a future improvement if it proves to be inconvenient.
Signed-off-by: Martin Velay <mvelay@lowrisc.org>
martin-velay
force-pushed
the
report_failed_command_output
branch
from
September 23, 2026 16:30
f5587b8 to
f74b557
Compare
Contributor
Author
|
Good point @hcallahan-lowrisc, I have made the change, if you're happy with it you can just press the merge button |
Contributor
|
That looks good to me, thanks @martin-velay |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
run_cmdthrows away a failing command's output and exits with its status, so a command that fails inside wildcard expansion takes the whole run down without printing anything about why.subprocess.getstatusoutputfolds stderr into its output, so that value is the only place the command's diagnostic exists. Discarding it means the message the flow author wrote for exactly this situation never reaches the terminal.This bites any config that guards a tool behind
${VAR:?message}in an{eval_cmd}, which is the natural way to say "this flow needs VERILATOR set". Peppermint'sverilator.hjsondoes it twice, forVERILATORandUVM_HOME. With either unset, the whole output of a run is:and an exit status of 127.
--verboseadds nothing, because the message was dropped before any logging happened. Someone who forgets an export gets a silent failure and no way to find out what is missing.With this change the same run prints:
The exit status is unchanged, so nothing downstream of the failure behaves differently.
Validation
ruff format --check src testsandruff check --config=ruff-ci.toml src testspass.pyright --pythonpath .venv/bin/python src/dvsim/utils/subprocess.pyreports no new error. The one it does report, at line 80 inrun_cmd_with_timeout, reproduces with this change stashed.pytest --strict -q tests/gives 426 passed. The four failures intests/utils/test_git.pyare the pre-existing ones in this workspace and fail identically on master.tests/utils/test_subprocess.pyis new and covers three cases: output returned on success, status and diagnostic both logged on failure, and no stray empty line when the command failed without saying anything.