Remove curl dependency from crates-io crate#16936
Remove curl dependency from crates-io crate#16936arlosi wants to merge 5 commits intorust-lang:masterfrom
Conversation
The request_blocking method does not use the `Client`-level timeout management, since it blocks, running the request on the current thread. This leaves the request_blocking method with no timeout configured. The change adds the timeout for consistency with the `http::http_handle` method.
This is needed since in our testing framework we use file:// URLs. With upload(true), the test files are overwritten as empty before they are read. This leads to the yank tests failing. In a real (non-file://) registry api, this would have no impact.
|
r? @weihanglo rustbot has assigned @weihanglo. Use Why was this reviewer chosen?The reviewer was selected based on:
|
This is a breaking change in the crates-io crate. It removes the dependency on curl. Users using this crate will need to provide their own implementation of the HttpClient trait using curl or another http request library.
|
This is a breaking change for the @rfcbot fcp merge cargo |
This comment was marked as outdated.
This comment was marked as outdated.
1 similar comment
This comment was marked as outdated.
This comment was marked as outdated.
|
See #16936 (comment). @rfcbot fcp merge cargo |
|
Team member @weihanglo has proposed to merge this. The next step is review by the rest of the tagged team members: No concerns currently listed. Once a majority of reviewers approve (and at most 2 approvals are outstanding), this will enter its final comment period. If you spot a major issue that hasn't been raised at any point in this process, please speak up! See this document for info about what commands tagged team members can give me. |
|
|
||
| [dependencies] | ||
| curl.workspace = true | ||
| http.workspace = true |
There was a problem hiding this comment.
Should we enhance docs talking about how to restore the curl backend behavior?
If it is not worthy, leave it :)
There was a problem hiding this comment.
I'm kinda split about that. I have a branch that adds a curl feature to provide a CurlClient that implements the trait and gives users a way back to the old behavior. However, since Cargo wouldn't be enabling the feature, it would have less coverage.
What does this PR try to resolve?
Converts the crates-io crate to be HTTP Client agnostic. It now uses a trait to execute HTTP requests. This enables users of the library to use any HTTP library they like, rather than only supporting
curl.Within cargo, an
HttpClientusinghttp_asyncis added (which uses curl internally).cc #16845
How to test and review this PR?
Commit by commit. Could be tested on on live crates.io, but I have not done this.