-
-
Notifications
You must be signed in to change notification settings - Fork 85
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
Allow skipping the defmt version check #296
Conversation
elf2table/src/lib.rs
Outdated
|
||
/// 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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nitpick: I'd put this at the top of the docs so it can't be overseen. plus the --ignore-version-mismatch
probe-run flag should get a "CAUTION: .." doc too?
@@ -75,7 +86,9 @@ pub fn parse(elf: &[u8]) -> Result<Option<Table>, anyhow::Error> { | |||
} | |||
}; | |||
|
|||
defmt_decoder::check_version(version).map_err(anyhow::Error::msg)?; | |||
if check_version { |
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.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
hrm , ok then that's maybe one for future refactoring sessions...
If we add a
--ignore-version-mismatch
flag to probe-run, this will make development a bit easier.