-
-
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
It's impossible to support multiple versions of defmt in a crate #426
Comments
Note that this has the side effect that, given this dependency tree:
e.g. |
Found the upstream issue that's causing this bug: rust-lang/cargo#7880 |
Have you considered excluding the wire format from the semver guarantees? Minor bumps like 0.2.2 -> 0.2.3 would be guaranteed to keep API compatibility (so existing code will still compile), but are allowed to do breaking changes to the wire format. Probe-run could support decoding many wire format versions at once (for example by depending on multiple defmt-decoder versions). Doing a minor defmt upgrade would cause the user to get prompted to upgrade probe-run, but no other breakage should happen. This would allow defmt to evolve faster without splitting the ecosystem. API breaking changes should be very rare. Also you guys mentioned that extending the format string is a breaking change. Why is that? Is it due to old decoders now being unable to decode the stream? If so, that'd be solved by this too. Extending the format string would break wire format but not API. |
Yeah, but this was mostly solved in 0.2 by allowing us to at least extend/change the display hint syntax (if the decoder doesn't understand a hint it just ignores it) |
Adding a new data type |
Yup, that's still breaking. However I'm not sure how versioning the wire format separately would solve this, unless you also version all the ELF metadata separately and duplicate the decoder for each version. |
When a new wire format version is released, this'd happen:
To avoid infinite bloat in |
Yeah, that does sound reasonable |
In that case, |
Yep. This is the main big downside to this approach. This is already the case with the "latest stable only" MSRV , isn't it?. If a new stable rust is released, a minor defmt release would be allowed to start requiring it, so a
yep |
I just discovered #287 which seems to be related to the discussion |
35: Make `defmt` support opt-in r=jonas-schievink a=jonas-schievink `defmt` is still evolving and making breaking changes, and it currently doesn't allow supporting multiple versions of it (knurling-rs/defmt#426). By making it opt-in and leaving its version unspecified, it should not stand in the way of bxcan 1.0 anymore. 36: Remove `Can::configure` r=jonas-schievink a=jonas-schievink Closes #31 Co-authored-by: Jonas Schievink <jonasschievink@gmail.com>
540: Separate "crate version" from "wire format version" r=jonas-schievink a=Dirbaio Depends on #539. Fixes #287. This decouples the "wire format version" from the crate version (Cargo package version or git commit). Wire format version can now be bumped independently. This alleviates pains listed in #539., and more importantly it will allow making breaking changes to the wire format in a semver-minor `defmt` crate release. See #426. Version is `3` to be able to retroactively number `0.1.x = 1, 0.2.x = 2`. A followup PR will add support to `defmt-decoder` to decode both version 2 and 3 concurrently. Co-authored-by: Dario Nieuwenhuis <dirbaio@dirbaio.net> Co-authored-by: Jonas Schievink <jonasschievink@gmail.com>
@korken89 said in #625 (comment):
|
If you do this:
it results in Cargo complaining:
This is because defmt makes use of the
links
key in Cargo.toml to prevent linking multiple versions of it into the same executable. It looks like Cargo handles this very poorly and demands that even optional dependencies don't use the samelinks
directive (we should probably check if this is a Cargo bug).The text was updated successfully, but these errors were encountered: