ifsheldon requested fitzgen for a review on PR #9822.
ifsheldon requested wasmtime-core-reviewers for a review on PR #9822.
ifsheldon opened PR #9822 from ifsheldon:async_example
to bytecodealliance:main
:
Closes #9776
I reused most of example 4 to avoid extra complication. Also adds a reference to code example
wasi_async
, so it'd better if this gets merged after #9788.cc @alexcrichton
alexcrichton commented on PR #9822:
Thanks, and looks good to me! I think there's some errors on CI though?
ifsheldon commented on PR #9822:
Can you take a look into the clippy error please? The error seems to originate from
bindgen!
. I suspect that some code inbindgen!
forgets to importBox
when a WIT spec is inlined. In my own example that imports from a WIT file, there's no problem. In the example 4 where async is not used, it's also fine. I have no clue why that happened. The difference between_7_async.rs
and_4_imported_resources.rs
is just the lineasync: true,
alexcrichton commented on PR #9822:
Ah I believe this is exposing a preexisting bug in the
bindgen!
macro, notably the async output is not compatible with#![no_std]
crates. Thewasmtime
crate itself is such a crate which is where this is coming from.I'm not sure of a way to work around this other than fixing the issue at hand (tracking down the
Box
and importing it fromwasmtime::component::__internal::Box
)
ifsheldon commented on PR #9822:
I think for the purpose of documentation, it's okay to let clippy skip this file.
this is exposing a preexisting bug in the bindgen! macro, notably the async output is not compatible with #![no_std] crates. The wasmtime crate itself is such a crate which is where this is coming from.
IIUC, #9823 maybe unblock this?
I'm not sure of a way to work around this other than fixing the issue at hand
Can you try to fix this please? I'm not very familiar proc_macros or bindgen internals.
alexcrichton commented on PR #9822:
Yes #9823 would probably help. Unfortunately I don't have time right now to fix this myself, and this can't land unless it's passing CI.
ifsheldon commented on PR #9822:
OK...... Can you find the issue tracking the "preexisting bug" you mentioned? I can't find one to link here. Or, I can file a new one.
alexcrichton commented on PR #9822:
I don't believe there's a preexisting issue since this is I think the first time it's come up, but feel free to file an issue of course
ifsheldon commented on PR #9822:
OK, let's take a step back. Why need to build bindgen_examples inside
wasmtime
anyway? I think we can just move all the bindgen examples out ofwasmtime
crate.
alexcrichton commented on PR #9822:
It's not necessarily strictly required, but it's quite useful to be distributed as part of docs.rs integration. That gives nice API docs all in one place. Personally I think it'd probably be less effort to fix the code generation than it would be to move all the documentation somewhere else.
ifsheldon updated PR #9822.
ifsheldon commented on PR #9822:
OK, fine. I made a new commit which fixes the bug of bindgen. I know I should have open another PR/issue but it seems I need to provide an example to reproduce the bug, which is this very example, so I think it's okay to just fix it in this PR.
alexcrichton commented on PR #9822:
Thanks! I think some test expectations may need an update, but otherwise looks good :+1:
ifsheldon updated PR #9822.
ifsheldon updated PR #9822.
ifsheldon updated PR #9822.
alexcrichton submitted PR review.
alexcrichton merged PR #9822.
Last updated: Dec 23 2024 at 12:05 UTC