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

Bump defmt from 0.2.1 to 0.3 #249

Closed
wants to merge 1 commit into from

Conversation

henrikssn
Copy link

No description provided.

@korken89
Copy link
Contributor

Hi, this is a breaking change - can 0.2 and 0.3 be implemented in parallel instead?

@henrikssn
Copy link
Author

Hi, this is a breaking change - can 0.2 and 0.3 be implemented in parallel instead?

I already checked the code in this repo and none of it is affected by the v0.3 changes. You can see them here: https://defmt.ferrous-systems.com/migration-02-03.html

@korken89
Copy link
Contributor

Users of this library that are still using 0.2 would see breakage, hence it is a breaking change.

@henrikssn
Copy link
Author

Users of this library that are still using 0.2 would see breakage, hence it is a breaking change.

I'm not really sure how this could be achieved since dependencies can only be specified once IIUC (so we can't have a defmt-03 feature in addition to the existing defmt-impl feature).

What would you propose?

@korken89
Copy link
Contributor

One can rename the versions of the crate, e.g. defmt v0.2 as defmt02 as described here: https://doc.rust-lang.org/cargo/reference/specifying-dependencies.html#renaming-dependencies-in-cargotoml
This should work out fine.

@korken89
Copy link
Contributor

I'm testing here: https://github.com/japaric/heapless/tree/dual-defmt
For some reason this does not work, but we use the same trick in cortex-m-rtic for multiple cortex-m dependencies: https://github.com/rtic-rs/cortex-m-rtic/blob/v0.5.x/Cargo.toml#L63

Not sure what's wrong...

@korken89
Copy link
Contributor

I made a cargo issue, lets see what they say rust-lang/cargo#10066

@korken89
Copy link
Contributor

I think it is a defmt bug: knurling-rs/defmt#625

@korken89
Copy link
Contributor

In the end it's a cargo bug: rust-lang/cargo#5969

@korken89
Copy link
Contributor

We could say in the documentation that the defmt-impl flag enables the "latest" defmt release instead of a specific version.
This would allow us to update defmt in patch releases while it's still quite unstable.

@korken89
Copy link
Contributor

Another idea that I lifted in the defmt issue, use a version range:

[dependencies.defmt]
version = ">=0.2,<0.4"
optional = true

Seems to work, but I'm not sure of unintended consequences.

@korken89
Copy link
Contributor

I fixed a PR for the version range: #251

@korken89 korken89 closed this Nov 11, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants