sunfishcode / hello-wasi-http

47 stars 17 forks source link

Issue with wit-bindgen version 0.21/0.22 #11

Open matsbror opened 2 months ago

matsbror commented 2 months ago

I am on cargo/rust v 1.77.2

When building the example with wit-bindgen v 0.21 as from the repo the following error appears:

   Compiling hello-wasi-http v0.0.0 (/home/mats/microservices/hello-wasi-http)
error[E0425]: cannot find function `run_ctors_once` in crate `wit_bindgen_rt`
    --> src/bindings.rs:8309:25
     |
8309 |         wit_bindgen_rt::run_ctors_once();
     |                         ^^^^^^^^^^^^^^ not found in `wit_bindgen_rt`

For more information about this error, try `rustc --explain E0425`.

The same error happens with wit-bindgen v 0.22 but not with v0.23 or 0.24. I can then build without errors.

sunfishcode commented 2 months ago

I think this is due to a mismatch between the versions of cargo-component and wit-bindgen in use. I've now filed https://github.com/sunfishcode/hello-wasi-http/pull/12 to update the repo to wit-bindgen 0.24 which works with the current cargo-component.