-
Notifications
You must be signed in to change notification settings - Fork 853
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 of indexmap and chrono #1000
Conversation
Chrono's default features contain "oldtime", which is deprecated. According to [the docs](https://docs.rs/chrono/0.4.19/chrono/#duration), > new code should disable the oldtime feature and use the > chrono::Duration type instead. The oldtime feature is enabled by > default for backwards compatibility, but future versions of Chrono > are likely to remove the feature entirely. so follow that recommendation by setting default-features to false. And actually, only Arrow needs the "clock" feature, so all the other features can stay off too to minimize the feature set that projects depending on arrow or parquet are forced to enable.
The indexmap crate uses the autocfg crate to do target detection to determine whether `std` is available. Arrow isn't targeting `no_std` environments, so the target detection isn't necessary. This might save some build time. indexmap-rs/indexmap#145
@@ -40,15 +40,15 @@ path = "src/lib.rs" | |||
serde = { version = "1.0", features = ["rc"] } | |||
serde_derive = "1.0" | |||
serde_json = { version = "1.0", features = ["preserve_order"] } | |||
indexmap = "1.6" | |||
indexmap = { version = "1.6", features = ["std"] } |
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 know some arrow users target wasm
which has some strange semantics related to std, however, we have a test for compiling with a wasm
target, and those seem to have passed on this PR:
https://github.com/apache/arrow-rs/runs/4413147281?check_suite_focus=true
fyi @roee88
Thanks @carols10cents |
* Disable default features of chrono; only enable features needed Chrono's default features contain "oldtime", which is deprecated. According to [the docs](https://docs.rs/chrono/0.4.19/chrono/#duration), > new code should disable the oldtime feature and use the > chrono::Duration type instead. The oldtime feature is enabled by > default for backwards compatibility, but future versions of Chrono > are likely to remove the feature entirely. so follow that recommendation by setting default-features to false. And actually, only Arrow needs the "clock" feature, so all the other features can stay off too to minimize the feature set that projects depending on arrow or parquet are forced to enable. * Explicitly enable indexmap's "std" feature The indexmap crate uses the autocfg crate to do target detection to determine whether `std` is available. Arrow isn't targeting `no_std` environments, so the target detection isn't necessary. This might save some build time. indexmap-rs/indexmap#145
This didn't backport (cherry-pick) cleanly; Not sure why but I don't plan to spend any time figuring it out and instead will wait for arrow 7.0.0 release. If anyone else needs this sooner feel free to get a PR up to |
Which issue does this PR close?
Closes #999.
Rationale for this change
In the case of chrono, making sure these crates aren't turning on a feature name that's deprecated and will be removed eventually, and that they're turning on the minimal number of features actually used to minimize the features projects depending on these crates will be forced to turn on.
In the case of indexmap, by explicitly enabling the "std" feature since arrow isn't targetting no_std environments, this might save a bit of build time done by the indexmap crate at build time to try to automatically detect whether the target has std available or not.
What changes are included in this PR?
Adjustments to the feature sets of chrono and indexmap
Are there any user-facing changes?
If projects depending on arrow/parquet are making use of the coincidence that arrow/parquet turns on chrono features, this might mean they have to turn on the features themselves, but that would be a bug in that project's use of chrono.
I can't imagine the indexmap change would affect anyone except for maybe building slightly faster :)