Closed darkwater closed 1 week ago
Hi! Thanks for opening your first issue here! :smile:
Hmm, I guess the rust-lld: error: /tmp/rustcf9ZPV3/list:37
may not be related to frb, since imho frb does not change the linking process.
Is it possible that, it is because frb expose extern c methods? If so, maybe ask/search in rust/defmt how they solve this.
Close since this seems to not be related to frb, but feel free to reopen if needed!
Describe the bug
Defmt (deferred formatting) is a logging framework popular in the embedded Rust ecosystem.
In summary, it works by exporting the to-be-logged strings as static symbols, and at runtime sending their addresses (a few bytes) instead of the whole string (many bytes, including work to format parameters).
The resulting binary will contain symbols such as:
I noticed that as soon as I depend on (a crate that depends on) defmt in my Flutter/Rust project, running fails with:
Looking at the mentioned
list
file:This is probably not exclusive to defmt, but will happen to any project that exports "weird" symbol names.
Steps to reproduce
Add a dependency on
defmt
, then call:This should cause a symbol with a JSON name to be exported:
Logs
Expected behavior
The symbol names should be sanitized in such a way that special symbols don't break the build.
Generated binding code
No response
OS
Arch Linux
Version of
flutter_rust_bridge_codegen
2.0.0-dev.35
Flutter info
Version of
clang++
18.1.8
Additional context
No response