Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Stop automatically pulling in aws-lc as a dependency #46

Merged
merged 2 commits into from
Oct 6, 2024

Conversation

OverShifted
Copy link
Contributor

This fixes an issue I had when trying to cross-compile my project. aws-lc would refuse to compile due to some problems in their build system. Although it is not a tls-listener issue, allowing dependent crates to fine-tine features of nested dependencies is reasonable.

@tmccombs
Copy link
Owner

tmccombs commented Oct 3, 2024

Could this be done in a way that isn't backwards incompatible?

Maybe keep the rustls feature as using the defaults of rustls and having a rustls-core feature that doesn't have the defaults?

@OverShifted
Copy link
Contributor Author

@tmccombs I have pushed a new commit which aims to provide backwards compatibility.

rustls-aws-lc = ["rustls-core", "tokio-rustls/aws-lc-rs"]
rustls-fips = ["rustls-aws-lc", "tokio-rustls/fips"]
rustls-ring = ["rustls-core", "tokio-rustls/ring"]
rustls = ["rustls-aws-lc", "tokio-rustls/default"]
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should probably also include "tokio-rustls/tls12" and "tokio-rustls/logging" since those are included in the default features.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

But aren't we including the tokio-rustls/default feature already? It should pull them in.

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh, yeah you're right

@@ -9,7 +9,11 @@ license = "Apache-2.0"

[features]
default = ["tokio-net"]
rustls = ["tokio-rustls"]
rustls-core = ["tokio-rustls"]
rustls-aws-lc = ["rustls-core", "tokio-rustls/aws-lc-rs"]
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All these features aren't strictly necessary.

The user could potentially enable these features on the tokio-rustls dependency directly.

All this create actually needs to depend on is the core tokio-rustls api.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Well, you are right. But consider the fact that tokio-rustls which is also an "intermediate" crate between us and the actual rustls crate has similar feature flags which do nothing but pass themselves to rustls. (I've checked it's source code and they actually do nothing else)

@tmccombs tmccombs merged commit e09ed0c into tmccombs:main Oct 6, 2024
13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants