Skip to content
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

defmt-print: misleading error message on defmt version mismatch #412

Open
japaric opened this issue Feb 24, 2021 · 4 comments
Open

defmt-print: misleading error message on defmt version mismatch #412

japaric opened this issue Feb 24, 2021 · 4 comments
Labels
difficulty: easy Pretty easy to solve priority: medium Medium priority for the Knurling team type: bug Something isn't working

Comments

@japaric
Copy link
Member

japaric commented Feb 24, 2021

the error says to install probe-run instead of defmt-print

@japaric
Copy link
Member Author

japaric commented Feb 24, 2021

$ defmt-print -e target/thumbv7em-none-eabihf/debug/hello
Error: defmt version mismatch: firmware is using 0.2, `probe-run` supports 0.1
suggestion: `cargo install` a different non-git version of `probe-run` that supports defmt 0.2

@Urhengulas Urhengulas added type: bug Something isn't working difficulty: easy Pretty easy to solve priority: medium Medium priority for the Knurling team labels Feb 28, 2021
@Urhengulas
Copy link
Member

I was hoping to get the name of the binary from a cargo env variable during compile time, but none of CARGO_PKG_NAME, CARGO_CRATE_NAME, CARGO_BIN_NAME, CARGO_PRIMARY_PACKAGE seems to yield the name of the binary, but only the name of the library or nothing.

@jonas-schievink
Copy link
Contributor

We can probably solve this by using a strongly-typed error type in defmt_decoder that has a variant that indicates a version mismatch. Then the calling binary can print its own message.

@Urhengulas
Copy link
Member

We can probably solve this by using a strongly-typed error type in defmt_decoder that has a variant that indicates a version mismatch. Then the calling binary can print its own message.

Yes, I also though about this, but then I tried to be smart 😬 😆

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
difficulty: easy Pretty easy to solve priority: medium Medium priority for the Knurling team type: bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants