-
Notifications
You must be signed in to change notification settings - Fork 1.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix(cpu-template-helper): Fix error message display #4616
Conversation
The CPU template helper tool showed its error message twice as follows: ``` $cpu-template-helper fingerprint compare --prev A.json --curr B.json Difference detected between source and target:\\n{ "name": "kernel_version", "prev": "5.10.215-203.850.amzn2.x86_64", "curr": "6.1.84-99.169.amzn2023.x86_64" } Error: FingerprintCompare(DiffDetected("{\n \"name\": \"kernel_...")) ``` It is because it returned `Result` from `main()` to return an exit code and it shows its error message on error. Instead just return the exit code using `std::process::exit()`. Signed-off-by: Takahiro Itazuri <itazur@amazon.com>
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #4616 +/- ##
=======================================
Coverage 82.14% 82.14%
=======================================
Files 255 255
Lines 31282 31285 +3
=======================================
+ Hits 25697 25700 +3
Misses 5585 5585
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
04dc7f6
to
31e738a
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think generally in Rust, one should avoid using std::process::exit
(https://stackoverflow.com/questions/39228685/when-is-stdprocessexit-o-k-to-use) because it interferes with dropping and unwinding. I don't think it really matters here, because its the very end of main
, but maybe it's still nice to return ExitCode
instead, just in case?
I really love it. will apply thanks! |
31e738a
to
d891d8c
Compare
`displaydoc::Display` doesn't recognize `\n` as a new line in doc string: ``` Difference detected between source and target: \n{ "name": "kernel_version", "prev": "5.10.215-203.850.amzn2.x86_64", "curr": "6.1.84-99.169.amzn2023.x86_64" } ``` Also, it doesn't support multi-line string unless we use `/** */` style doc, however the doc style is denied by our format check. Signed-off-by: Takahiro Itazuri <itazur@amazon.com>
d891d8c
to
d2f0801
Compare
Changes
Reason
Before
After
License Acceptance
By submitting this pull request, I confirm that my contribution is made under
the terms of the Apache 2.0 license. For more information on following Developer
Certificate of Origin and signing off your commits, please check
CONTRIBUTING.md
.PR Checklist
[ ] If a specific issue led to this PR, this PR closes the issue.[ ] Any required documentation changes (code and docs) are included in thisPR.
[ ] API changes follow the Runbook for Firecracker API changes.[ ] User-facing changes are mentioned inCHANGELOG.md
.[ ] NewTODO
s link to an issue.contribution quality standards.
rust-vmm
.