Skip to content

qemu-run: print QEMU command before execution#1035

Open
robamu wants to merge 2 commits intoknurling-rs:mainfrom
robamu:qemu-print-command
Open

qemu-run: print QEMU command before execution#1035
robamu wants to merge 2 commits intoknurling-rs:mainfrom
robamu:qemu-print-command

Conversation

@robamu
Copy link
Copy Markdown

@robamu robamu commented Feb 2, 2026

this prints the full QEMU command before executing it

@robamu robamu changed the title print QEMU command qemu-run: print QEMU command before execution Feb 2, 2026
@jonathanpallant
Copy link
Copy Markdown
Contributor

qemu-run is used for snapshot tests (checking stdout against reference files) for defmt, so changing the output is difficult....

@jonathanpallant
Copy link
Copy Markdown
Contributor

You could put it behind an optional -v (for verbose) flag?

@robamu
Copy link
Copy Markdown
Author

robamu commented Feb 27, 2026

oh, is it specifying verbose for the snapshot tests as well?

@robamu
Copy link
Copy Markdown
Author

robamu commented Feb 27, 2026

I am confused. why does it still fail? The printout is behind the verbose option now.

Comment thread qemu-run/src/main.rs
command.stdout(Stdio::piped());

if opts.verbose {
println!("Running QEMU command: {}", pretty(&command));
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Printing it to stderr instead of stdout is one option to fix the snapshot test failure. This way you could also always print it and not just in verbose mode.

Suggested change
println!("Running QEMU command: {}", pretty(&command));
eprintln!("Running QEMU command: {}", pretty(&command));

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The snapshot tests only care about stdout, not stderr

@jonathanpallant
Copy link
Copy Markdown
Contributor

The tests are run with --verbose enabled...

runner = "cargo -q run --manifest-path ../../qemu-run/Cargo.toml -- --machine lm3s6965evb --verbose"

@Urhengulas
Copy link
Copy Markdown
Member

The tests are run with --verbose enabled...

runner = "cargo -q run --manifest-path ../../qemu-run/Cargo.toml -- --machine lm3s6965evb --verbose"

But that does not matter since the tests only care about stdout and not stderr

@robamu
Copy link
Copy Markdown
Author

robamu commented Mar 11, 2026

ah okay. just did not find it. maybe removing --verbose is the cleaner solution here for the runner?

@robamu robamu force-pushed the qemu-print-command branch from d3962ae to 02e1a71 Compare March 11, 2026 12:52
@robamu robamu requested a review from Urhengulas March 12, 2026 17:22
Copy link
Copy Markdown
Member

@Urhengulas Urhengulas left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The changes look good to me, but someone still needs to fix the carg-deny failure and then rebase this PR on top of it.

Comment thread CHANGELOG.md
### [qemu-run-next]

* No changes
* Specifying the `--verbose` / `-v` option now also prints the actual QEMU command being run.
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please link the PR number here like in the section below.
Don't forget to add the actual link to the list at the bottom too 😉

@knoellle
Copy link
Copy Markdown
Member

The changes look good to me, but someone still needs to fix the carg-deny failure and then rebase this PR on top of it.

This should be done since #1041 was merged. Just need to rebase.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants