-
Notifications
You must be signed in to change notification settings - Fork 249
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
aws-config
depends on tokio
+mio
- breaks on WASM
#869
Comments
Hey @simbleau, thanks for submitting this issue. We'll add it to our backlog. I'll do a quick check today to see if this is an easy fix. |
Ongoing investigative PR: smithy-lang/smithy-rs#2919 |
Why are you adding the |
@rcoh - I was using the Without the |
It looks like you're targeting Node from the wasmpack command you gave. Wouldn't you need the WASM code to call into Javascript to use its HTTP client, or is networking exposed in some other way to the WASM runtime in this case? |
Would node make a difference here vs |
The target matters quite a bit right now since the SDK doesn't have a default HTTP connector that will work for WASM targets. The HTTP connector needs to be implemented and configured. This is illustrated in the WebAssembly example, which wires up a connector for use in a web browser: |
There have been a number of PRs to add better WASM support, so I suspect this has been resolved. We have a WASM integration that that is using aws-config with It looks like mio is no longer pulled into aws-config in that configuration:
Is this still an issue for you with the latest SDK? |
Greetings! It looks like this issue hasn’t been active in longer than a week. We encourage you to check if this is still an issue in the latest release. Because it has been longer than a week since the last update on this, and in the absence of more information, we will be closing this issue soon. If you find that this is still a problem, please feel free to provide a comment or add an upvote to prevent automatic closure, or if the issue is already closed, please feel free to open a new one. |
Hey I'll look into this soon. Don't close it :) |
This is still an issue, even with the suggested configuration of My
Compiling gives the following error:
|
I also still get mio. |
aws-config
(0.56) depends on tokio
+mio
- breaks on WASMaws-config
depends on tokio
+mio
- breaks on WASM
I was able to get it to work on Cloudflare workers but you have to disable retries, timeouts and stalled_stream_protection. Essentially anything that has to do with time as Cloudflare workers return a fixed time for the whole duration of the execution. |
Disclaimer: I have not used Cloudflare workers (and if they really return a fixed time for an entire execution that is definitely going to break things) I have an example of using the SDK in a WASM environment here: https://github.com/landonxjames/wasmtest (although it is based on WASM components so applicability to your use case might depend on if your WASM runtime supports components) Since it looks like Cloudflare workers support WASI that would probably be an easier path and we have an example of using the SDK in a WASI environment here: https://github.com/smithy-lang/smithy-rs/tree/main/tools/ci-cdk/canary-wasm and it makes use of the WASM support is one of our most upvoted issues (#59) and everything does work, but it is not well documented or particularly ergonomic, so I am hoping to work on improving that this year. |
@landonxjames Cloudflare workers doesn't really support Wasi in a usable matter.
Do you have an idea what kind of "things" will break? I could forgo retries and stuff like that but just wondering if there are libraries/features that won't work because of it. |
I read into this a bit more and the Cloudflare worker documentation on timers makes it a bit more nuanced. Seemingly the time in the environment only advances when IO has been performed. For our cases that could potentially allow some things to work, but without dedicated testing it is very hard to say. We didn't factor environments that provide IO based time stepping into our designs for the SDK. Off the top of my head this could break retries, credential refreshing, and stalled stream protection. |
Describe the bug
mio is not wasm-compatible, which is a dep of tokio.
In the latest version of aws-config (0.56) I believe there was a change, specifically around tls, which started to bring this in.
There are the features in aws-config:
So I think the idea is we are all migrating from native-tls to rustls?
Here's whats in my toml:
And wallah - Here's my
cargo tree
:Expected Behavior
safe compile with wasm-pack
Current Behavior
You get this heap of errors related to mio:
seanmonstar/reqwest#1300
Reproduction Steps
wasm-pack test --node
Possible Solution
No response
Additional Information/Context
No response
Version
Environment details (OS name and version, etc.)
MacOS Ventura
Logs
No response
The text was updated successfully, but these errors were encountered: