Closed cstrahan closed 3 months ago
Thanks for reporting. Reproduced in the BSP template project with defmt-rtt
version 0.4.
Both defmt-rtt
and imxrt-log, features = "defmt"
(version 0.1) bring in a defmt global logger. Two global loggers is disallowed, according to the defmt docs:
⚠️ Only a single
#[global_logger]
struct can appear in the dependency graph of an application.
It was a poor call on my part to enable imxrt-log
's "defmt"
feature directly in the BSP. It violates the guidance in the next line:
Therefore the
global_logger
should be selected at the top of the dependency graph, that is in the application crate.
I've effectively turned teensy4-bsp
into an implicit defmt global logger. So this issue affects anyone who tries to bring in any other defmt global logger.
I'm looking for non-breaking ways to fix this, but I haven't found it yet. A proper fix likely requires a new release series of the BSP with changes to the dependency / features. Additionally, I might need to re-think the imxrt-log
common case; "defmt"
is enabled by default.
I'm looking for non-breaking ways to fix this, but I haven't found it yet. A proper fix likely requires a new release series of the BSP with changes to the dependency / features. Additionally, I might need to re-think the imxrt-log common case; "defmt" is enabled by default.
:+1:
Thanks again for all your work on these crates! Where I can, I'll see if I can give back in an some way.
(My apologies if it ever feels like I'm passively lobbing issue reports over the fence -- I'd normally like to take a more active role, but I'm trying to wrap up some projects while I still have my funemployment time, and I figure it's better to at least open an issue (even if hastily written and a little dry) than to hold off until I have more free time, only to probably forget about it after I've implemented some work around :sweat_smile:.)
You're all good! I appreciate these issues; keep them coming.
Additionally, I prioritize issues that enable you to take that active role. Send those thoughts my way, too. I want to make sure you can hit the ground running once you get that free time.
0.5.0 of teensy4-bsp drops the imxrt-log
dependency. Users can depend on imxrt-log
and use its defmt
feature, or they can bring-their-own-defmt
-logger.
Describe the bug
If I have
teensy4-bsp
as a dependency anddefmt_rtt
, I run into the follow linker error:If I make the following change then I can compile successfully:
To Reproduce
Build with both
teensy4-bsp
as a dependency anddefmt_rtt
.Expected behavior
Should compile successfully.
Additional context :thinking: