Skip to content

supporting range of breaking change versions for tokio-rustls causes dependency hell #52

@TheButlah

Description

@TheButlah

The use of >=0.25.0,<0.27 in the versioning for tokio-rustls is causing dependency hell. While well intentioned, the issue is that cargo doesnt provide a way to choose which version of tokio-rustls will be chosen for users of tls-listener. Even if downstream users use the reexported tokio-rustls from tls-listener, its not actually safe/possible to do this, because the two tokio-rustls versions have breaking changes. So depending on which apis are needed, we can't actually use the re-export.

For example, suppose I need install_default(), there is no way to force tls-listener to use the correct matching tokio-rustls, and by extension rustls, version.

Conceptually this is because re-exporting tokio-rustls means that this crate has breaking changes depending on whether tokio-rustls 0.25 or 0.26 is chosen by the dependency resolver algorithm.

I suggest releasing a new major version of tls-listener that either:

  • Continues the re-export and uses only one major version for tokio-rustls (0.26)
  • Has two dependencies both of which are optional and controlled by feature flags: tokio-rustls-025 and tokio-rustls-026. Each should be re-exported as differently named exports. Note: its important that both the tokio-rustls-025 and tokio-rustls-026 feature flags can be provided at the same time, without any breaking changes, feature flags cannot be mutually exclusive.

As an example of how this can manifest in real world scenarios, see eclipse-zenoh/zenoh#1747

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions