WebAssembly / WebAssembly/WASI

streams are not implemented in `wit-bindgen` for C bindings

Open
#804 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

P-http S-inactive
Dominant language
Rust
Stars
5.8k
Forks
333
Avg merge
2d 13h
Merged PRs (30d)
3

Description

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.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the command against ./wasi-http/wit-0.3.0-draft with the C generator, then inspect crates/c/src/lib.rs around line 780 and the push_ty_name entry point shown in the backtrace. Done means wit-bindgen generates C bindings for the 0.3.0 streams case without the not implemented panic.

Written by the indexing model from the issue text.

Assessment

Tech stack
c, rust
Domain
compilers, devtools
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.