Skip to content

Commit

Permalink
Concrete MSRV policy (#683)
Browse files Browse the repository at this point in the history
  • Loading branch information
Manishearth authored Sep 6, 2024
1 parent 0dfb267 commit a43baaf
Show file tree
Hide file tree
Showing 6 changed files with 31 additions and 1 deletion.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
5 changes: 5 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
[workspace]
# Applies to diplomat-core, diplomat, and diplomat-runtime
# Diplomat-tool has no MSRV for now
resolver = "2"
members = [
"core",
Expand All @@ -8,3 +10,6 @@ members = [
"example",
"feature_tests",
]

[workspace.package]
rust-version = "1.71"
1 change: 1 addition & 0 deletions core/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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 <[email protected]>",
"Manish Goregaokar <[email protected]>",
Expand Down
22 changes: 22 additions & 0 deletions docs/msrv_policy.md
Original file line number Diff line number Diff line change
@@ -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
1 change: 1 addition & 0 deletions macro/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
name = "diplomat"
description = "The diplomat FFI generation macro"
version = "0.8.0"
rust-version.workspace = true
authors = [
"Shadaj Laddad <[email protected]>",
"Manish Goregaokar <[email protected]>",
Expand Down
1 change: 1 addition & 0 deletions runtime/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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 <[email protected]>",
"Manish Goregaokar <[email protected]>",
Expand Down

0 comments on commit a43baaf

Please sign in to comment.