-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
Minimize features #1399
Minimize features #1399
Conversation
@@ -30,7 +30,7 @@ build = "build.rs" | |||
simd = ["datafusion/simd"] | |||
|
|||
[dependencies] | |||
ahash = "0.7" | |||
ahash = { version = "0.7", default-features = false } |
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.
At least hashbrown
also depends on ahash
by default.
So shouldn't we make that feature in hashbrown
optional too?
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.
hashbrown
sets default-features = false
for ahash
. https://github.com/rust-lang/hashbrown/blob/b3eaf32e608d1ec4c10963a4f495503d7f8a7ef5/Cargo.toml#L16
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.
Ok, that makes sense!
The default feature set of the ahash crate is ["std"][1]. The std feature enables features which require the standard library, namely `AHashMap` and `AHashSet`. DataFusion currently only uses `AHasher`, `CallHasher`, and `RandomState`, none of which require the standard library. This gives more control to projects depending on datafusion to minimize the amount of code they depend on. [1]: https://github.com/tkaitchuck/aHash/blob/e77cab8c1e15bfc9f54dfd28bd8820c2a7bb27c4/Cargo.toml#L24-L25
In fact, the "oldtime" feature is [considered deprecated][1] and only included by default for backwards compatibility. The other features don't appear to be used by datafusion or ballista, so this gives projects depending on these crates more flexibility in what they choose to include. [1]: https://github.com/chronotope/chrono/blame/f6bd567bb677262645c1fc3131c8c1071cd77ec3/README.md#L88-L94
ee2b9c3
to
dafabde
Compare
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.
Thanks @carols10cents !
Which issue does this PR close?
Closes #1398.
Rationale for this change
Give projects depending on datafusion more choice in what features to enable.
What changes are included in this PR?
Disabling default features for chrono and ahash in datafusion and ballista.
Are there any user-facing changes?
If projects depending on datafusion/ballista are making use of the coincidence that they turn on chrono or ahash features, this might mean they have to turn on the features themselves, but that would be a bug in that project's use of the crates.