Skip to content

Commit

Permalink
Proposal for a MSRV policy. (#330)
Browse files Browse the repository at this point in the history
This PR proposes a revised policy for dealing with minimum supported Rust
versions.

It suggests to keep the rust-version field in Cargo.toml at the oldest Rust
version that is able to build with minimal dependency versions and all
features enabled. In addition, the Rust version necessary to build with
latest dependencies is provided in the README and as a comment in
Cargo.toml. Both these versions are checked in the CI workflow.

The reasoning behind the proposal is that rust-version sets a hard limit on
the version, so it should be chosen as low as possible. While technically it
could be lower with a subset of the features selected, this feels like a
slippery slope and setting the version with all features selected feels like
an acceptable compromise.

Only documenting the version that is necessary to build with latest
dependencies isn’t ideal but at least provides some guidance as to what to
choose for people who go look for some.
  • Loading branch information
partim authored Jun 20, 2024
1 parent 11aaef2 commit c421dc8
Show file tree
Hide file tree
Showing 5 changed files with 1,611 additions and 9 deletions.
24 changes: 19 additions & 5 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,14 @@ jobs:
strategy:
matrix:
os: [ubuntu-latest, windows-latest, macOS-latest]
rust: [1.78.0, stable, beta, nightly]
rust: [1.76.0, stable, beta, nightly]
env:
RUSTFLAGS: "-D warnings"
steps:
- name: Checkout repository
uses: actions/checkout@v1
- name: Install Rust
uses: hecrj/setup-rust-action@v1
uses: hecrj/setup-rust-action@v2
with:
rust-version: ${{ matrix.rust }}
- if: matrix.rust == 'stable'
Expand All @@ -25,8 +25,22 @@ jobs:
run: cargo fmt --all -- --check
- run: cargo check --no-default-features --all-targets
- run: cargo test --all-features
- if: matrix.rust == 'nightly'
minimal-versions:
name: Check minimal versions
runs-on: ubuntu-latest
env:
RUSTFLAGS: "-D warnings"
steps:
- name: Checkout repository
uses: actions/checkout@v1
- name: Install Rust
uses: hecrj/setup-rust-action@v2
with:
rust-version: "1.68.2"
- name: Install nightly Rust
run: rustup install nightly
- name: Check with minimal-versions
run: |
cargo +nightly update -Z minimal-versions
cargo check --all-features --all-targets
name: Check with minimal-versions
cargo check --all-features --all-targets --locked
3 changes: 0 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,5 @@
# Generated by Cargo
/target/

# Library, so no Cargo.lock
Cargo.lock

# Editor cruft
*.*.swp
Loading

0 comments on commit c421dc8

Please sign in to comment.