-
Notifications
You must be signed in to change notification settings - Fork 71
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
Disable rustls's aws-lc-rs feature #71
base: main
Are you sure you want to change the base?
Conversation
Sorry for the delay, but I fail to see the issue. Is there any way we can reproduce the issue ? Whatever the bug, I feel like it's a non fixable issue since the issue would arise with the other feature enabled. I think the solution provided in code is the solution, if both are specified, user needs to install the crypto provider manually (or the default). No ? |
When both the `ring` and `aws-lr-rs` features in `rustls` are enabled, the rustls `CryptoProvider` installer from crate features no longer works, as the provider to be used is ambiguous [1]. This is the default configuration and feature set that other dependencies like `reqwest` are using. [1]: https://docs.rs/rustls/latest/src/rustls/crypto/mod.rs.html#261-282
0991d79
to
d91ef46
Compare
Yes, this is basically the issue. All other crates in the ecosystem have their features set up in a way, that either the aws OR the ring provider is used and never both, depending on which features you set for those crates. Let me describe the issue in a bit more detail:
Why is this a problem for hf-hub? Well, it isn't really your problem. But changing the As Line 46 in edda880
chooses to use reqwest with the rustls-tls feature, hf-hub indirectly also chooses ring as a provider through the reqwest dependency. reqwest , hyper , tokio , ureq , ... are all setup, so that you can choose ring OR aws-lc-rs as a crypto provider through feature flags, or use (in the case of ureq ) ring as the default provider w/o the option of picking aws-lc-rs .
So when As the To reproduce: Using $ cargo new hf-hub-dep-test
$ cd hf-hub-dep-test
$ cargo add --git https://github.com/huggingface/hf-hub --branch main --no-default-features --features rustls-tls,tokio,ureq
$ rg "aws-lc-rs" Cargo.lock
42:name = "aws-lc-rs"
1239: "aws-lc-rs",
1273: "aws-lc-rs", Using the branch of this PR: $ cargo new hf-hub-dep-test
$ cd hf-hub-dep-test
$ cargo add --git https://github.com/flip1995/hf-hub --branch rustls-features --no-default-features --features rustls-tls,tokio,ureq
$ rg "aws-lc-rs" Cargo.lock
# No output |
@@ -43,7 +45,7 @@ default = ["default-tls", "tokio", "ureq"] | |||
# These features are only relevant when used with the `tokio` feature, but this might change in the future. | |||
default-tls = [] | |||
native-tls = ["dep:reqwest", "reqwest/default", "dep:native-tls", "ureq/native-tls"] | |||
rustls-tls = ["dep:rustls", "reqwest/rustls-tls"] | |||
rustls-tls = ["dep:reqwest", "dep:rustls", "reqwest/rustls-tls"] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I also added back the dep:reqwest
to the rustls-tls
feature, as it didn't make sense to me not to depend on this crate in the rustls-tls
case. LMK if I missed something.
When both the
ring
andaws-lc-rs
features inrustls
are enabled, the rustlsCryptoProvider
installer from crate features no longer works, as the provider to be used is ambiguous 1.This is the default configuration and feature set that other dependencies like
reqwest
are using.