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

streams are not implemented in wit-bindgen for C bindings #112

Open
brendandburns opened this issue Apr 18, 2024 · 1 comment
Open

streams are not implemented in wit-bindgen for C bindings #112

brendandburns opened this issue Apr 18, 2024 · 1 comment

Comments

@brendandburns
Copy link
Contributor

brendandburns commented Apr 18, 2024

If you try to generate bindings for 0.3.0 for C it fails:

RUST_BACKTRACE=1 wit-bindgen c --autodrop-borrows yes ./wasi-http/wit-0.3.0-draft -w client
thread 'main' panicked at crates/c/src/lib.rs:780:43:
not implemented
stack backtrace:
   0: rust_begin_unwind
   1: core::panicking::panic_fmt
   2: core::panicking::panic
   3: wit_bindgen_c::push_ty_name
   4: wit_bindgen_c::gen_type_name
   5: wit_bindgen_c::InterfaceGenerator::define_live_types
   6: <wit_bindgen_c::C as wit_bindgen_core::WorldGenerator>::import_interface
   7: wit_bindgen_core::WorldGenerator::generate
   8: wit_bindgen::main
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.

I realize that this is actually a wit-bindgen issue, but I think C bindings should be a blocker for an 0.3.0 release.

@dicej
Copy link
Collaborator

dicej commented Apr 18, 2024

Yeah, the only tool that can handle stream and future at this point (AFAIK) is isyswasfa and its temporary forks of wit-bindgen and componentize-py (and those only handle Rust and Python at the moment). It emulates support by transforming the stream and future references in the WIT into resource imports.

I'm currently working on adding support for async lifts and lowers, along with proper (not just emulated) support for stream and future to wit-bindgen, wasm-tools, and wasmtime, and plan to start opening PRs on those projects in the next few weeks. See https://github.com/dicej/component-async-demo for the progress I've made so far.

I agree that C binding support will be a blocker, and I plan to take a crack at it once the other foundational pieces are in place. If you or anyone else are interested in contributing to those efforts, I'd be happy to collaborate.

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