Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Documentation on how raw data is to be decoded and printed #881

Open
ColinTimBarndt opened this issue Nov 1, 2024 · 1 comment
Open

Comments

@ColinTimBarndt
Copy link

It would be awesome if it was possible to use defmt on the web in WebAssembly modules. This would avoid bloating the module with formatting logic and sending strings from WASM to JS since it involves re-encoding the string from UTF8 to UTF16. Using defmt, the actual formatting could for example only be loaded when needed.

I'd like to know what I'd need to do if I wanted to implement codegen that extracts the formatting information from the WASM module before stripping it and generates JS code which decodes and prints the messages. I couldn't find any documentation on this except for the code itself.

@jonathanpallant
Copy link
Contributor

defmt is aimed at microcontrollers, and so the format strings are interned into symbol names. A small log frame which refers to the IDs of interned strings is then logged. This is all described in https://defmt.ferrous-systems.com/design.

We don't currently support any other interning mechanisms, and we don't have any documentation about implementing such alternative interning mechanisms because currently the design of defmt is very closely tied to how our interning mechanism works.

After some brief experiments, it appears that our current interning mechanism does not work with webassembly:

$ cat Cargo.toml
[package]
name = "hello"
version = "0.1.0"
edition = "2021"

[dependencies]
defmt = "0.3.8"
$ cat src/main.rs
fn main() {
    println!("Hello, world!");
    defmt::println!("Hello from defmt!");
}
$ cargo build --target wasm32-wasip2 --release
   Compiling hello v0.1.0 (/Users/jonathan/Documents/wasm-defmt/hello)
