From a43baafa6802ac074b0babfea20ac874cd8d5e21 Mon Sep 17 00:00:00 2001 From: Manish Goregaokar Date: Fri, 6 Sep 2024 09:33:28 -0700 Subject: [PATCH] Concrete MSRV policy (#683) --- .github/workflows/ci.yml | 2 +- Cargo.toml | 5 +++++ core/Cargo.toml | 1 + docs/msrv_policy.md | 22 ++++++++++++++++++++++ macro/Cargo.toml | 1 + runtime/Cargo.toml | 1 + 6 files changed, 31 insertions(+), 1 deletion(-) create mode 100644 docs/msrv_policy.md diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 217901e72..8bb951c94 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -41,7 +41,7 @@ jobs: run: rustup install 1.71 --profile minimal - name: Check - run: cargo +1.71 check -p diplomat -p diplomat-runtime --verbose + run: cargo +1.71 check -p diplomat -p diplomat-runtime -p diplomat_core --verbose gen: runs-on: ubuntu-latest diff --git a/Cargo.toml b/Cargo.toml index b4e9b95aa..008fcd024 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,4 +1,6 @@ [workspace] +# Applies to diplomat-core, diplomat, and diplomat-runtime +# Diplomat-tool has no MSRV for now resolver = "2" members = [ "core", @@ -8,3 +10,6 @@ members = [ "example", "feature_tests", ] + +[workspace.package] +rust-version = "1.71" diff --git a/core/Cargo.toml b/core/Cargo.toml index d3a2fd56f..a5e557f22 100644 --- a/core/Cargo.toml +++ b/core/Cargo.toml @@ -2,6 +2,7 @@ name = "diplomat_core" description = "Shared utilities between Diplomat macros and code generation" version = "0.8.0" +rust-version.workspace = true authors = [ "Shadaj Laddad ", "Manish Goregaokar ", diff --git a/docs/msrv_policy.md b/docs/msrv_policy.md new file mode 100644 index 000000000..c3707a9ce --- /dev/null +++ b/docs/msrv_policy.md @@ -0,0 +1,22 @@ +# Minimum Supported Rust Versions policy + +The diplomat libraries that end up as dependencies of diplomat-using crates (`diplomat`, `diplomat_core`, `diplomat-runtime`) attempt to maintain a reasonable Minimum Supported Rust Version policy for its users. + +At the moment, the primary user of Diplomat is [ICU4X](https://github.com/unicode-org/icu4x), and as such Diplomat matches ICU4X's [MSRV polic +y], with a tweak: + + - Diplomat releases must have an MSRV that is 4 or more releases before the current stable Rust (the version that Rust will be when Diplomat is released) + - Diplomat maintainers may upgrade MSRV to something that will be 6 or more releases before current stable Rust without needing justification. + - Upgrading MSRV to something between 4 and 6 releases before current stable Rust requires justification listing the concrete benefit Diplomat gets from this change. + - When a Diplomat MSRV update on Diplomat `main` will affect MSRV on ICU4X `main`, ICU4X must sign off on the MSRV update, either by policy, or by discussion when needed. + +When it comes to dependencies, Diplomat's MSRV implies that _some_ combination of dependency versions satisfies that MSRV. This combination can usually be found in Diplomat's lockfile, which is tested by CI. + + +The tool library, `diplomat-tool`, does not maintain any MSRV. + + +Diplomat is open to tweaking this policy to support the needs of other downstream users. + + + [MSRV policy]: https://github.com/unicode-org/icu4x/blob/main/documents/process/rust_versions.md \ No newline at end of file diff --git a/macro/Cargo.toml b/macro/Cargo.toml index 1b887b106..973c44a3f 100644 --- a/macro/Cargo.toml +++ b/macro/Cargo.toml @@ -2,6 +2,7 @@ name = "diplomat" description = "The diplomat FFI generation macro" version = "0.8.0" +rust-version.workspace = true authors = [ "Shadaj Laddad ", "Manish Goregaokar ", diff --git a/runtime/Cargo.toml b/runtime/Cargo.toml index b212b633e..a61322349 100644 --- a/runtime/Cargo.toml +++ b/runtime/Cargo.toml @@ -2,6 +2,7 @@ name = "diplomat-runtime" description = "Common runtime utilities used by diplomat codegen" version = "0.8.1" +rust-version.workspace = true authors = [ "Shadaj Laddad ", "Manish Goregaokar ",