awslabs / awslabs/aws-sdk-rust

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

Open
#869 16 comments 0 reactions 0 assignees View on GitHub
bug p2
Dominant language
Rust
Stars
3.3k
Forks
290
Avg merge
1d 12h
Merged PRs (30d)
3

Description

### 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:
```toml
[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:
```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

```text
aws-config 0.56
```

### Environment details (OS name and version, etc.)

MacOS Ventura

### Logs

_No response_

Contributor guide

Open the contributing guide

Research direction

Start by inspecting the aws-config feature definitions and the dependency tree for the reported default-features=false, rustls configuration. Run wasm-pack test --node and verify that the feature combination compiles for WASM without pulling in mio-related errors.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust, wasm
Domain
build-system
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.