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

Most upvoted comments

Then this more serious: as things are defmt 0.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