aws-sdk-rust icon indicating copy to clipboard operation
aws-sdk-rust copied to clipboard

`aws-config` depends on `tokio`+`mio` - breaks on WASM

Open simbleau opened this issue 2 years ago • 12 comments
trafficstars

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:

[features]
allow-compilation = []
client-hyper = ["aws-smithy-client/client-hyper"]
credentials-sso = ["dep:aws-sdk-sso", "dep:ring", "dep:hex", "dep:zeroize"]
default = ["client-hyper", "rustls", "rt-tokio", "credentials-sso"]
native-tls = []
rt-tokio = ["aws-smithy-async/rt-tokio", "tokio/rt"]
rustls = ["aws-smithy-client/rustls", "client-hyper"]

So I think the idea is we are all migrating from native-tls to rustls?

Here's whats in my toml:

aws-config = { version = "0.56", default-features = false, features = [
  "rustls",
] }

And wallah - Here's my cargo tree:

├── aws-config v0.56.0
│   ├── aws-credential-types v0.56.0
│   │   ├── aws-smithy-async v0.56.0
│   │   │   ├── futures-util v0.3.28 (*)
│   │   │   ├── pin-project-lite v0.2.12
│   │   │   ├── tokio v1.31.0
│   │   │   │   ├── bytes v1.4.0 (*)
│   │   │   │   ├── libc v0.2.147
│   │   │   │   ├── mio v0.8.8            <---- NOT GOOD!
│   │   │   │   │   └── libc v0.2.147
│   │   │   │   ├── num_cpus v1.16.0
│   │   │   │   │   └── libc v0.2.147

Expected Behavior

safe compile with wasm-pack

Current Behavior

You get this heap of errors related to mio: https://github.com/seanmonstar/reqwest/issues/1300

Reproduction Steps

wasm-pack test --node

Possible Solution

No response

Additional Information/Context

No response

Version

aws-config 0.56

Environment details (OS name and version, etc.)

MacOS Ventura

Logs

No response

simbleau avatar Aug 13 '23 00:08 simbleau