Skip to content

Commit 9a95047

Browse files
authored
Set minimal supported Rust version to 1.82.0 (#572)
According to cargo-msrv: ``` ❯ cargo msrv find --linear ... │ 2723 | unsafe extern "C" { │ │ | ^^^^^^ │ │ | │ │ = note: see issue #123743 <rust-lang/rust#123743> for more information │ │ │ │ error: extern block cannot be declared unsafe │ │ --> /Users/mathias/devel/duckdb/duckdb-rs/target/aarch64-apple-darwin/debug/build/libduckdb-sys-effbdf83ad7002d1/out/bindgen.rs:2732:1 │ │ | │ │ 2732 | unsafe extern "C" { │ │ | ^^^^^^ │ │ | │ │ = note: see issue #123743 <rust-lang/rust#123743> for more information │ │ │ │ error: extern block cannot be declared unsafe │ │ --> /Users/mathias/devel/duckdb/duckdb-rs/target/aarch64-apple-darwin/debug/build/libduckdb-sys-effbdf83ad7002d1/out/bindgen.rs:2736:1 │ │ | │ │ 2736 | unsafe extern "C" { │ │ | ^^^^^^ │ │ | │ │ = note: see issue #123743 <rust-lang/rust#123743> for more information │ │ │ │ error: could not compile `libduckdb-sys` (lib) due to 428 previous errors │ │ │ ╰────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ Result: Considered (min … max): Rust 0.11.0 … Rust 1.88.0 Search method: linear MSRV: 1.82.0 Target: aarch64-apple-darwin ``` Arrow 55 also requires at least Rust 1.81: ``` ❯ cargo b error: package `arrow-ord v55.2.0` cannot be built because it requires rustc 1.81 or newer, while the currently active rustc version is 1.70.0 Either upgrade to rustc 1.81 or newer, or use cargo update -p [email protected] --precise ver where `ver` is the latest version of `arrow-ord` supporting rustc 1.70.0 ``` Rust 1.82 was released almost a year ago in October 2024, so it's not too demanding on users. Note that I didn't touch the Rust edition because Rust 2024 was only stable in Rust 1.85. Besides adding the Rust version to Cargo.toml, I also added a version policy to our README (inspired by [arrow-rs](https://github.com/apache/arrow-rs?tab=readme-ov-file#rust-version-compatibility-policy)). Fixes #570
2 parents 76014c1 + 67357f6 commit 9a95047

File tree

5 files changed

+12
-4
lines changed

5 files changed

+12
-4
lines changed

Cargo.toml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,14 +9,15 @@ members = [
99
[workspace.package]
1010
version = "1.3.2"
1111
authors = ["wangfenjin <[email protected]>"]
12-
edition = "2021"
1312
repository = "https://github.com/duckdb/duckdb-rs"
1413
homepage = "https://github.com/duckdb/duckdb-rs"
1514
documentation = "http://docs.rs/duckdb/"
1615
readme = "README.md"
1716
keywords = ["duckdb", "database", "ffi"]
1817
license = "MIT"
1918
categories = ["database"]
19+
edition = "2021"
20+
rust-version = "1.82.0"
2021

2122
[workspace.dependencies]
2223
duckdb = { version = "=1.3.2", path = "crates/duckdb" }

README.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -200,6 +200,10 @@ If you use the `bundled` features, you will get pregenerated bindings for the
200200
bundled version of DuckDB. If you want to run `bindgen` at buildtime to
201201
produce your own bindings, use the `buildtime_bindgen` Cargo feature.
202202

203+
## Rust version compatibility
204+
205+
duckdb-rs is built and tested with stable Rust, and will keep a rolling MSRV (minimum supported Rust version) that can only be updated in major and minor releases on a need by basis (e.g. project dependencies bump their MSRV or a particular Rust feature is useful for us etc.). The new MSRV will be at least 6 months old. Patch releases are guaranteed to have the same MSRV.
206+
203207
## Contributing
204208

205209
We welcome contributions! Take a look at [CONTRIBUTING.md](CONTRIBUTING.md) for more information.

crates/duckdb-loadable-macros/Cargo.toml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,15 @@
22
name = "duckdb-loadable-macros"
33
version = "0.1.9"
44
authors = { workspace = true }
5-
edition = { workspace = true }
65
license = { workspace = true }
76
repository = { workspace = true }
87
homepage = { workspace = true }
98
keywords = { workspace = true }
109
readme = { workspace = true }
1110
categories = ["external-ffi-bindings", "database"]
1211
description = "Native bindings to the libduckdb library, C API; build loadable extensions"
12+
edition = { workspace = true }
13+
rust-version = { workspace = true }
1314

1415
[dependencies]
1516
darling = "0.20.10"

crates/duckdb/Cargo.toml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
name = "duckdb"
33
version = "1.3.2"
44
authors = { workspace = true }
5-
edition = { workspace = true }
65
repository = { workspace = true }
76
homepage = { workspace = true }
87
documentation = { workspace = true }
@@ -11,6 +10,8 @@ keywords = { workspace = true }
1110
license = { workspace = true }
1211
categories = { workspace = true }
1312
description = "Ergonomic wrapper for DuckDB"
13+
edition = { workspace = true }
14+
rust-version = { workspace = true }
1415

1516
[lib]
1617
name = "duckdb"

crates/libduckdb-sys/Cargo.toml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
name = "libduckdb-sys"
33
version = "1.3.2"
44
authors = { workspace = true }
5-
edition = { workspace = true }
65
license = { workspace = true }
76
repository = { workspace = true }
87
homepage = { workspace = true }
@@ -12,6 +11,8 @@ build = "build.rs"
1211
categories = ["external-ffi-bindings", "database"]
1312
description = "Native bindings to the libduckdb library, C API"
1413
exclude = ["duckdb-sources"]
14+
edition = { workspace = true }
15+
rust-version = { workspace = true }
1516

1617
[features]
1718
default = ["vcpkg", "pkg-config"]

0 commit comments

Comments
 (0)