-
Notifications
You must be signed in to change notification settings - Fork 50
module does not export a function named cabi_realloc
#87
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
Comments
Thanks for the report! Can you detail how you got a wasm32-wasip2 compiler? I was poking at that locally and had a surprisingly difficult time getting this to work, but for other reasons unrelated to the one that you encountered. This may indicate a configuration issue or an issue with the wasip2 toolchain to smooth over. |
@alexcrichton sure, I built the 1.78.0 rustc release package for Arch Linux like this: https://gitlab.archlinux.org/greyltc/rust/-/blob/add-wasm32-wasip2/PKGBUILD?ref_type=heads#L73-230 but basically, that just amounted to adding
to config.toml and Seems I also had to use your special linker, wasm-component-ld, which I built/packaged like this: https://aur.archlinux.org/cgit/aur.git/plain/PKGBUILD?h=wasm-component-ld |
Ah ok makes sense! The wit-bindgen crate currently assumes that rust-lang/rust#122411 is part of Rust, which didn't make the 1.78 release. The 1.79 release of Rust will be the first to include that PR which should resolve most of this error. Otherwise though one important thing to note is that wasi-libc objects are built differently for wasm32-wasip1 and wasm32-wasip2, so you'll eventually want a distinct |
rust-lang/rust#122411 seems to have sorted it, thanks! I built the rust package with that PR patched in like this: https://gitlab.archlinux.org/greyltc/rust/-/compare/main...add-wasm32-wasip2?from_project_id=38540 I also made a wasip2-libc package which gives me a wasi-root that has a and the missing
Though I can't seem to run it successfully like I did with the cli_command example:
|
To fix that error, the cli invocation to run an wasi-http proxy world is |
Thanks for your help, I very much appreciate it.
|
Ah for that you'll want to pass |
Works! 🍾 |
Hi, I'm trying to build the examples here for the
wasm32-wasip2
target. The cli-command example works fine, but the http-proxy example fails while linking withmodule does not export a function named 'cabi_realloc'
, see below.Should I expect
cargo build --release --example http-proxy --target wasm32-wasip2
to work?The text was updated successfully, but these errors were encountered: