-
Notifications
You must be signed in to change notification settings - Fork 29
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
Problem with using cargo-wasi
in conjunction with wasm-bindgen
#110
Comments
I tried downloading the
|
Thanks for the report but this is expected. The wasm-bindgen support here is quite dated and intended for a feature that never got across the finish line, so if you'd like a tool to manage wasm-bindgen it's recommended to use wasm-pack instead (or run |
Thank you for the info! Should my takeaway from your message be that invoking When you reference "a feature that never got across the finish line", precisely what are you referring to? A feature of some part of the WASI ecosystem ( I'm still learning the whole WebAssembly ecosystem, so thank you and please forgive me for what are certainly newbie questions! |
Oh sorry yeah to expand more, the For the feature I was referring to it was interface types in wasm-bindgen itself. That work stalled out quite some time ago and isn't intended to really be used any more at this point. |
In my case my entire motivation for using Correct me if I am wrong, but I don't get the standard C/C++ libraries (even Again I'm new to the ecosystem, but I'd be somewhat surprised if I was the only person trying to do this. Thanks! |
For C/C++ on the web it currently works best with Emscripten. While it's theoretically possible to get it working with wasm32-unknown-unknown you'll end up doing a good deal of the work yourself and there's no toolchain readily available. The Rust Emscripten targets I think are somewhat in a state of disrepair and they may or may not work, IIRC they haven't received maintenance in awhile and may not work. It's worth pointing out that with wasm-bindgen it's not really compatible with either WASI or Emscripten, so unfortunately effectively wasm-bindgen can't really be used with C/C++, or at least not easily. |
So I have one last question, and at this point this is to assuage my intellectual curiosity: Why would a difference between the This feels equivalent to the In any case, thank you so much for your help! |
IIRC that was a bug in wasm-bindgen a few months ago which has since been fixed. That's not a difference between the targets but rather most likely a difference between LLVM versions used when wasm-bindgen was written vs what you're using now. |
Would it make sense to provide a way to disable using |
I'm having problems using
cargo-wasi
in conjunction with withwasm-bindgen
. Specifically,cargo-wasi
seems to force WebAssembly interface types to be enabled, and if there is a technique to turn it off, I can't seem to find it.This seems to happen with a completely fresh project. Steps to reproduce:
cargo new uses-wasm-bindgen --lib
wasm-bindgen = "0.2.78"
to the[dependencies]
section ofCargo.toml
wasm-bindgen-test = "0.3.13"
to the[dev-dependencies]
section ofCargo.toml
cargo wasi test --release
Running this gives me the following message:
Curiously
wasm-pack test --node
works just fine (though it reports no tests to run in this trivial case)I want to make some use of
wasm-bindgen
to generate bindings so that I can invoke Rust methods from JavaScript, butcargo-wasi
seems to force on a capability (interface types) not supported bywasm-bindgen
. I'm very new to WebAssembly, so I could be making a simple mistake.The text was updated successfully, but these errors were encountered: