-
Notifications
You must be signed in to change notification settings - Fork 59
wit-bindgen async-spawn feature flag (#1) #135
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
Conversation
|
Thanks! It's intentional that the main crate doesn't depend on |
|
Certainly, I'll do this this afternoon. While you are there, I am getting a separate but related issue: Once compiled, when I try to run a simple http guest (using wasmtime 39.0.0) I am getting the following error: A quick look using a hex editor show the offending byte is the Do you have any thoughts before I invest too much time? |
|
That's "just" a version mismatch in that you're running a binary in Wasmtime-too-old to support it. This is a recently-done change for component-model-async, and you'll want to use Wasmtime's |
|
Hah! I'm glad I asked It would have taken me a while to get there. Thanks. |
|
@alexcrichton I've finally had a chance to get back to this and can report the changes you requested are quite straightforward. However, I've had a bit of a struggle getting a build working. There are 2 ways I can get a successful build:
I have no idea why option 2 works. I can even use a path-based reference to wasip3/examples/http-proxy.rs in the For now, I am proposing to use +nightly when building the wasip3 crate in the GitHub workflow (unless it magically works on linux/amd). Thoughts? |
|
Sorry I'm not sure I understand, why is nightly related here? Do you have logs or something similar to look at? FWIW locally in this repository I can reproduce the failure with diff --git a/crates/wasip3/Cargo.toml b/crates/wasip3/Cargo.toml
index dff0c16..cfadb6e 100644
--- a/crates/wasip3/Cargo.toml
+++ b/crates/wasip3/Cargo.toml
@@ -17,6 +17,7 @@ http-compat = [
"dep:http-body",
"dep:http",
"dep:thiserror",
+ "wit-bindgen/async-spawn",
]
[dependencies] |
|
Yes, that is the change I have made. I was in the process of adding the CI check and realised I could not build the example locally. Running results in the following linker error: Running gives me a clean build. The other thing to note is that I have not regenerated the pre-compiled code (proxy.rs, imports.rs, command.rs) using wit-bindgen:0.48.1. |
|
Ah yes that's expected given a recent change to wasip3, but I'm not sure what you meant in (2) above with |
|
(2) was the observation that, weirdly, I can build and run the example from a pre-existing project. I don't believe I'm sufficiently familiar with the intricacies of Rust to completely understand why. And I may well have gotten my wires crossed somewhere along the way. The project extends For interest, here's the relevant Cargo : I can build and successfully run the example but only from the abovementioned project. |
|
Ah ok, in that case it might have to do with the fact that these custom sections and such are dependent on various linker shenanigans as to whether they show up in the final artifact. This means that subtle shifts in code can cause large changes in the output. Overall I wouldn't worry too much about it -- if it doesn't compile it's because something needs updating, and if it does compile then it means that the parts which required an updated weren't included so an update wasn't needed. |
* fix feature flag * only turn on async-spawn feature when using http-compat * add CI check for http-compat feature * revert inadvertent format changes
* revert async-spawn -> async * simplify ci * trigger workflow * update generated code * revert generated code * bump wit-bindgen version in ci * update generated code * revert generated code * use wasm-tools to run component * use wasm-tools to run component * use wasm-tools to run component * debug ci issue * debug ci issue * debug ci issue * debug ci issue * debug ci issue * debug ci issue * fix fmt
|
Thank you. One interesting takeaway was the |
This PR fixes an issue when using the wasip3
http-compatfeature.When the feature is turned on, the
http_compat::conversionsmodule useswit_bindgen::spawnwhich is now (since 0.48.0) gated behind theasync-spawnfeature flag.