Uploaded image for project: 'Rust Driver'
  1. Rust Driver
  2. RUST-1466

Ensure tokio runtime is only built when tokio-runtime feature flag is enabled

    • Type: Icon: Improvement Improvement
    • Resolution: Works as Designed
    • Priority: Icon: Minor - P4 Minor - P4
    • None
    • Affects Version/s: None
    • Component/s: None

      Right now, our tokio dependency pulls in some heavy transitive dependencies, even when using the async-std-runtime. We should fix this so that only the light, cross-platform things we need are pulled in when not using the tokio-runtime feature flag.

      It looks like trust-dns-resolver and trust-dns-proto are the ones pulling in all of tokio.

      tokio portion of the output of cargo tree --no-default-features --features async-std-runtime :

      │       ├── tokio v1.21.0
      │       │   ├── bytes v1.2.1
      │       │   ├── libc v0.2.132
      │       │   ├── memchr v2.5.0
      │       │   ├── mio v0.8.4
      │       │   │   ├── libc v0.2.132
      │       │   │   └── log v0.4.17 (*)
      │       │   ├── num_cpus v1.13.1
      │       │   │   └── libc v0.2.132
      │       │   ├── once_cell v1.14.0
      │       │   ├── pin-project-lite v0.2.9
      │       │   ├── socket2 v0.4.7 (*)
      │       │   └── tokio-macros v1.8.0 (proc-macro)
      │       │       ├── proc-macro2 v1.0.43 (*)
      │       │       ├── quote v1.0.21 (*)
      │       │       └── syn v1.0.99 (*)
      

      Note that this is a lighter ask than RUST-473, which suggests removing the tokio dependency altogether when using async-std.

            Assignee:
            Unassigned Unassigned
            Reporter:
            patrick.freed@mongodb.com Patrick Freed
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: