-
Notifications
You must be signed in to change notification settings - Fork 54
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
feat: new feature flag default-engine-rustls
#572
feat: new feature flag default-engine-rustls
#572
Conversation
rust doesn't have a notion of 'private features' AFAIK, so although we could do something like this I've just left it in the simple (duplicated) way: _default_engine_base = [
"arrow-conversion",
"arrow-expression",
"arrow-array",
"arrow-buffer",
"arrow-cast",
"arrow-json",
"arrow-schema",
"arrow-select",
"futures",
"object_store",
"parquet/async",
"parquet/object_store",
"tokio",
"uuid/v4",
"uuid/fast-rng",
]
default-engine = [
"_default_engine_base",
"reqwest/default",
]
default-engine-rustls = [
"_default_engine_base",
"reqwest/rustls-tls",
"reqwest/charset",
"reqwest/http2",
"reqwest/macos-system-configuration",
] |
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #572 +/- ##
==========================================
- Coverage 83.49% 83.45% -0.04%
==========================================
Files 74 75 +1
Lines 16915 16922 +7
Branches 16915 16922 +7
==========================================
Hits 14123 14123
- Misses 2137 2144 +7
Partials 655 655 ☔ View full report in Codecov by Sentry. |
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 think this can be a lot simpler.
If there's an issue for it, please note in the description that it closes it.
request came from @sppalkia but just tried to capture it in the PR description - I can open an issue if that's better though! |
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.
lgtm. thanks
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.
Maybe we could simplify this to use the same features of reqwest as the object_store crate with the cloud feature: https://github.com/apache/arrow-rs/blob/c4dbf0d8af6ca5a19b8b2ea777da3c276807fc5e/object_store/Cargo.toml#L53 ? Given that we use reqwest for pre-signed URLs, it seems likely that users would use the object_store crate with the cloud feature at the same time, and so be satisfied with the reqwest feature flags set by object_store.
…-rustls' into default-engine-with-rustls
Agree, it makes sense to no not expose the TLS feature flags of reqwest to users, at least until we get requests for it to be configurable. |
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.
If I don't specify the default-engine
feature, and do specify default-engine-rustls
, won't our current code not compile any of the default engine? Like all the places that do: #[cfg(feature = "default-engine")]
have to become #[cfg(any(feature = "default-engine", feature = "default-engine-rustls"))]
?
Would it work to just move everything to #[cfg(feature = "_default_engine_base")]
?
It might be good to add a test that things compile with both sets of flags since currently we're only testing the standard set. Hopefully our use of reqwest is limited enough that it's not an issue, but it would be good to know it at least works to compile with the default-engine-rustls
set.
@nicklan looks like semver-checks are failing since the new crate doesn't exist in the old rev? Have you run into this before? (for now i'm just removing the breaking change label - we can see that the delta_kernel part passes and all the features/deps under |
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.
lgtm, thanks!
// we have an 'internal' feature flag: default-engine-base, which is actually just the shared | ||
// pieces of default-engine and default-engine-rustls. the crate can't compile with _only_ | ||
// default-engine-base, so we give a friendly error here. |
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.
This seems like it would achieve the desired result, but I wonder how rustic it is? Does anyone else do it this way?
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.
yea I'd looked around and hoped for a better/cleaner solution but didn't really find one. considering we basically don't allow users to take a dependency on this feature only, I think it would be reasonable to change it if we find a better way in the future?
What changes are proposed in this pull request?
We had a request to remove our (implicit) dependency on native-tls. The
default-engine
feature flag pulls inreqwest
with default features which requires native-tls. This PR introduces a new feature flag:default-engine-rustls
which instead specifiesdefault-features = false
forreqwest
enables the same features which are used inobject_store
:reqwest = { version = "0.12", default-features = false, features = ["rustls-tls-native-roots", "http2"], optional = true }
Details
This PR actually introduces two new feature flags: and 'internal' feature flag
default-engine-base
and the newdefault-engine-rustls
. The former doesn't work on its own, we throw a compile error if you attempt to use the 'base' feature without eitherdefault-engine
ordefault-engine-rustls
:Lastly, a new crate
feature-tests
in the workspace was created to ensure that the features work as expected.This PR affects the following public APIs
New
default-engine-rustls
feature flag. (New private_default-engine-base
feature flag)How was this change tested?
New
feature-tests
crate and added to CI.Future work
default-engine
is)