Skip to content

Set minimal supported Rust version to 1.82.0 #572

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

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open

Set minimal supported Rust version to 1.82.0 #572

wants to merge 2 commits into from

Conversation

mlafeldt
Copy link
Member

@mlafeldt mlafeldt commented Aug 7, 2025

According to cargo-msrv:

❯ cargo msrv find --linear
...

  │ 2723 | unsafe extern "C" {                                                                                                                 │
  │      | ^^^^^^                                                                                                                              │
  │      |                                                                                                                                     │
  │      = note: see issue #123743 <https://github.com/rust-lang/rust/issues/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 <https://github.com/rust-lang/rust/issues/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 <https://github.com/rust-lang/rust/issues/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).

Fixes #570

@mlafeldt mlafeldt self-assigned this Aug 7, 2025
@mlafeldt mlafeldt marked this pull request as ready for review August 7, 2025 08:43
@mlafeldt mlafeldt requested a review from Maxxen August 7, 2025 08:48
README.md Outdated
@@ -200,6 +200,10 @@ If you use the `bundled` features, you will get pregenerated bindings for the
bundled version of DuckDB. If you want to run `bindgen` at buildtime to
produce your own bindings, use the `buildtime_bindgen` Cargo feature.

## Rust version compatibility

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 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. Minor releases are guaranteed to have the same MSRV.
Copy link
Member Author

Choose a reason for hiding this comment

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

@Maxxen What do you think?

Copy link
Member Author

Choose a reason for hiding this comment

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

I changed the last sentence to say "Patch releases" for it to make sense for our use case.

@mlafeldt mlafeldt force-pushed the msrv branch 4 times, most recently from 6bf60cf to ef37d3a Compare August 8, 2025 08:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Update the docs: DuckDB only works on 2024 edition
1 participant