Remove curl dependency from crates-io crate#16936
Remove curl dependency from crates-io crate#16936weihanglo merged 5 commits intorust-lang:masterfrom
Conversation
|
r? @weihanglo rustbot has assigned @weihanglo. Use Why was this reviewer chosen?The reviewer was selected based on:
|
9c0e0d7 to
54ea404
Compare
|
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.
This comment has been minimized.
This comment has been minimized.
|
🔔 This is now entering its final comment period, as per the review above. 🔔 |
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.
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 PR was rebased onto a different master commit. Here's a range-diff highlighting what actually changed. Rebasing is a normal part of keeping PRs up to date, so no action is needed—this note is just to help reviewers. |
|
I don't think this require 10-day full FCP as it is a major version release not a breaking change in Cargo itself. Let's merge it right now. |
Update cargo submodule 10 commits in eb9b60f1f6604b5e022c56be31692c215b8ba11d..4f9b52075316e9ced380c8fa492858048d5758b6 2026-04-24 20:52:07 +0000 to 2026-05-01 22:36:41 +0000 - chore(deps): update compatible (rust-lang/cargo#16952) - feat(lints): Add deny-by-default text_direction_codepoint lints (rust-lang/cargo#16950) - chore(deps): update embarkstudios/cargo-deny-action action to v2.0.17 (rust-lang/cargo#16953) - docs(guide): Switch from third-party to first-party unused deps detection (rust-lang/cargo#16946) - Remove curl dependency from crates-io crate (rust-lang/cargo#16936) - chore(deps): update gix to 0.83 (rust-lang/cargo#16945) - fix(compile): Where possible, hint about misplaced deps (rust-lang/cargo#16940) - Remove `windows-sys` from `home` (rust-lang/cargo#16918) - docs(resolver): `--precise <yanked>` is on stable (rust-lang/cargo#16944) - Update `gix` to 0.82 (with security fixes and hardened parsers) (rust-lang/cargo#16941)
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.