error: linking with `wasm-component-ld` failed: exit status: 1
  |
  = note: LC_ALL="C" PATH="/Users/jonathan/.rustup/toolchains/stable-aarch64-apple-darwin/lib/rustlib/aarch64-apple-darwin/bin:/Users/jonathan/.rustup/toolchains/stable-aarch64-apple-darwin/lib/rustlib/aarch64-apple-darwin/bin/self-contained:/Users/jonathan/.rustup/toolchains/stable-aarch64-apple-darwin/lib/rustlib/aarch64-apple-darwin/bin:/Users/jonathan/.rustup/toolchains/stable-aarch64-apple-darwin/lib/rustlib/aarch64-apple-darwin/bin/self-contained:/Users/jonathan/.rustup/toolchains/stable-aarch64-apple-darwin/lib/rustlib/aarch64-apple-darwin/bin:/Users/jonathan/.rustup/toolchains/stable-aarch64-apple-darwin/lib/rustlib/aarch64-apple-darwin/bin/self-contained:/bin:/opt/homebrew/bin:/opt/homebrew/sbin:/usr/local/bin:/System/Cryptexes/App/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/local/bin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/bin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/appleinternal/bin:/opt/X11/bin:/Library/Apple/usr/bin:/Library/TeX/texbin:/Users/jonathan/.cargo/bin:/Applications/iTerm.app/Contents/Resources/utilities:/Users/jonathan/.local/bin" VSLANG="1033" "wasm-component-ld" "-flavor" "wasm" "--export" "__main_void" "--export" "{\"package\":\"hello\",\"tag\":\"defmt_println\",\"data\":\"Hello from defmt!\",\"disambiguator\":\"16467921067490629269\",\"crate_name\":\"hello\"}" "--export" "cabi_realloc" "--export" "__defmt_default_panic" "--export" "__defmt_default_timestamp" "--export" "_defmt_encoding_ = rzcobs" "--export" "_defmt_version_ = 4" "--export" "{\"package\":\"defmt\",\"tag\":\"defmt_prim\",\"data\":\"()\",\"disambiguator\":\"6735396410974573331\",\"crate_name\":\"defmt\"}" "--export" "{\"package\":\"defmt\",\"tag\":\"defmt_prim\",\"data\":\"({=?})\",\"disambiguator\":\"15728198772600714276\",\"crate_name\":\"defmt\"}" "--export" "{\"package\":\"defmt\",\"tag\":\"defmt_prim\",\"data\":\"({=?}, {=?})\",\"disambiguator\":\"12933750404314707166\",\"crate_name\":\"defmt\"}" "--export" "{\"package\":\"defmt\",\"tag\":\"defmt_prim\",\"data\":\"({=?}, {=?}, {=?})\",\"disambiguator\":\"11613261463523945044\",\"crate_name\":\"defmt\"}" "--export" "{\"package\":\"defmt\",\"tag\":\"defmt_prim\",\"data\":\"({=?}, {=?}, {=?}, {=?})\",\"disambiguator\":\"17960088679281882826\",\"crate_name\":\"defmt\"}" "--export" "{\"package\":\"defmt\",\"tag\":\"defmt_prim\",\"data\":\"({=?}, {=?}, {=?}, {=?}, {=?})\",\"disambiguator\":\"6267787481328300805\",\"crate_name\":\"defmt\"}" "--export" "{\"package\":\"defmt\",\"tag\":\"defmt_prim\",\"data\":\"({=?}, {=?}, {=?}, {=?}, {=?}, {=?})\",\"disambiguator\":\"8715764516236238113\",\"crate_name\":\"defmt\"}" "--export" "{\"package\":\"defmt\",\"tag\":\"defmt_prim\",\"data\":\"({=?}, {=?}, {=?}, {=?}, {=?}, {=?}, {=?})\",\"disambiguator\":\"2836467147338732145\",\"crate_name\":\"defmt\"}" "--export" "{\"package\":\"defmt\",\"tag\":\"defmt_prim\",\"data\":\"({=?}, {=?}, {=?}, {=?}, {=?}, {=?}, {=?}, {=?})\",\"disambiguator\":\"4854903381569787454\",\"crate_name\":\"defmt\"}" "--export" "{\"package\":\"defmt\",\"tag\":\"defmt_prim\",\"data\":\"({=?}, {=?}, {=?}, {=?}, {=?}, {=?}, {=?}, {=?}, {=?})\",\"disambiguator\":\"6483310249039821336\",\"crate_name\":\"defmt\"}" "--export" "{\"package\":\"defmt\",\"tag\":\"defmt_prim\",\"data\":\"({=?}, {=?}, {=?}, {=?}, {=?}, {=?}, {=?}, {=?}, {=?}, {=?})\",\"disambiguator\":\"13695563564738155167\",\"crate_name\":\"defmt\"}" "--export" "{\"package\":\"defmt\",\"tag\":\"defmt_prim\",\"data\":\"({=?}, {=?}, {=?}, {=?}, {=?}, {=?}, {=?}, {=?}, {=?}, {=?}, {=?})\",\"disambiguator\":\"13203872826742354712\",\"crate_name\":\"defmt\"}" "--export" "{\"package\":\"defmt\",\"tag\":\"defmt_prim\",\"data\":\"({=?}, {=?}, {=?}, {=?}, {=?}, {=?}, {=?}, {=?}, {=?}, {=?}, {=?}, {=?})\",\"disambiguator\":\"16933471155134424131\",\"crate_name\":\"defmt\"}" "--export" "{\"package\":\"defmt\",\"tag\":\"defmt_prim\",\"data\":\"Err({=?})|Ok({=?})\",\"disambiguator\":\"10567951801229546774\",\"crate_name\":\"defmt\"}" "--export" "{\"package\":\"defmt\",\"tag\":\"defmt_prim\",\"data\":\"None|Some({=?})\",\"disambiguator\":\"2364202503452621907\",\"crate_name\":\"defmt\"}" "--export" "{\"package\":\"defmt\",\"tag\":\"defmt_prim\",\"data\":\"PhantomData\",\"disambiguator\":\"8562129980497544362\",\"crate_name\":\"defmt\"}" "--export" "{\"package\":\"defmt\",\"tag\":\"defmt_prim\",\"data\":\"RefCell {{ value: <borrowed> }}|RefCell {{ value: {=?} }}\",\"disambiguator\":\"4718006795618006234\",\"crate_name\":\"defmt\"}" "--export" "{\"package\":\"defmt\",\"tag\":\"defmt_prim\",\"data\":\"Unwrap of a None option value\",\"disambiguator\":\"11889740779923244090\",\"crate_name\":\"defmt\"}" "--export" "{\"package\":\"defmt\",\"tag\":\"defmt_prim\",\"data\":\"{=[?;0]}\",\"disambiguator\":\"1496926068162433418\",\"crate_name\":\"defmt\"}" "--export" "{\"package\":\"defmt\",\"tag\":\"defmt_prim\",\"data\":\"{=[?;1000000000]}\",\"disambiguator\":\"9919605185678442186\",\"crate_name\":\"defmt\"}" "--export" "{\"package\":\"defmt\",\"tag\":\"defmt_prim\",\"data\":\"{=[?;100000000]}\",\"disambiguator\":\"5751084995603110578\",\"crate_name\":\"defmt\"}" "--export" "{\"package\":\"defmt\",\"tag\":\"defmt_prim\",\"data\":\"{=[?;10000000]}\",\"disambiguator\":\"8114596719213637696\",\"crate_name\":\"defmt\"}" "--export" "{\"package\":\"defmt\",\"tag\":\"defmt_prim\",\"data\":\"{=[?;1000000]}\",\"disambiguator\":\"4423637971177169123\",\"crate_name\":\"defmt\"}" "--export" "{\"package\":\"defmt\",\"tag\":\"defmt_prim\",\"data\":\"{=[?;100000]}\",\"disambiguator\":\"14877603488862068310\",\"crate_name\":\"defmt\"}" "--export" "{\"package\":\"defmt\",\"tag\":\"defmt_prim\",\"data\":\"{=[?;10000]}\",\"disambiguator\":\"12130802859299284489\",\"crate_name\":\"defmt\"}" "--export" "{\"package\":\"defmt\",\"tag\":\"defmt_prim\",\"data\":\"{=[?;1000]}\",\"disambiguator\":\"3253278821073730227\",\"crate_name\":\"defmt\"}" "--export" "{\"package\":\"defmt\",\"tag\":\"defmt_prim\",\"data\":\"{=[?;100]}\",\"disambiguator\":\"17182836879864056874\",\"crate_name\":\"defmt\"}" "--export" "{\"package\":\"defmt\",\"tag\":\"defmt_prim\",\"data\":\"{=[?;1024]}\",\"disambiguator\":\"16557899516492068629\",\"crate_name\":\"defmt\"}" "--export" "{\"package\":\"defmt\",\"tag\":\"defmt_prim\",\"data\":\"{=[?;1048576]}\",\"disambiguator\":\"15166510839523723626\",\"crate_name\":\"defmt\"}" "--export" "{\"package\":\"defmt\",\"tag\":\"defmt_prim\",\"data\":\"{=[?;1073741824]}\",\"disambiguator\":\"4989137785052000666\",\"crate_name\":\"defmt\"}" "--export" "{\"package\":\"defmt\",\"tag\":\"defmt_prim\",\"data\":\"{=[?;10]}\",\"disambiguator\":\"10030420351655151754\",\"crate_name\":\"defmt\"}" "--export" "{\"package\":\"defmt\",\"tag\":\"defmt_prim\",\"data\":\"{=[?;11]}\",\"disambiguator\":\"4635686410640747080\",\"crate_name\":\"defmt\"}" "--export" "{\"package\":\"defmt\",\"tag\":\"defmt_prim\",\"data\":\"{=[?;128]}\",\"disambiguator\":\"13058948007431296655\",\"crate_name\":\"defmt\"}" "--export" "{\"package\":\"defmt\",\"tag\":\"defmt_prim\",\"data\":\"{=[?;12]}\",\"disambiguator\":\"12200997203586463781\",\"crate_name\":\"defmt\"}" "--export" "{\"package\":\"defmt\",\"tag\":\"defmt_prim\",\"data\":\"{=[?;131072]}\",\"disambiguator\":\"14572738470052324520\",\"crate_name\":\"defmt\"}" "--export" "{\"package\":\"defmt\",\"tag\":\"defmt_prim\",\"data\":\"{=[?;134217728]}\",\"disambiguator\":\"848307431615115135\",\"crate_name\":\"defmt\"}" "--export" "{\"package\":\"defmt\",\"tag\":\"defmt_prim\",\"data\":\"{=[?;13]}\",\"disambiguator\":\"2868351995242565157\",\"crate_name\":\"defmt\"}" "--export" "{\"package\":\"defmt\",\"tag\":\"defmt_prim\",\"data\":\"{=[?;14]}\",\"disambiguator\":\"12565139071601255938\",\"crate_name\":\"defmt\"}" "--export" "{\"package\":\"defmt\",\"tag\":\"defmt_prim\",\"data\":\"{=[?;15]}\",\"disambiguator\":\"13141806140466206014\",\"crate_name\":\"defmt\"}" "--export" "{\"package\":\"defmt\",\"tag\":\"defmt_prim\",\"data\":\"{=[?;16384]}\",\"disambiguator\":\"7135950266177027874\",\"crate_name\":\"defmt\"}" "--export" "{\"package\":\"defmt\",\"tag\":\"defmt_prim\",\"data\":\"{=[?;16777216]}\",\"disambiguator\":\"4050654729783625280\",\"crate_name\":\"defmt\"}" "--export" "{\"package\":\"defmt\",\"tag\":\"defmt_prim\",\"data\":\"{=[?;16]}\",\"disambiguator\":\"16622501748540360307\",\"crate_name\":\"defmt\"}" "--export" "{\"package\":\"defmt\",\"tag\":\"defmt_prim\",\"data\":\"{=[?;17]}\",\"disambiguator\":\"13007659163981410993\",\"crate_name\":\"defmt\"}" "--export" "{\"package\":\"defmt\",\"tag\":\"defmt_prim\",\"data\":\"{=[?;18]}\",\"disambiguator\":\"12844683538855720851\",\"crate_name\":\"defmt\"}" "--export" "{\"package\":\"defmt\",\"tag\":\"defmt_prim\",\"data\":\"{=[?;19]}\",\"disambiguator\":\"15375450244489679408\",\"crate_name\":\"defmt\"}" "--export" "{\"package\":\"defmt\",\"tag\":\"defmt_prim\",\"data\":\"{=[?;1]}\",\"disambiguator\":\"10536548386951068949\",\"crate_name\":\"defmt\"}" "--export" "{\"package\":\"defmt\",\"tag\":\"defmt_prim\",\"data\":\"{=[?;2048]}\",\"disambiguator\":\"9181961828661663484\",\"crate_name\":\"defmt\"}" "--export" "{\"package\":\"defmt\",\"tag\":\"defmt_prim\",\"data\":\"{=[?;2097152]}\",\"disambiguator\":\"15684360765512473329\",\"crate_name\":\"defmt\"}" "--export" "{\"package\":\"defmt\",\"tag\":\"defmt_prim\",\"data\":\"{=[?;20]}\",\"disambiguator\":\"4317821207778762992\",\"crate_name\":\"defmt\"}" "--export" "{\"package\":\"defmt\",\"tag\":\"defmt_prim\",\"data\":\"{=[?;21]}\",\"disambiguator\":\"7874101577542864772\",\"crate_name\":\"defmt\"}" "--export" "{\"package\":\"defmt\",\"tag\":\"defmt_prim\",\"data\":\"{=[?;22]}\",\"disambiguator\":\"7431501951320215570\",\"crate_name\":\"defmt\"}" "--export" "{\"package\":\"defmt\",\"tag\":\"defmt_prim\",\"data\":\"{=[?;23]}\",\"disambiguator\":\"5285947113757463800\",\"crate_name\":\"defmt\"}" "--export" "{\"package\":\"defmt\",\"tag\":\"defmt_prim\",\"data\":\"{=[?;24]}\",\"disambiguator\":\"10548285220165859340\",\"crate_name\":\"defmt\"}" "--export" "{\"package\":\"defmt\",\"tag\":\"defmt_prim\",\"data\":\"{=[?;256]}\",\"disambiguator\":\"6071830990008500999\",\"crate_name\":\"defmt\"}" "--export" "{\"package\":\"defmt\",\"tag\":\"defmt_prim\",\"data\":\"{=[?;25]}\",\"disambiguator\":\"10824274717103477469\",\"crate_name\":\"defmt\"}" "--export" "{\"package\":\"defmt\",\"tag\":\"defmt_prim\",\"data\":\"{=[?;262144]}\",\"disambiguator\":\"2019999768437473047\",\"crate_name\":\"defmt\"}" "--export" "{\"package\":\"defmt\",\"tag\":\"defmt_prim\",\"data\":\"{=[?;268435456]}\",\"disambiguator\":\"3003602975761855336\",\"crate_name\":\"defmt\"}" "--export" "{\"package\":\"defmt\",\"tag\":\"defmt_prim\",\"data\":\"{=[?;26]}\",\"disambiguator\":\"14143743382927553707\",\"crate_name\":\"defmt\"}" "--export" "{\"package\":\"defmt\",\"tag\":\"defmt_prim\",\"data\":\"{=[?;27]}\",\"disambiguator\":\"1593247842379207038\",\"crate_name\":\"defmt\"}" "--export" "{\"package\":\"defmt\",\"tag\":\"defmt_prim\",\"data\":\"{=[?;28]}\",\"disambiguator\":\"11039188123241872514\",\"crate_name\":\"defmt\"}" "--export" "{\"package\":\"defmt\",\"tag\":\"defmt_prim\",\"data\":\"{=[?;29]}\",\"disambiguator\":\"17417898046123303431\",\"crate_name\":\"defmt\"}" "--export" "{\"package\":\"defmt\",\"tag\":\"defmt_prim\",\"data\":\"{=[?;2]}\",\"disambiguator\":\"9678487916946283162\",\"crate_name\":\"defmt\"}" "--export" "{\"package\":\"defmt\",\"tag\":\"defmt_prim\",\"data\":\"{=[?;30]}\",\"disambiguator\":\"7202629930402219332\",\"crate_name\":\"defmt\"}" "--export" "{\"package\":\"defmt\",\"tag\":\"defmt_prim\",\"data\":\"{=[?;31]}\",\"disambiguator\":\"8631809746362054120\",\"crate_name\":\"defmt\"}" "--export" "{\"package\":\"defmt\",\"tag\":\"defmt_prim\",\"data\":\"{=[?;32768]}\",\"disambiguator\":\"11206175375052673183\",\"crate_name\":\"defmt\"}" "--export" "{\"package\":\"defmt\",\"tag\":\"defmt_prim\",\"data\":\"{=[?;32]}\",\"disambiguator\":\"16272429875223065264\",\"crate_name\":\"defmt\"}" "--export" "{\"package\":\"defmt\",\"tag\":\"defmt_prim\",\"data\":\"{=[?;33554432]}\",\"disambiguator\":\"10192380076493535175\",\"crate_name\":\"defmt\"}" "--export" "{\"package\":\"defmt\",\"tag\":\"defmt_prim\",\"data\":\"{=[?;3]}\",\"disambiguator\":\"7867055765874347770\",\"crate_name\":\"defmt\"}" "--export" "{\"package\":\"defmt\",\"tag\":\"defmt_prim\",\"data\":\"{=[?;4096]}\",\"disambiguator\":\"3378459846906874342\",\"crate_name\":\"defmt\"}" "--export" "{\"package\":\"defmt\",\"tag\":\"defmt_prim\",\"data\":\"{=[?;4194304]}\",\"disambiguator\":\"11358394535774250435\",\"crate_name\":\"defmt\"}" "--export" "{\"package\":\"defmt\",\"tag\":\"defmt_prim\",\"data\":\"{=[?;4]}\",\"disambiguator\":\"5114171592672092818\",\"crate_name\":\"defmt\"}" "--export" "{\"package\":\"defmt\",\"tag\":\"defmt_prim\",\"data\":\"{=[?;512]}\",\"disambiguator\":\"17324722442681870450\",\"crate_name\":\"defmt\"}" "--export" "{\"package\":\"defmt\",\"tag\":\"defmt_prim\",\"data\":\"{=[?;524288]}\",\"disambiguator\":\"128439123759785649\",\"crate_name\":\"defmt\"}" "--export" "{\"package\":\"defmt\",\"tag\":\"defmt_prim\",\"data\":\"{=[?;536870912]}\",\"disambiguator\":\"13439721638873124792\",\"crate_name\":\"defmt\"}" "--export" "{\"package\":\"defmt\",\"tag\":\"defmt_prim\",\"data\":\"{=[?;5]}\",\"disambiguator\":\"12977982985688608843\",\"crate_name\":\"defmt\"}" "--export" "{\"package\":\"defmt\",\"tag\":\"defmt_prim\",\"data\":\"{=[?;64]}\",\"disambiguator\":\"6121731455773734980\",\"crate_name\":\"defmt\"}" "--export" "{\"package\":\"defmt\",\"tag\":\"defmt_prim\",\"data\":\"{=[?;65536]}\",\"disambiguator\":\"12441142086641314744\",\"crate_name\":\"defmt\"}" "--export" "{\"package\":\"defmt\",\"tag\":\"defmt_prim\",\"data\":\"{=[?;67108864]}\",\"disambiguator\":\"750387883981942827\",\"crate_name\":\"defmt\"}" "--export" "{\"package\":\"defmt\",\"tag\":\"defmt_prim\",\"data\":\"{=[?;6]}\",\"disambiguator\":\"631287792773775748\",\"crate_name\":\"defmt\"}" "--export" "{\"package\":\"defmt\",\"tag\":\"defmt_prim\",\"data\":\"{=[?;7]}\",\"disambiguator\":\"6878712030278013782\",\"crate_name\":\"defmt\"}" "--export" "{\"package\":\"defmt\",\"tag\":\"defmt_prim\",\"data\":\"{=[?;8192]}\",\"disambiguator\":\"13998293228495794512\",\"crate_name\":\"defmt\"}" "--export" "{\"package\":\"defmt\",\"tag\":\"defmt_prim\",\"data\":\"{=[?;8388608]}\",\"disambiguator\":\"15899185953651591061\",\"crate_name\":\"defmt\"}" "--export" "{\"package\":\"defmt\",\"tag\":\"defmt_prim\",\"data\":\"{=[?;8]}\",\"disambiguator\":\"8219153170214211011\",\"crate_name\":\"defmt\"}" "--export" "{\"package\":\"defmt\",\"tag\":\"defmt_prim\",\"data\":\"{=[?;9]}\",\"disambiguator\":\"13946057443971449809\",\"crate_name\":\"defmt\"}" "--export" "{\"package\":\"defmt\",\"tag\":\"defmt_prim\",\"data\":\"{=[?]}\",\"disambiguator\":\"2654205313969696810\",\"crate_name\":\"defmt\"}" "--export" "{\"package\":\"defmt\",\"tag\":\"defmt_prim\",\"data\":\"{=[?]}\",\"disambiguator\":\"7044545867054230009\",\"crate_name\":\"defmt\"}" "--export" "{\"package\":\"defmt\",\"tag\":\"defmt_prim\",\"data\":\"{=__internal_Debug}\",\"disambiguator\":\"5623903170800143477\",\"crate_name\":\"defmt\"}" "--export" "{\"package\":\"defmt\",\"tag\":\"defmt_prim\",\"data\":\"{=__internal_Display}\",\"disambiguator\":\"5105756340143410228\",\"crate_name\":\"defmt\"}" "--export" "{\"package\":\"defmt\",\"tag\":\"defmt_prim\",\"data\":\"{=__internal_FormatSequence}\",\"disambiguator\":\"6144288429955226596\",\"crate_name\":\"defmt\"}" "--export" "{\"package\":\"defmt\",\"tag\":\"defmt_prim\",\"data\":\"{=bool}\",\"disambiguator\":\"12258804912377148952\",\"crate_name\":\"defmt\"}" "--export" "{\"package\":\"defmt\",\"tag\":\"defmt_prim\",\"data\":\"{=char}\",\"disambiguator\":\"11679531567504631203\",\"crate_name\":\"defmt\"}" "--export" "{\"package\":\"defmt\",\"tag\":\"defmt_prim\",\"data\":\"{=f32}\",\"disambiguator\":\"10383471704712148890\",\"crate_name\":\"defmt\"}" "--export" "{\"package\":\"defmt\",\"tag\":\"defmt_prim\",\"data\":\"{=f64}\",\"disambiguator\":\"10676019542285320254\",\"crate_name\":\"defmt\"}" "--export" "{\"package\":\"defmt\",\"tag\":\"defmt_prim\",\"data\":\"{=i128}\",\"disambiguator\":\"6251775031606641553\",\"crate_name\":\"defmt\"}" "--export" "{\"package\":\"defmt\",\"tag\":\"defmt_prim\",\"data\":\"{=i16}\",\"disambiguator\":\"12592538325632643555\",\"crate_name\":\"defmt\"}" "--export" "{\"package\":\"defmt\",\"tag\":\"defmt_prim\",\"data\":\"{=i32}\",\"disambiguator\":\"3746895238173416384\",\"crate_name\":\"defmt\"}" "--export" "{\"package\":\"defmt\",\"tag\":\"defmt_prim\",\"data\":\"{=i64}\",\"disambiguator\":\"8107027980655246670\",\"crate_name\":\"defmt\"}" "--export" "{\"package\":\"defmt\",\"tag\":\"defmt_prim\",\"data\":\"{=i8}\",\"disambiguator\":\"3229113629630423043\",\"crate_name\":\"defmt\"}" "--export" "{\"package\":\"defmt\",\"tag\":\"defmt_prim\",\"data\":\"{=isize}\",\"disambiguator\":\"16965082436742360473\",\"crate_name\":\"defmt\"}" "--export" "{\"package\":\"defmt\",\"tag\":\"defmt_prim\",\"data\":\"{=istr}\",\"disambiguator\":\"17739116440256076459\",\"crate_name\":\"defmt\"}" "--export" "{\"package\":\"defmt\",\"tag\":\"defmt_prim\",\"data\":\"{=str}\",\"disambiguator\":\"9635981116611021278\",\"crate_name\":\"defmt\"}" "--export" "{\"package\":\"defmt\",\"tag\":\"defmt_prim\",\"data\":\"{=u128}\",\"disambiguator\":\"4911280624046452557\",\"crate_name\":\"defmt\"}" "--export" "{\"package\":\"defmt\",\"tag\":\"defmt_prim\",\"data\":\"{=u16}\",\"disambiguator\":\"5315098999487818844\",\"crate_name\":\"defmt\"}" "--export" "{\"package\":\"defmt\",\"tag\":\"defmt_prim\",\"data\":\"{=u32}\",\"disambiguator\":\"14162187385077967277\",\"crate_name\":\"defmt\"}" "--export" "{\"package\":\"defmt\",\"tag\":\"defmt_prim\",\"data\":\"{=u64}\",\"disambiguator\":\"9988507570022775015\",\"crate_name\":\"defmt\"}" "--export" "{\"package\":\"defmt\",\"tag\":\"defmt_prim\",\"data\":\"{=u8}\",\"disambiguator\":\"14100460465230513008\",\"crate_name\":\"defmt\"}" "--export" "{\"package\":\"defmt\",\"tag\":\"defmt_prim\",\"data\":\"{=usize}\",\"disambiguator\":\"3377093703983497006\",\"crate_name\":\"defmt\"}" "--export" "{\"package\":\"defmt\",\"tag\":\"defmt_write\",\"data\":\"..\",\"disambiguator\":\"15271805462242373331\",\"crate_name\":\"defmt\"}" "--export" "{\"package\":\"defmt\",\"tag\":\"defmt_write\",\"data\":\"..={}\",\"disambiguator\":\"1610663973911457606\",\"crate_name\":\"defmt\"}" "--export" "{\"package\":\"defmt\",\"tag\":\"defmt_write\",\"data\":\"..{}\",\"disambiguator\":\"11886978126958958235\",\"crate_name\":\"defmt\"}" "--export" "{\"package\":\"defmt\",\"tag\":\"defmt_write\",\"data\":\"0x{:x}\",\"disambiguator\":\"12038331877033052695\",\"crate_name\":\"defmt\"}" "--export" "{\"package\":\"defmt\",\"tag\":\"defmt_write\",\"data\":\"BorrowError\",\"disambiguator\":\"16342482305371161635\",\"crate_name\":\"defmt\"}" "--export" "{\"package\":\"defmt\",\"tag\":\"defmt_write\",\"data\":\"BorrowMutError\",\"disambiguator\":\"2973952977514000811\",\"crate_name\":\"defmt\"}" "--export" "{\"package\":\"defmt\",\"tag\":\"defmt_write\",\"data\":\"Cell {{ value: {=?} }})\",\"disambiguator\":\"1468839206008940476\",\"crate_name\":\"defmt\"}" "--export" "{\"package\":\"defmt\",\"tag\":\"defmt_write\",\"data\":\"ChunksExact(..)\",\"disambiguator\":\"1300330432654062784\",\"crate_name\":\"defmt\"}" "--export" "{\"package\":\"defmt\",\"tag\":\"defmt_write\",\"data\":\"Duration {{ secs: {=u64}, nanos: {=u32} }}\",\"disambiguator\":\"4981204546383349655\",\"crate_name\":\"defmt\"}" "--export" "{\"package\":\"defmt\",\"tag\":\"defmt_write\",\"data\":\"Iter {{ slice: {=[?]}, position: ? }}\",\"disambiguator\":\"1995468268392516260\",\"crate_name\":\"defmt\"}" "--export" "{\"package\":\"defmt\",\"tag\":\"defmt_write\",\"data\":\"Layout {{ size: {}, align: {} }}\",\"disambiguator\":\"639946870888163250\",\"crate_name\":\"defmt\"}" "--export" "{\"package\":\"defmt\",\"tag\":\"defmt_write\",\"data\":\"TryFromIntError(())\",\"disambiguator\":\"15838004139412693146\",\"crate_name\":\"defmt\"}" "--export" "{\"package\":\"defmt\",\"tag\":\"defmt_write\",\"data\":\"TryFromSliceError(())\",\"disambiguator\":\"9618265683779419347\",\"crate_name\":\"defmt\"}" "--export" "{\"package\":\"defmt\",\"tag\":\"defmt_write\",\"data\":\"Windows(..)\",\"disambiguator\":\"6985500009206751027\",\"crate_name\":\"defmt\"}" "--export" "{\"package\":\"defmt\",\"tag\":\"defmt_write\",\"data\":\"Zip(..)\",\"disambiguator\":\"17444990088938185599\",\"crate_name\":\"defmt\"}" "--export" "{\"package\":\"defmt\",\"tag\":\"defmt_write\",\"data\":\"{=i128}\",\"disambiguator\":\"9945119631825723538\",\"crate_name\":\"defmt\"}" "--export" "{\"package\":\"defmt\",\"tag\":\"defmt_write\",\"data\":\"{=i16}\",\"disambiguator\":\"5982186323216770634\",\"crate_name\":\"defmt\"}" "--export" "{\"package\":\"defmt\",\"tag\":\"defmt_write\",\"data\":\"{=i32}\",\"disambiguator\":\"2599367664600798004\",\"crate_name\":\"defmt\"}" "--export" "{\"package\":\"defmt\",\"tag\":\"defmt_write\",\"data\":\"{=i64}\",\"disambiguator\":\"3704487475534186256\",\"crate_name\":\"defmt\"}" "--export" "{\"package\":\"defmt\",\"tag\":\"defmt_write\",\"data\":\"{=i8}\",\"disambiguator\":\"4731066844489999116\",\"crate_name\":\"defmt\"}" "--export" "{\"package\":\"defmt\",\"tag\":\"defmt_write\",\"data\":\"{=isize}\",\"disambiguator\":\"13028176760702614594\",\"crate_name\":\"defmt\"}" "--export" "{\"package\":\"defmt\",\"tag\":\"defmt_write\",\"data\":\"{=u128}\",\"disambiguator\":\"13190978049551866960\",\"crate_name\":\"defmt\"}" "--export" "{\"package\":\"defmt\",\"tag\":\"defmt_write\",\"data\":\"{=u16}\",\"disambiguator\":\"5031463604356137723\",\"crate_name\":\"defmt\"}" "--export" "{\"package\":\"defmt\",\"tag\":\"defmt_write\",\"data\":\"{=u32}\",\"disambiguator\":\"11289667228927971985\",\"crate_name\":\"defmt\"}" "--export" "{\"package\":\"defmt\",\"tag\":\"defmt_write\",\"data\":\"{=u64}\",\"disambiguator\":\"14436778430552775677\",\"crate_name\":\"defmt\"}" "--export" "{\"package\":\"defmt\",\"tag\":\"defmt_write\",\"data\":\"{=u8}\",\"disambiguator\":\"10202468925519253031\",\"crate_name\":\"defmt\"}" "--export" "{\"package\":\"defmt\",\"tag\":\"defmt_write\",\"data\":\"{=usize}\",\"disambiguator\":\"13040228448430197580\",\"crate_name\":\"defmt\"}" "--export" "{\"package\":\"defmt\",\"tag\":\"defmt_write\",\"data\":\"{}\",\"disambiguator\":\"10759486005528389099\",\"crate_name\":\"defmt\"}" "--export" "{\"package\":\"defmt\",\"tag\":\"defmt_write\",\"data\":\"{}\",\"disambiguator\":\"11237799138058518887\",\"crate_name\":\"defmt\"}" "--export" "{\"package\":\"defmt\",\"tag\":\"defmt_write\",\"data\":\"{}\",\"disambiguator\":\"12267034499820753083\",\"crate_name\":\"defmt\"}" "--export" "{\"package\":\"defmt\",\"tag\":\"defmt_write\",\"data\":\"{}\",\"disambiguator\":\"1279585422292466253\",\"crate_name\":\"defmt\"}" "--export" "{\"package\":\"defmt\",\"tag\":\"defmt_write\",\"data\":\"{}\",\"disambiguator\":\"12869132148111814378\",\"crate_name\":\"defmt\"}" "--export" "{\"package\":\"defmt\",\"tag\":\"defmt_write\",\"data\":\"{}\",\"disambiguator\":\"12967813925836273386\",\"crate_name\":\"defmt\"}" "--export" "{\"package\":\"defmt\",\"tag\":\"defmt_write\",\"data\":\"{}\",\"disambiguator\":\"13586566628143759196\",\"crate_name\":\"defmt\"}" "--export" "{\"package\":\"defmt\",\"tag\":\"defmt_write\",\"data\":\"{}\",\"disambiguator\":\"14234503042989076011\",\"crate_name\":\"defmt\"}" "--export" "{\"package\":\"defmt\",\"tag\":\"defmt_write\",\"data\":\"{}\",\"disambiguator\":\"14602566642005192677\",\"crate_name\":\"defmt\"}" "--export" "{\"package\":\"defmt\",\"tag\":\"defmt_write\",\"data\":\"{}\",\"disambiguator\":\"14715672845156772084\",\"crate_name\":\"defmt\"}" "--export" "{\"package\":\"defmt\",\"tag\":\"defmt_write\",\"data\":\"{}\",\"disambiguator\":\"15173918142033731477\",\"crate_name\":\"defmt\"}" "--export" "{\"package\":\"defmt\",\"tag\":\"defmt_write\",\"data\":\"{}\",\"disambiguator\":\"15322281426291457962\",\"crate_name\":\"defmt\"}" "--export" "{\"package\":\"defmt\",\"tag\":\"defmt_write\",\"data\":\"{}\",\"disambiguator\":\"15414556140904381779\",\"crate_name\":\"defmt\"}" "--export" "{\"package\":\"defmt\",\"tag\":\"defmt_write\",\"data\":\"{}\",\"disambiguator\":\"15440592503307612946\",\"crate_name\":\"defmt\"}" "--export" "{\"package\":\"defmt\",\"tag\":\"defmt_write\",\"data\":\"{}\",\"disambiguator\":\"15865811316654198818\",\"crate_name\":\"defmt\"}" "--export" "{\"package\":\"defmt\",\"tag\":\"defmt_write\",\"data\":\"{}\",\"disambiguator\":\"15974908268683833535\",\"crate_name\":\"defmt\"}" "--export" "{\"package\":\"defmt\",\"tag\":\"defmt_write\",\"data\":\"{}\",\"disambiguator\":\"16931007860041973524\",\"crate_name\":\"defmt\"}" "--export" "{\"package\":\"defmt\",\"tag\":\"defmt_write\",\"data\":\"{}\",\"disambiguator\":\"16978917821748755142\",\"crate_name\":\"defmt\"}" "--export" "{\"package\":\"defmt\",\"tag\":\"defmt_write\",\"data\":\"{}\",\"disambiguator\":\"17604536149974627595\",\"crate_name\":\"defmt\"}" "--export" "{\"package\":\"defmt\",\"tag\":\"defmt_write\",\"data\":\"{}\",\"disambiguator\":\"18002646329623887913\",\"crate_name\":\"defmt\"}" "--export" "{\"package\":\"defmt\",\"tag\":\"defmt_write\",\"data\":\"{}\",\"disambiguator\":\"1861291453554648141\",\"crate_name\":\"defmt\"}" "--export" "{\"package\":\"defmt\",\"tag\":\"defmt_write\",\"data\":\"{}\",\"disambiguator\":\"2036216210423299481\",\"crate_name\":\"defmt\"}" "--export" "{\"package\":\"defmt\",\"tag\":\"defmt_write\",\"data\":\"{}\",\"disambiguator\":\"2163358989709295995\",\"crate_name\":\"defmt\"}" "--export" "{\"package\":\"defmt\",\"tag\":\"defmt_write\",\"data\":\"{}\",\"disambiguator\":\"2577630573440335627\",\"crate_name\":\"defmt\"}" "--export" "{\"package\":\"defmt\",\"tag\":\"defmt_write\",\"data\":\"{}\",\"disambiguator\":\"2963497630744311333\",\"crate_name\":\"defmt\"}" "--export" "{\"package\":\"defmt\",\"tag\":\"defmt_write\",\"data\":\"{}\",\"disambiguator\":\"3266949235067977959\",\"crate_name\":\"defmt\"}" "--export" "{\"package\":\"defmt\",\"tag\":\"defmt_write\",\"data\":\"{}\",\"disambiguator\":\"3487462903292530160\",\"crate_name\":\"defmt\"}" "--export" "{\"package\":\"defmt\",\"tag\":\"defmt_write\",\"data\":\"{}\",\"disambiguator\":\"3652950497255833307\",\"crate_name\":\"defmt\"}" "--export" "{\"package\":\"defmt\",\"tag\":\"defmt_write\",\"data\":\"{}\",\"disambiguator\":\"3988308557787776069\",\"crate_name\":\"defmt\"}" "--export" "{\"package\":\"defmt\",\"tag\":\"defmt_write\",\"data\":\"{}\",\"disambiguator\":\"480395768802675491\",\"crate_name\":\"defmt\"}" "--export" "{\"package\":\"defmt\",\"tag\":\"defmt_write\",\"data\":\"{}\",\"disambiguator\":\"5189541164090858770\",\"crate_name\":\"defmt\"}" "--export" "{\"package\":\"defmt\",\"tag\":\"defmt_write\",\"data\":\"{}\",\"disambiguator\":\"5412914367064217619\",\"crate_name\":\"defmt\"}" "--export" "{\"package\":\"defmt\",\"tag\":\"defmt_write\",\"data\":\"{}\",\"disambiguator\":\"5463611938482628383\",\"crate_name\":\"defmt\"}" "--export" "{\"package\":\"defmt\",\"tag\":\"defmt_write\",\"data\":\"{}\",\"disambiguator\":\"5537848346550715814\",\"crate_name\":\"defmt\"}" "--export" "{\"package\":\"defmt\",\"tag\":\"defmt_write\",\"data\":\"{}\",\"disambiguator\":\"5614487766568583976\",\"crate_name\":\"defmt\"}" "--export" "{\"package\":\"defmt\",\"tag\":\"defmt_write\",\"data\":\"{}\",\"disambiguator\":\"5645052740019809386\",\"crate_name\":\"defmt\"}" "--export" "{\"package\":\"defmt\",\"tag\":\"defmt_write\",\"data\":\"{}\",\"disambiguator\":\"5681315240045695130\",\"crate_name\":\"defmt\"}" "--export" "{\"package\":\"defmt\",\"tag\":\"defmt_write\",\"data\":\"{}\",\"disambiguator\":\"5935659538382091787\",\"crate_name\":\"defmt\"}" "--export" "{\"package\":\"defmt\",\"tag\":\"defmt_write\",\"data\":\"{}\",\"disambiguator\":\"5980871887402708036\",\"crate_name\":\"defmt\"}" "--export" "{\"package\":\"defmt\",\"tag\":\"defmt_write\",\"data\":\"{}\",\"disambiguator\":\"605973296760023219\",\"crate_name\":\"defmt\"}" "--export" "{\"package\":\"defmt\",\"tag\":\"defmt_write\",\"data\":\"{}\",\"disambiguator\":\"6068748193645693675\",\"crate_name\":\"defmt\"}" "--export" "{\"package\":\"defmt\",\"tag\":\"defmt_write\",\"data\":\"{}\",\"disambiguator\":\"6320398473329423051\",\"crate_name\":\"defmt\"}" "--export" "{\"package\":\"defmt\",\"tag\":\"defmt_write\",\"data\":\"{}\",\"disambiguator\":\"6711180706373673607\",\"crate_name\":\"defmt\"}" "--export" "{\"package\":\"defmt\",\"tag\":\"defmt_write\",\"data\":\"{}\",\"disambiguator\":\"6928142587242413740\",\"crate_name\":\"defmt\"}" "--export" "{\"package\":\"defmt\",\"tag\":\"defmt_write\",\"data\":\"{}\",\"disambiguator\":\"7592258669104562258\",\"crate_name\":\"defmt\"}" "--export" "{\"package\":\"defmt\",\"tag\":\"defmt_write\",\"data\":\"{}\",\"disambiguator\":\"7767447008600496505\",\"crate_name\":\"defmt\"}" "--export" "{\"package\":\"defmt\",\"tag\":\"defmt_write\",\"data\":\"{}\",\"disambiguator\":\"8095779950443127335\",\"crate_name\":\"defmt\"}" "--export" "{\"package\":\"defmt\",\"tag\":\"defmt_write\",\"data\":\"{}\",\"disambiguator\":\"8540797434741648676\",\"crate_name\":\"defmt\"}" "--export" "{\"package\":\"defmt\",\"tag\":\"defmt_write\",\"data\":\"{}\",\"disambiguator\":\"855817748978806867\",\"crate_name\":\"defmt\"}" "--export" "{\"package\":\"defmt\",\"tag\":\"defmt_write\",\"data\":\"{}\",\"disambiguator\":\"8939257954769335771\",\"crate_name\":\"defmt\"}" "--export" "{\"package\":\"defmt\",\"tag\":\"defmt_write\",\"data\":\"{}\",\"disambiguator\":\"9184017520603768948\",\"crate_name\":\"defmt\"}" "--export" "{\"package\":\"defmt\",\"tag\":\"defmt_write\",\"data\":\"{}\",\"disambiguator\":\"9456666102303287272\",\"crate_name\":\"defmt\"}" "--export" "{\"package\":\"defmt\",\"tag\":\"defmt_write\",\"data\":\"{}\",\"disambiguator\":\"977482717471124809\",\"crate_name\":\"defmt\"}" "--export" "{\"package\":\"defmt\",\"tag\":\"defmt_write\",\"data\":\"{}..\",\"disambiguator\":\"17296393250253569651\",\"crate_name\":\"defmt\"}" "--export" "{\"package\":\"defmt\",\"tag\":\"defmt_write\",\"data\":\"{}..={}\",\"disambiguator\":\"1915048198914555535\",\"crate_name\":\"defmt\"}" "--export" "{\"package\":\"defmt\",\"tag\":\"defmt_write\",\"data\":\"{}..{}\",\"disambiguator\":\"13264685543884572354\",\"crate_name\":\"defmt\"}" "-z" "stack-size=1048576" "--stack-first" "--allow-undefined" "--no-demangle" "/Users/jonathan/.rustup/toolchains/stable-aarch64-apple-darwin/lib/rustlib/wasm32-wasip2/lib/self-contained/crt1-command.o" "/Users/jonathan/Documents/wasm-defmt/hello/target/wasm32-wasip2/release/deps/hello-454553ecf0eea6c1.hello.82eac32d0082b94d-cgu.0.rcgu.o" "/Users/jonathan/Documents/wasm-defmt/hello/target/wasm32-wasip2/release/deps/hello-454553ecf0eea6c1.0f5t9c1rfcp7yuph21z7duxkj.rcgu.o" "/Users/jonathan/Documents/wasm-defmt/hello/target/wasm32-wasip2/release/deps/libdefmt-889c9c56a7ab46a8.rlib" "/Users/jonathan/Documents/wasm-defmt/hello/target/wasm32-wasip2/release/deps/libbitflags-a410080f72edd465.rlib" "/Users/jonathan/.rustup/toolchains/stable-aarch64-apple-darwin/lib/rustlib/wasm32-wasip2/lib/libstd-14d8a84ba8473ef9.rlib" "/Users/jonathan/.rustup/toolchains/stable-aarch64-apple-darwin/lib/rustlib/wasm32-wasip2/lib/libpanic_abort-d73cd577f2b5e1c5.rlib" "/Users/jonathan/.rustup/toolchains/stable-aarch64-apple-darwin/lib/rustlib/wasm32-wasip2/lib/libwasi-895b9895f9804165.rlib" "/Users/jonathan/.rustup/toolchains/stable-aarch64-apple-darwin/lib/rustlib/wasm32-wasip2/lib/librustc_demangle-a96dc2891fd0fe44.rlib" "/Users/jonathan/.rustup/toolchains/stable-aarch64-apple-darwin/lib/rustlib/wasm32-wasip2/lib/libstd_detect-1c948e99c0a25dc3.rlib" "/Users/jonathan/.rustup/toolchains/stable-aarch64-apple-darwin/lib/rustlib/wasm32-wasip2/lib/libhashbrown-f56024d9920cf3d1.rlib" "/Users/jonathan/.rustup/toolchains/stable-aarch64-apple-darwin/lib/rustlib/wasm32-wasip2/lib/librustc_std_workspace_alloc-949b3bfac2273364.rlib" "/Users/jonathan/.rustup/toolchains/stable-aarch64-apple-darwin/lib/rustlib/wasm32-wasip2/lib/libminiz_oxide-336fe7883e6d698c.rlib" "/Users/jonathan/.rustup/toolchains/stable-aarch64-apple-darwin/lib/rustlib/wasm32-wasip2/lib/libadler-cc83b8b46a213679.rlib" "/Users/jonathan/.rustup/toolchains/stable-aarch64-apple-darwin/lib/rustlib/wasm32-wasip2/lib/libunwind-1cd5fa53bb5645bd.rlib" "/Users/jonathan/.rustup/toolchains/stable-aarch64-apple-darwin/lib/rustlib/wasm32-wasip2/lib/libcfg_if-a31f22339ad5b48a.rlib" "/Users/jonathan/.rustup/toolchains/stable-aarch64-apple-darwin/lib/rustlib/wasm32-wasip2/lib/liblibc-95061d4e7e97eab7.rlib" "-l" "c" "/Users/jonathan/.rustup/toolchains/stable-aarch64-apple-darwin/lib/rustlib/wasm32-wasip2/lib/liballoc-134ec1995bf38c2c.rlib" "/Users/jonathan/.rustup/toolchains/stable-aarch64-apple-darwin/lib/rustlib/wasm32-wasip2/lib/librustc_std_workspace_core-6c926d8ae1864f14.rlib" "/Users/jonathan/.rustup/toolchains/stable-aarch64-apple-darwin/lib/rustlib/wasm32-wasip2/lib/libcore-cf0494a9131b2aa9.rlib" "/Users/jonathan/.rustup/toolchains/stable-aarch64-apple-darwin/lib/rustlib/wasm32-wasip2/lib/libcompiler_builtins-ebc7929af1c29611.rlib" "-L" "/Users/jonathan/Documents/wasm-defmt/hello/target/wasm32-wasip2/release/build/defmt-254da653a81f0d7c/out" "-L" "/Users/jonathan/.rustup/toolchains/stable-aarch64-apple-darwin/lib/rustlib/wasm32-wasip2/lib/self-contained" "-o" "/Users/jonathan/Documents/wasm-defmt/hello/target/wasm32-wasip2/release/deps/hello-454553ecf0eea6c1.wasm" "--gc-sections" "-O3" "--strip-debug"
  = note: error: failed to encode component

          Caused by:
              0: failed to decode world from module
              1: module was not valid
              2: module requires an import interface named `env`


error: could not compile `hello` (bin "hello") due to 1 previous error

It looks like the WASM linker doesn't like our weirdly named symbols.

If you have a commercial need for this, please reach out to https://ferrous-systems.com/contact with a Consulting enquiry.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants