durch / rust-s3

Rust library for interfacing with S3 API compatible services

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Compiling with "tokio-rustls-tls" and default-features = false still depends on native-tls

lucasmerlin opened this issue · comments

Describe the bug
After updating to rust-s3 "0.34.0-rc4" from "0.33" rust-s3 now includes native-tls as a dependency even though I added the "tokio-rustls-tls" feature and disabled the default features.

To Reproduce
Add the following to a empty rust project:
rust-s3 = { version = "0.34.0-rc4", default-features = false, features = ["tokio-rustls-tls"] }

run cargo tree and you should see native-tls included somewhere:

Details

rust-playground v0.1.0 (/Users/lucasprivat/IdeaProjects/rust-playground)
└── rust-s3 v0.34.0-rc4
    ├── async-trait v0.1.74 (proc-macro)
    │   ├── proc-macro2 v1.0.69
    │   │   └── unicode-ident v1.0.12
    │   ├── quote v1.0.33
    │   │   └── proc-macro2 v1.0.69 (*)
    │   └── syn v2.0.39
    │       ├── proc-macro2 v1.0.69 (*)
    │       ├── quote v1.0.33 (*)
    │       └── unicode-ident v1.0.12
    ├── aws-creds v0.36.0
    │   ├── attohttpc v0.26.1
    │   │   ├── http v0.2.11
    │   │   │   ├── bytes v1.5.0
    │   │   │   ├── fnv v1.0.7
    │   │   │   └── itoa v1.0.9
    │   │   ├── log v0.4.20
    │   │   ├── rustls v0.21.9
    │   │   │   ├── log v0.4.20
    │   │   │   ├── ring v0.17.5
    │   │   │   │   ├── getrandom v0.2.11
    │   │   │   │   │   ├── cfg-if v1.0.0
    │   │   │   │   │   └── libc v0.2.150
    │   │   │   │   └── untrusted v0.9.0
    │   │   │   │   [build-dependencies]
    │   │   │   │   └── cc v1.0.83
    │   │   │   │       └── libc v0.2.150
    │   │   │   ├── rustls-webpki v0.101.7
    │   │   │   │   ├── ring v0.17.5 (*)
    │   │   │   │   └── untrusted v0.9.0
    │   │   │   └── sct v0.7.1
    │   │   │       ├── ring v0.17.5 (*)
    │   │   │       └── untrusted v0.9.0
    │   │   ├── serde v1.0.192
    │   │   │   └── serde_derive v1.0.192 (proc-macro)
    │   │   │       ├── proc-macro2 v1.0.69 (*)
    │   │   │       ├── quote v1.0.33 (*)
    │   │   │       └── syn v2.0.39 (*)
    │   │   ├── serde_json v1.0.108
    │   │   │   ├── itoa v1.0.9
    │   │   │   ├── ryu v1.0.15
    │   │   │   └── serde v1.0.192 (*)
    │   │   ├── url v2.4.1
    │   │   │   ├── form_urlencoded v1.2.0
    │   │   │   │   └── percent-encoding v2.3.0
    │   │   │   ├── idna v0.4.0
    │   │   │   │   ├── unicode-bidi v0.3.13
    │   │   │   │   └── unicode-normalization v0.1.22
    │   │   │   │       └── tinyvec v1.6.0
    │   │   │   │           └── tinyvec_macros v0.1.1
    │   │   │   └── percent-encoding v2.3.0
    │   │   └── webpki-roots v0.25.2
    │   ├── home v0.5.5
    │   ├── log v0.4.20
    │   ├── quick-xml v0.30.0
    │   │   ├── memchr v2.6.4
    │   │   └── serde v1.0.192 (*)
    │   ├── rust-ini v0.19.0
    │   │   ├── cfg-if v1.0.0
    │   │   └── ordered-multimap v0.6.0
    │   │       ├── dlv-list v0.5.2
    │   │       │   └── const-random v0.1.17
    │   │       │       └── const-random-macro v0.1.16 (proc-macro)
    │   │       │           ├── getrandom v0.2.11 (*)
    │   │       │           ├── once_cell v1.18.0
    │   │       │           └── tiny-keccak v2.0.2
    │   │       │               └── crunchy v0.2.2
    │   │       └── hashbrown v0.13.2
    │   ├── serde v1.0.192 (*)
    │   ├── thiserror v1.0.50
    │   │   └── thiserror-impl v1.0.50 (proc-macro)
    │   │       ├── proc-macro2 v1.0.69 (*)
    │   │       ├── quote v1.0.33 (*)
    │   │       └── syn v2.0.39 (*)
    │   ├── time v0.3.30
    │   │   ├── deranged v0.3.9
    │   │   │   ├── powerfmt v0.2.0
    │   │   │   └── serde v1.0.192 (*)
    │   │   ├── itoa v1.0.9
    │   │   ├── powerfmt v0.2.0
    │   │   ├── serde v1.0.192 (*)
    │   │   ├── time-core v0.1.2
    │   │   └── time-macros v0.2.15 (proc-macro)
    │   │       └── time-core v0.1.2
    │   └── url v2.4.1 (*)
    ├── aws-region v0.25.4
    │   └── thiserror v1.0.50 (*)
    ├── base64 v0.21.5
    ├── bytes v1.5.0
    ├── cfg-if v1.0.0
    ├── futures v0.3.29
    │   ├── futures-channel v0.3.29
    │   │   ├── futures-core v0.3.29
    │   │   └── futures-sink v0.3.29
    │   ├── futures-core v0.3.29
    │   ├── futures-executor v0.3.29
    │   │   ├── futures-core v0.3.29
    │   │   ├── futures-task v0.3.29
    │   │   └── futures-util v0.3.29
    │   │       ├── futures-channel v0.3.29 (*)
    │   │       ├── futures-core v0.3.29
    │   │       ├── futures-io v0.3.29
    │   │       ├── futures-macro v0.3.29 (proc-macro)
    │   │       │   ├── proc-macro2 v1.0.69 (*)
    │   │       │   ├── quote v1.0.33 (*)
    │   │       │   └── syn v2.0.39 (*)
    │   │       ├── futures-sink v0.3.29
    │   │       ├── futures-task v0.3.29
    │   │       ├── memchr v2.6.4
    │   │       ├── pin-project-lite v0.2.13
    │   │       ├── pin-utils v0.1.0
    │   │       └── slab v0.4.9
    │   │           [build-dependencies]
    │   │           └── autocfg v1.1.0
    │   ├── futures-io v0.3.29
    │   ├── futures-sink v0.3.29
    │   ├── futures-task v0.3.29
    │   └── futures-util v0.3.29 (*)
    ├── hex v0.4.3
    ├── hmac v0.12.1
    │   └── digest v0.10.7
    │       ├── block-buffer v0.10.4
    │       │   └── generic-array v0.14.7
    │       │       └── typenum v1.17.0
    │       │       [build-dependencies]
    │       │       └── version_check v0.9.4
    │       ├── crypto-common v0.1.6
    │       │   ├── generic-array v0.14.7 (*)
    │       │   └── typenum v1.17.0
    │       └── subtle v2.5.0
    ├── http v0.2.11 (*)
    ├── hyper v0.14.27
    │   ├── bytes v1.5.0
    │   ├── futures-channel v0.3.29 (*)
    │   ├── futures-core v0.3.29
    │   ├── futures-util v0.3.29 (*)
    │   ├── http v0.2.11 (*)
    │   ├── http-body v0.4.5
    │   │   ├── bytes v1.5.0
    │   │   ├── http v0.2.11 (*)
    │   │   └── pin-project-lite v0.2.13
    │   ├── httparse v1.8.0
    │   ├── httpdate v1.0.3
    │   ├── itoa v1.0.9
    │   ├── pin-project-lite v0.2.13
    │   ├── socket2 v0.4.10
    │   │   └── libc v0.2.150
    │   ├── tokio v1.34.0
    │   │   ├── bytes v1.5.0
    │   │   ├── libc v0.2.150
    │   │   ├── mio v0.8.9
    │   │   │   └── libc v0.2.150
    │   │   ├── pin-project-lite v0.2.13
    │   │   └── socket2 v0.5.5
    │   │       └── libc v0.2.150
    │   ├── tower-service v0.3.2
    │   ├── tracing v0.1.40
    │   │   ├── pin-project-lite v0.2.13
    │   │   └── tracing-core v0.1.32
    │   │       └── once_cell v1.18.0
    │   └── want v0.3.1
    │       └── try-lock v0.2.4
    ├── hyper-tls v0.5.0
    │   ├── bytes v1.5.0
    │   ├── hyper v0.14.27 (*)
    │   ├── native-tls v0.2.11
    │   │   ├── lazy_static v1.4.0
    │   │   ├── libc v0.2.150
    │   │   ├── security-framework v2.9.2
    │   │   │   ├── bitflags v1.3.2
    │   │   │   ├── core-foundation v0.9.3
    │   │   │   │   ├── core-foundation-sys v0.8.4
    │   │   │   │   └── libc v0.2.150
    │   │   │   ├── core-foundation-sys v0.8.4
    │   │   │   ├── libc v0.2.150
    │   │   │   └── security-framework-sys v2.9.1
    │   │   │       ├── core-foundation-sys v0.8.4
    │   │   │       └── libc v0.2.150
    │   │   ├── security-framework-sys v2.9.1 (*)
    │   │   └── tempfile v3.8.1
    │   │       ├── cfg-if v1.0.0
    │   │       ├── fastrand v2.0.1
    │   │       └── rustix v0.38.24
    │   │           ├── bitflags v2.4.1
    │   │           ├── errno v0.3.7
    │   │           │   └── libc v0.2.150
    │   │           └── libc v0.2.150
    │   ├── tokio v1.34.0 (*)
    │   └── tokio-native-tls v0.3.1
    │       ├── native-tls v0.2.11 (*)
    │       └── tokio v1.34.0 (*)
    ├── log v0.4.20
    ├── maybe-async v0.2.7 (proc-macro)
    │   ├── proc-macro2 v1.0.69 (*)
    │   ├── quote v1.0.33 (*)
    │   └── syn v1.0.109
    │       ├── proc-macro2 v1.0.69 (*)
    │       ├── quote v1.0.33 (*)
    │       └── unicode-ident v1.0.12
    ├── md5 v0.7.0
    ├── native-tls v0.2.11 (*)
    ├── percent-encoding v2.3.0
    ├── quick-xml v0.30.0 (*)
    ├── serde v1.0.192 (*)
    ├── serde_derive v1.0.192 (proc-macro) (*)
    ├── serde_json v1.0.108 (*)
    ├── sha2 v0.10.8
    │   ├── cfg-if v1.0.0
    │   ├── cpufeatures v0.2.11
    │   │   └── libc v0.2.150
    │   └── digest v0.10.7 (*)
    ├── thiserror v1.0.50 (*)
    ├── time v0.3.30 (*)
    ├── tokio v1.34.0 (*)
    ├── tokio-native-tls v0.3.1 (*)
    ├── tokio-stream v0.1.14
    │   ├── futures-core v0.3.29
    │   ├── pin-project-lite v0.2.13
    │   └── tokio v1.34.0 (*)
    └── url v2.4.1 (*)

Expected behavior
Native-tls should not be included with the shown configuration.

Environment

  • Rust version: [e.g. 1.73]
  • lib version [e.g. 0.34-rc4]

Additional context
Seems like the problem is the with-tokio feature in rust-s3's Cargo.toml:

with-tokio = [
    "hyper",
    "hyper-tls",
    "tokio",
    "tokio/fs",
    "tokio-stream",
    "tokio-native-tls",
    "native-tls",
    "futures",
]

I tried removing the native-tls dependencies but realized that rust-s3 was changed to depend directly on hyper-tls which doesn't seem to support rustls. So I guess fixing this would be a bigger change?