-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
Begin implementation of wasi-http #5929
Conversation
f746c98
to
9506b57
Compare
@pchickey I think this is ready for an initial high-level review. Everything is implemented in terms of the This means that it is very forward compatible with the component model linker going forward. If you can take a quick look at the rough layout and see if this is on the path to merging that would be great. After we get the rough layout right, we can move on to a more detailed review. Thanks! |
There's also a pretty extensive example that can be used to test this implementation in |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Exciting! Here's my first pass of feedback
}, | ||
)?; | ||
linker.func_wrap( | ||
"types", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm a bit surprised all these functions landed in the types
module name, that may be something we have to look into...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yeah, surprised me to, seems like some sort of aliasing in wit-bindgen
Comments addressed Please take another look. |
crates/wasi-http/src/http_impl.rs
Outdated
crate::types::Method::Options => Method::OPTIONS, | ||
crate::types::Method::Trace => Method::TRACE, | ||
crate::types::Method::Patch => Method::PATCH, | ||
_ => return Err(anyhow::anyhow!("unknown method!")), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
_ => return Err(anyhow::anyhow!("unknown method!")), | |
_ => return bail!("unknown method!"), |
fe8cef7
to
63887e0
Compare
Ok, this was switched to hyper. I'm not sure it really saved you very many dependencies, but if there are other ways to reduce the dependency count, let me know. Hyper doesn't implement TLS, so I had to pull in I think this is ready to go, let me know if there is a good way to add tests, it seems the other modules don't really have tests. |
Ok, I implemented timeouts. I think that the client side implementation is now basically feature complete. Ready for a more detailed review whenever you have time. Thanks! |
Oh, and I plan on starting the server side implementation in a different branch. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have tested this with a real-life Wasm module and it works as expected.
Co-authored-by: Eduardo de Moura Rodrigues <16357187+eduardomourar@users.noreply.github.com>
Co-authored-by: Eduardo de Moura Rodrigues <16357187+eduardomourar@users.noreply.github.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
mostly lgtm!
@pchickey I conditionalized tls to disable it on
Turns out the gh status was just cached and lagging, Turns out that |
Fix formatting, also disable tls on s390x
cc @pchickey Ok, next issue hit: The The challenge is that if we want to pull the I can get rid of the git submodule, and just check in the Let me know what you think. ` |
It looks like maybe setting |
Is it possible to modify the macro to have a configurable path? I think we'd probably prefer that over most any directory-structure or build-time hack (symlinks, copying files, or the like). |
I believe the macro does accept a path property and you can check it here: https://github.com/bytecodealliance/wasmtime/blob/main/crates/component-macro/tests/codegen.rs |
@eduardomourar thanks for the pointer (I don't think that's documented anywhere :() I updated this to use crosses fingers |
Add a path parameter to wit-bindgen, remove symlink.
9f18454
to
85a2e52
Compare
Fix tests for places where SSL isn't supported.
@pchickey This passed complete CI, but it needed a rebase. I'm pretty sure that it will pass the merge queue this time. Thanks for the patience! |
🥂 🎊 🥂 Thanks for the patience here, I'll send in some follow-on PRs. |
Initial draft, working, but with limitations.
Known issues:
Body for requests is not supportedRequest options (e.g. timeout values) are not supported.There are panics all over the place if you pass in bad pointers or unexpected values.