Skip to content
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

Update minimum rust version to 1.72 #8997

Merged
merged 8 commits into from
Feb 1, 2024
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ homepage = "https://github.com/apache/arrow-datafusion"
license = "Apache-2.0"
readme = "README.md"
repository = "https://github.com/apache/arrow-datafusion"
rust-version = "1.70"
rust-version = "1.71"
version = "35.0.0"

[workspace.dependencies]
Expand Down
2 changes: 1 addition & 1 deletion benchmarks/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ authors = ["Apache Arrow <[email protected]>"]
homepage = "https://github.com/apache/arrow-datafusion"
repository = "https://github.com/apache/arrow-datafusion"
license = "Apache-2.0"
rust-version = "1.70"
rust-version = "1.71"

[features]
ci = []
Expand Down
2 changes: 1 addition & 1 deletion datafusion-cli/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ keywords = ["arrow", "datafusion", "query", "sql"]
license = "Apache-2.0"
homepage = "https://github.com/apache/arrow-datafusion"
repository = "https://github.com/apache/arrow-datafusion"
rust-version = "1.70"
rust-version = "1.71"
readme = "README.md"

[dependencies]
Expand Down
2 changes: 1 addition & 1 deletion datafusion/core/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ homepage = { workspace = true }
repository = { workspace = true }
license = { workspace = true }
authors = { workspace = true }
rust-version = "1.70"
rust-version = "1.71"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could we take this opportunity to set this as same as workspace? e.g.

https://github.com/apache/arrow-datafusion/blob/7a5f2054305fd92852b589473afbc9bb034379d7/datafusion/physical-plan/Cargo.toml#L29

Unless its preferable to keep these separate? (even though they currently are the same)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That is an excellent idea. I vaguely (but perhaps incorrectly) remember something related to releasing was tricky with MSRV -- @andygrove do you remember? Would it be ok to switch the sub crates to use the workspace version?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done in 9280b7a

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok, I found out again. The reason the version is replicated is that cargo msrv verify doesn't support workspace versions

Thus if you do cd datafusion/core && cargo msrv verify, it fails like

Fetching index
Unable to find key 'package.rust-version' (or 'package.metadata.msrv') in '/Users/andrewlamb/Software/arrow-datafusion/Cargo.toml'

I have fixed that

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tracking issue for that in cargo msrv: foresterre/cargo-msrv#590

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @Jefffrey -- I have added an issue ref as a comment so we don't forget it in the future


[lib]
name = "datafusion"
Expand Down
11 changes: 3 additions & 8 deletions datafusion/expr/src/expr.rs
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ use datafusion_common::{plan_err, Column, DataFusionError, Result, ScalarValue};
use std::collections::HashSet;
use std::fmt;
use std::fmt::{Display, Formatter, Write};
use std::hash::{BuildHasher, Hash, Hasher};
use std::hash::Hash;
use std::str::FromStr;
use std::sync::Arc;

Expand Down Expand Up @@ -849,13 +849,8 @@ const SEED: ahash::RandomState = ahash::RandomState::with_seeds(0, 0, 0, 0);

impl PartialOrd for Expr {
fn partial_cmp(&self, other: &Self) -> Option<std::cmp::Ordering> {
let mut hasher = SEED.build_hasher();
self.hash(&mut hasher);
let s = hasher.finish();

let mut hasher = SEED.build_hasher();
other.hash(&mut hasher);
let o = hasher.finish();
let s = SEED.hash_one(self);
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Clippy failed on this for me with the updated MSRV so I did what it told me

let o = SEED.hash_one(other);

Some(s.cmp(&o))
}
Expand Down
8 changes: 3 additions & 5 deletions datafusion/physical-expr/src/aggregate/hyperloglog.rs
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,8 @@
//!
//! This module also borrows some code structure from [pdatastructs.rs](https://github.com/crepererum/pdatastructs.rs/blob/3997ed50f6b6871c9e53c4c5e0f48f431405fc63/src/hyperloglog.rs).

use ahash::{AHasher, RandomState};
use std::hash::{BuildHasher, Hash, Hasher};
use ahash::RandomState;
use std::hash::Hash;
use std::marker::PhantomData;

/// The greater is P, the smaller the error.
Expand Down Expand Up @@ -102,9 +102,7 @@ where
/// reasonable performance.
#[inline]
fn hash_value(&self, obj: &T) -> u64 {
let mut hasher: AHasher = SEED.build_hasher();
obj.hash(&mut hasher);
hasher.finish()
SEED.hash_one(obj)
}

/// Adds an element to the HyperLogLog.
Expand Down
2 changes: 1 addition & 1 deletion datafusion/proto/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ homepage = { workspace = true }
repository = { workspace = true }
license = { workspace = true }
authors = { workspace = true }
rust-version = "1.70"
rust-version = "1.71"

# Exclude proto files so crates.io consumers don't need protoc
exclude = ["*.proto"]
Expand Down
2 changes: 1 addition & 1 deletion datafusion/substrait/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ homepage = { workspace = true }
repository = { workspace = true }
license = { workspace = true }
authors = { workspace = true }
rust-version = "1.70"
rust-version = "1.71"

[dependencies]
async-recursion = "1.0"
Expand Down
2 changes: 1 addition & 1 deletion datafusion/wasmtest/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ homepage = { workspace = true }
repository = { workspace = true }
license = { workspace = true }
authors = { workspace = true }
rust-version = "1.70"
rust-version = "1.71"

[lib]
crate-type = ["cdylib", "rlib"]
Expand Down
2 changes: 1 addition & 1 deletion docs/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ homepage = { workspace = true }
repository = { workspace = true }
license = { workspace = true }
authors = { workspace = true }
rust-version = "1.70"
rust-version = "1.71"

[dependencies]
datafusion = { path = "../datafusion/core", version = "35.0.0", default-features = false }
Loading