Allow skipping the defmt version check#296
Conversation
|
|
||
| /// Like `parse`, but does not verify that the defmt version in the firmware matches the host. | ||
| /// | ||
| /// Use with caution, this is meant for defmt/probe-run development only. |
There was a problem hiding this comment.
nitpick: I'd put this at the top of the docs so it can't be overseen. plus the --ignore-version-mismatchprobe-run flag should get a "CAUTION: .." doc too?
| }; | ||
|
|
||
| defmt_decoder::check_version(version).map_err(anyhow::Error::msg)?; | ||
| if check_version { |
There was a problem hiding this comment.
personally, I'd rather pull this out of parse_impl() and move it into parse() right before the call to parse_impl(). That way we can avoid having a flag argument* as well as tight coupling between the parsing and defmt consistency check, which imo are two different tasks.
* the function names of parse_ignore_version() and parse() imo already communicate what's happening better than parse(.. , true) does
There was a problem hiding this comment.
Doing the version check requires some amount of processing to get the version, so I'd have to duplicate that into the caller.
tight coupling between the parsing and defmt consistency check, which imo are two different tasks.
There is some amount of intentional coupling between them, for example, we always check that there's only one version in use, and we check for the existence of the .defmt section and the version symbol to determine whether defmt is in use at all, or the linker script is broken.
This PR is only intended to skip the version check, not any of the other consistency checks.
There was a problem hiding this comment.
hrm , ok then that's maybe one for future refactoring sessions...
If we add a
--ignore-version-mismatchflag to probe-run, this will make development a bit easier.