-
Notifications
You must be signed in to change notification settings - Fork 213
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
feat: add support for stream
with no <T>
#1130
Conversation
8a8e5ac
to
7a8f757
Compare
I'm not sure what the policy on pulling in bleeding-edge changes from https://github.com/bytecodealliance/wasm-tools is, I feel like I'll probably have to wait for a new release, but I'm also not sure how soon that would happen, so marking the PR ready for review with the git deps |
Ah yes to merge this it'll need to be a crates.io-based dependency. There's some documentation on releases for wasm-tools but the tl;dr; is that it's on-demand. I personally prefer to spread out releases where possible, so if it's ok I'd prefer that this were integrated into other in-development systems first to make sure it works and then once it's reasonably confident no major changes are needed here the cranks can be turned. |
@rvolosatovs I'm about to update my Wasmtime async branch to use both |
Actually, I'll use the |
Actually, actually, I used the |
I've split this out of bytecodealliance#9582 to make review easier. This patch adds async/stream/future/error-context support to the host binding generator, along with placeholder type and function definitions in the `wasmtime` crate which the generated bindings can refer to. See https://github.com/dicej/rfcs/blob/component-async/accepted/component-model-async.md#componentbindgen-updates for the design and rationale. Note that I've added temporary `[patch.crates-io]` overrides in Cargo.toml until bytecodealliance/wit-bindgen#1130 and bytecodealliance/wasm-tools#1978 have been released. Also note that we emit a `T: 'static` bound for `AsContextMut<Data = T>` when generating bindings with `concurrent_imports: true`. This is only because `rustc` insists that the closure we're passing to `LinkerInstance::func_wrap_concurrent` captures the lifetime of `T` despite my best efforts to convince it otherwise. Alex and I suspect this is a limitation in the compiler, and I asked about it on the rust-lang Zulip, but we haven't been able to determine a workaround so far. Signed-off-by: Joel Dice <[email protected]>
Signed-off-by: Roman Volosatovs <[email protected]> test: return `future` in future return test WIT Signed-off-by: Roman Volosatovs <[email protected]> build: update wasm-tools Signed-off-by: Roman Volosatovs <[email protected]> avoid divide-by-zero in `StreamReader::poll_next` I hit this when testing "unit streams" (i.e. streams with no payload type) end-to-end. BTW, I can't wait to get some runtime tests going in this repo so we can catch this kind of thing in CI. Signed-off-by: Joel Dice <[email protected]>
94c0ff3
to
43ba064
Compare
Signed-off-by: Joel Dice <[email protected]>
I've split this out of bytecodealliance#9582 to make review easier. This patch adds async/stream/future/error-context support to the host binding generator, along with placeholder type and function definitions in the `wasmtime` crate which the generated bindings can refer to. See https://github.com/dicej/rfcs/blob/component-async/accepted/component-model-async.md#componentbindgen-updates for the design and rationale. Note that I've added temporary `[patch.crates-io]` overrides in Cargo.toml until bytecodealliance/wit-bindgen#1130 and bytecodealliance/wasm-tools#1978 have been released. Also note that we emit a `T: 'static` bound for `AsContextMut<Data = T>` when generating bindings with `concurrent_imports: true`. This is only because `rustc` insists that the closure we're passing to `LinkerInstance::func_wrap_concurrent` captures the lifetime of `T` despite my best efforts to convince it otherwise. Alex and I suspect this is a limitation in the compiler, and I asked about it on the rust-lang Zulip, but we haven't been able to determine a workaround so far. Signed-off-by: Joel Dice <[email protected]> remove obsolete TODO comment Signed-off-by: Joel Dice <[email protected]> make `futures` dep optional Signed-off-by: Joel Dice <[email protected]> update `wasm-tools` and `wit-bindgen` Signed-off-by: Joel Dice <[email protected]>
I've split this out of #9582 to make review easier. This patch adds async/stream/future/error-context support to the host binding generator, along with placeholder type and function definitions in the `wasmtime` crate which the generated bindings can refer to. See https://github.com/dicej/rfcs/blob/component-async/accepted/component-model-async.md#componentbindgen-updates for the design and rationale. Note that I've added temporary `[patch.crates-io]` overrides in Cargo.toml until bytecodealliance/wit-bindgen#1130 and bytecodealliance/wasm-tools#1978 have been released. Also note that we emit a `T: 'static` bound for `AsContextMut<Data = T>` when generating bindings with `concurrent_imports: true`. This is only because `rustc` insists that the closure we're passing to `LinkerInstance::func_wrap_concurrent` captures the lifetime of `T` despite my best efforts to convince it otherwise. Alex and I suspect this is a limitation in the compiler, and I asked about it on the rust-lang Zulip, but we haven't been able to determine a workaround so far. remove obsolete TODO comment make `futures` dep optional update `wasm-tools` and `wit-bindgen` Signed-off-by: Joel Dice <[email protected]>
* async/stream/future support for wasmtime-wit-bindgen I've split this out of #9582 to make review easier. This patch adds async/stream/future/error-context support to the host binding generator, along with placeholder type and function definitions in the `wasmtime` crate which the generated bindings can refer to. See https://github.com/dicej/rfcs/blob/component-async/accepted/component-model-async.md#componentbindgen-updates for the design and rationale. Note that I've added temporary `[patch.crates-io]` overrides in Cargo.toml until bytecodealliance/wit-bindgen#1130 and bytecodealliance/wasm-tools#1978 have been released. Also note that we emit a `T: 'static` bound for `AsContextMut<Data = T>` when generating bindings with `concurrent_imports: true`. This is only because `rustc` insists that the closure we're passing to `LinkerInstance::func_wrap_concurrent` captures the lifetime of `T` despite my best efforts to convince it otherwise. Alex and I suspect this is a limitation in the compiler, and I asked about it on the rust-lang Zulip, but we haven't been able to determine a workaround so far. Signed-off-by: Joel Dice <[email protected]> remove obsolete TODO comment Signed-off-by: Joel Dice <[email protected]> make `futures` dep optional Signed-off-by: Joel Dice <[email protected]> update `wasm-tools` and `wit-bindgen` Signed-off-by: Joel Dice <[email protected]> * run cargo vet Signed-off-by: Joel Dice <[email protected]> --------- Signed-off-by: Joel Dice <[email protected]>
Refs bytecodealliance/wasm-tools#1978
Refs WebAssembly/component-model#440