fussybeaver / bollard

Docker daemon API in Rust
Apache License 2.0
863 stars 131 forks source link

Both ring and aws-lc-rs provider are enabled #440

Closed stormshield-gt closed 1 month ago

stormshield-gt commented 1 month ago

Even if the ring feature is enabled, default-feature of rustls are still enabled, so aws-lc-rs provider is also a dependency.

$ cargo tree --workspace --target all --all-features -i aws-lc-rs
aws-lc-rs v1.8.1
├── rustls v0.23.12
│   ├── bollard v0.17.0 (/tmp/bollard)
│   ├── hyper-rustls v0.27.2
│   │   └── bollard v0.17.0 (/tmp/bollard)
│   ├── tokio-rustls v0.26.0
│   │   └── hyper-rustls v0.27.2 (*)
│   └── ureq v2.10.0
│       ├── bollard-buildkit-proto v0.4.0 (/tmp/bollard/codegen/proto)
│       │   ├── bollard v0.17.0 (/tmp/bollard)
│       │   └── bollard-stubs v1.45.0-rc.26.0.1 (/tmp/bollard/codegen/swagger)
│       └── bollard-buildkit-proto v0.4.0
│           └── bollard-stubs v1.45.0-rc.26.0.1
│               └── bollard v0.17.0 (/tmp/bollard)
└── rustls-webpki v0.102.6
    └── rustls v0.23.12 (*)
$ cargo tree --workspace --target all --all-features -i ring
ring v0.17.8
├── rustls v0.23.12
│   ├── bollard v0.17.0 (/tmp/bollard)
│   ├── hyper-rustls v0.27.2
│   │   └── bollard v0.17.0 (/tmp/bollard)
│   ├── tokio-rustls v0.26.0
│   │   └── hyper-rustls v0.27.2 (*)
│   └── ureq v2.10.0
│       ├── bollard-buildkit-proto v0.4.0 (/tmp/bollard/codegen/proto)
│       │   ├── bollard v0.17.0 (/tmp/bollard)
│       │   └── bollard-stubs v1.45.0-rc.26.0.1 (/tmp/bollard/codegen/swagger)
│       └── bollard-buildkit-proto v0.4.0
│           └── bollard-stubs v1.45.0-rc.26.0.1
│               └── bollard v0.17.0 (/tmp/bollard)
└── rustls-webpki v0.102.6
    └── rustls v0.23.12 (*)

I'm not sure if this the wanted behavior, correct me if I'm wrong.

As bollard is meant to be used as a library, the current rustls recommendation is trying to fetch the provider from the process and not installing it. To make a comparison, libraris are not supposed to install the tracing subscriber.

But we can still provide a feature (ring for instance), that can be default, that provide installations. That's what the rest of the ecosystem tends to do, see tokio-rustls or hyper-rustls.

fussybeaver commented 1 month ago

Happy to accept a PR for this