You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Apologies if this isn't the correct place to report this.
I'm running into linking issues in rust after increasing the number of functions in the wit file.
I run wit-bindgen rust . to generate rust bindings from a wit file. That is then compiled in a static lib crate, which succeeds, but linking fails for a binary that is linked against the static library. Compiling the whole workspace with cargo b -r --target wasm32-wasip2.
error: linking with `wasm-component-ld` failed: exit code: 1
note: error: failed to parse core wasm for componentization
Caused by:
0: decoding custom section component-type:wit-bindgen:0.36.0:x:xx:xxx:encoded world
1: instance type declaration size is out of bounds (at offset 0x8b)
The issue seems to start happening when there is around 45k functions. 44k functions worked fine, 45.5k didn't work, with everything else being the same.
Additional information that might matter:
The wit file currently has <20k types (resources, records, enums combined)
The produced .rs from wit-bindgen is ~60mb
The produced .rlib with the output of wit-bindgen is ~200mb
rustc 1.85.0-nightly (4d669fb34 2024-12-08)
Let me know if anything else is needed to identify the issue.
Thanks in advance!
The text was updated successfully, but these errors were encountered:
Thanks for the report! Can you share a binary or two here perhaps? The limit here is hardcoded at this location and is pretty arbitrary and should be fine to increase.
Apologies if this isn't the correct place to report this.
I'm running into linking issues in rust after increasing the number of functions in the wit file.
I run
wit-bindgen rust .
to generate rust bindings from a wit file. That is then compiled in a static lib crate, which succeeds, but linking fails for a binary that is linked against the static library. Compiling the whole workspace withcargo b -r --target wasm32-wasip2
.The issue seems to start happening when there is around 45k functions. 44k functions worked fine, 45.5k didn't work, with everything else being the same.
Additional information that might matter:
wit-bindgen
is ~60mbwit-bindgen
is ~200mbrustc 1.85.0-nightly (4d669fb34 2024-12-08)
Let me know if anything else is needed to identify the issue.
Thanks in advance!
The text was updated successfully, but these errors were encountered: