Makes reqwest optional#724
Open
awesterb wants to merge 1 commit into
Open
Conversation
tustvold
approved these changes
Jun 2, 2026
Contributor
tustvold
left a comment
There was a problem hiding this comment.
Thank you this seems sensible to me and makes sense, I like the formulation of having a minimal feature flag and a more batteries included one. We should roll this into the crypto work as well.
kylebarron
reviewed
Jun 2, 2026
| default = ["fs"] | ||
| cloud = ["serde", "serde_json", "quick-xml", "hyper", "reqwest", "reqwest/stream", "chrono/serde", "base64", "rand", "ring", "http-body-util", "form_urlencoded", "serde_urlencoded", "tokio"] | ||
| azure = ["cloud", "httparse"] | ||
| cloud = ["cloud-base", "reqwest"] |
Member
There was a problem hiding this comment.
Should we discuss feature naming? Either now or in an issue before the next release? Because now cloud is an alias for reqwest, essentially. Would it read clearer if say azure was defined as
- azure = ["azure-base", "cloud"]
+ azure = ["azure-base", "reqwest"]because azure-base already depends on cloud-base. We have a diamond dependency graph here.
Should we have some docs about feature flag options?
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Which issue does this PR close?
Closes #723 .
Rationale for this change
We're using
object_storewith a code base that already usesawcas HTTP-client, and would like to avoid havingreqwestas additional HTTP client alongsideawc. An alternativeHttpConnectorcan already be provided currently, but thereqwestdependency can not yet be avoided.Also, since
reqwestcan't be used forwasm32-wasip1anyways, not having to package it there is nice too.What changes are included in this PR?
Adds a new
reqwestfeature that gatesdep:reqwest, but is enabled bycloudby default. This meansreqwestwill still be pulled in by theazure,gcp,awsandhttpfeatures, as is the case now. For avoidingreqwest, the featurescloud-base,azure-base,gcp-base,aws-baseandhttp-baseare added.Some features that depend on
reqwesttypes I gated behindreqwesttoo, such asclient::Certificate. To keep the pull request minimal and non-breaking, I did not attempt to rewrite those to bereqwest-independent. I believe all of the gated features can be avoided when providing your ownHttpConnector. (Besides, most of these features were already gated behind!wasm32.)Tests that use
reqwest-gated types were gated behindreqwesttoo.Added to CI extra
clippyjobs to catch missing gates in the future, and a build job forwasm32-wasip1withoutreqwest.Where
reqwest::{Method,StatusCode,header}was used, this was replaced by thehttptypes.I considered copying the
X-no-cryptonaming scheme (aws-no-crypto,gcp-no-crypto...) from GH-707, but decided not to useaws-no-reqwest(etc.) since that would necessitateaws-no-crypto-no-reqwest(and worse) in the future. (Combining !707 could make sense, havingX-basemean no crypto and no reqwest.)Are there any user-facing changes?
The feature
reqwestthat gatesdep:reqwest, and the featurescloud-base,azure-base,gcp-base,aws-baseandhttp-basethat avoidreqwest.No breaking changes (according to https://crates.io/crates/cargo-semver-checks.)