-
Notifications
You must be signed in to change notification settings - Fork 4
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
Build is broken, trying to fix it #195
base: main
Are you sure you want to change the base?
Conversation
AFAICT the three issues likely all stem from this line: kannader/kannader-config-macros/src/lib.rs Line 463 in 177b7b5
In particular, wasmtime at some point changed its API, so that the Store would be passed as a parameter rather than kept internally within each thing. Here the add_to_linker method defined by make_host_server seems to already take these arguments: ctx: &mut wasmtime::Store<WasmState>,
l: &mut wasmtime::Linker<WasmState>, So I'd guess that just replacing this Hope that works, and thank you very much for all the updates! :D |
Oh and as for the macros and why they're here: I would really love to get rid of all these macros altogether, it's one of the most hairy parts of kannader. But unfortunately there's currently no good solution for handling the problem of interfacing between wasm and native. Unless a solution came in that I didn't hear about, we'll still have to wait for wasm interface types / the wasm component model to come up, at which point we can probably kill all that code with fire :) |
It appears that the borrow checker does not like that I borrow l.define(ctx, #link_name, #ffi_name, wasmtime::Func::wrap(&mut *ctx, the_fn))?; Based on my very limited understanding of both kannader and wasmtime, it seems that linker.func_wrap("host", "log_str", |caller: Caller<'_, ()>, ptr: i32, len: i32| {
// ...
})?; My code is then simply: kannader/kannader-config-macros/src/lib.rs Line 463 in e0e9841
Then it appears the let module = Module::new(&engine, wat)?;
// instantiate in multiple different stores
for _ in 0..10 {
let mut store = Store::new(&engine, ());
linker.instantiate(&mut store, &module)?;
} To the best of my understanding, it's the same in your code, for example in kannader/kannader/src/wasm_config.rs Lines 94 to 96 in 177b7b5
But I am guessing way more things than I am comfortable with here, and I might also have completely broken your WASM implementation without noticing it too 🙈. Let me know! |
Build is broken on
main
:I bumped your rust toolchain to the latest nightly:
But after that, many things are broken, so I had to bump the following packages:
I then fixed most of the errors, but I am don't know how to solve the 3 remaining ones about macros: