knurling-rs / defmt

Efficient, deferred formatting for logging on embedded systems
https://defmt.ferrous-systems.com/
Apache License 2.0
750 stars 69 forks source link

Use the more naive crate name to support renaming #835

Closed diondokter closed 1 month ago

diondokter commented 1 month ago

Fixes #834

::defmt points to the crate called defmt. This is nice to use because it avoids bad renames. One example I saw was use mini_serde as serde.

However, people have started renaming the crate in their own crates. Notably, embedded-hal does this which renames it defmt-03. With the inclusion of defmt in these kinds of foundational crates, they will want to be able to support multiple defmt versions at the same time and they kinda need the renaming. (I don't see another way to do it)

Previously before #800 this all worked, but this PR changed it from defmt to ::defmt which breaks code. (And defmt released this as a minor update, so everyone who does cargo update will get this).

This PR simply reverts that. Also note that ::defmt isn't even used everywhere. It was a mix. With this PR it's all the same (as far as I can see).

diondokter commented 1 month ago

Btw, I suggest merging this an immediately publishing it as version 0.3.8 since the last version breaks a lot of codebases. Some of them will be trivial to fix, but others not.

Urhengulas commented 1 month ago

@diondokter do you think we should yank 0.3.7?

diondokter commented 1 month ago

@diondokter do you think we should yank 0.3.7?

Probably yes. It is breaking peoples builds, but not all builds. It's not necessarily your fault, but only your yank will fix it sadly

Urhengulas commented 1 month ago

@diondokter I've released defmt-macros v0.3.9 and yanked v0.3.8. Can you test if that un-breaks the builds?

diondokter commented 1 month ago

@Urhengulas seems to compile on my end! Thanks for the fast response :)