defmt: defmt crate doesn't compile on macOS
Updated description: defmt 0.1.3 compiles on macOS but the git version (0.2.0) doesn’t repro:
$ cargo new --bin hello
$ cd hello
$ cargo add defmt --vers 0.1.3
$ cargo run
$ # ^ doesn't work if you use the git version
When trying to get started to write compile fail tests , running
$ cargo test --test ui
didn’t work for me using a mac. I’d always get this unhelpful error:
LLVM ERROR: Global variable '{"package":"defmt","tag":"defmt_prim","data":"{=i8}","disambiguator":"2773326613612971761"}' has an invalid section specifier '.defmt.prim.{"package":"defmt","tag":"defmt_prim","data":"{=i8}","disambiguator":"2773326613612971761"}': mach-o section specifier requires a segment whose length is between 1 and 16 characters.
error: could not compile `defmt`
Passing more flags like this did help:
$ cargo test -p defmt --all-features --test ui
This makes sense when looking at ci.yml
About this issue
- Original URL
- State: closed
- Created 3 years ago
- Comments: 18 (18 by maintainers)
Commits related to this issue
- fix issue #336 — committed to knurling-rs/defmt by deleted user 3 years ago
- Merge #357 357: fix issue #336 r=jonas-schievink a=spookyvision Introduce special cased symbol names to satisfy the macos linker Co-authored-by: Anatol Ulrich <anatol.ulrich@ferrous-systems.com> — committed to knurling-rs/defmt by bors[bot] 3 years ago
- Merge #363 363: add a test for #336 r=jonas-schievink a=spookyvision make sure basic usage builds & links, as suggested [here](https://github.com/knurling-rs/defmt/issues/336#issuecomment-761094732)... — committed to knurling-rs/defmt by bors[bot] 3 years ago
Yup!
Then this more serious: as things are
defmt0.2 won’t compile on macOS which is going to hinder adoption: using defmt in a no-std, non-embedded crate would make the crate unusable on macOS.I’ll put this on the list of blockers for 0.2.0. cc @jonas-schievink