-
Notifications
You must be signed in to change notification settings - Fork 1k
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
tonic
depends on rustls
API that isn't guaranteed to exist in minimum dependency version
#1510
Comments
I don't think in general README example code should require min versions to be correct, that's too strict a requirement on usage snippets. However, I agree that the actual lib code should compile with the min dependency versions:
👍 This seems doable, I would also import the trait directly from rustls too. |
I assume this is happening because its not getting updated in your lockfile since a new pull of the project should bring in the latest. But I think you're right we should force the min version as well. I'd take a PR updating that and we can try to get a patch release out. Thanks! |
Ah actually now that I read this again I think this needs to be fixed in tokio-rustls rather than tonic depending on rustls directly, I don't think that is the right solution. |
I don't think there is a bug in tokio-rustls here -- tokio-rustls isn't depending on the new rustls API directly, so there's no reason for it to require newer rustls. If tonic wants to rely on newer rustls it should ensure the rustls version that is being pulled into its dependency graph is new enough -- or stick with the deprecated API for now instead. |
Bug Report
Version
tonic 0.10.0
Description
#1443 migrated from the deprecated
RootCertStore::add_server_trust_anchors
to the newRootCertStore::add_trust_anchors
. However, the latter was only released inrustls 0.21.6
, whiletonic 0.10.0
has an implicit lower version bound onrustls 0.21.0
.tonic
does not depend directly onrustls
, instead using the re-exported version fromtokio-rustls 0.24
(from which it obtains its implicit lower version bound).This hit me because the update from
tonic 0.9
totonic 0.10
didn't need to bumptokio-rustls
, so I didn't initially bump any of my other dependencies. It was only when compilation broke and I dug into why that I uncovered this issue.tonic
should instead add an explicit dependency onrustls = "0.21.6"
to ensure that the API it is using exists, even if it continues to access it through thetokio-rustls
re-export.I opened rustls/tokio-rustls#18 about the fact that their examples also use this new API without bumping the minimum
rustls
version; had they done this, thetonic
issue would have been incidentally fixed. But sadly that isn't something we can rely on for transitive dependencies (and it would have been entirely valid fortokio-rustls
to continue to recommend the deprecated API in their examples and README). So untilcargo
provides a better way to handle patch updates to transient dependencies, the core fix needs to be here.The text was updated successfully, but these errors were encountered: