Skip to content

Commit 8475fed

Browse files
committed
Check minimal version of Rust that compiles
Specify a minimum version of the Rust compiler that successfully builds the crate. This allows us to be aware if the minimal version increases and to avoid issues such as #370 The minimum version is a best-effort measured value and is different to the MSRV which is a support guarantee. The minimum version can be incremented by a PR in order to pass tests, as long as the MSRV holds. When the minimum version increases, the next release should be a minor version, to allow any affected users to pin to a previous minor version.
1 parent 74b3c73 commit 8475fed

File tree

3 files changed

+27
-5
lines changed

3 files changed

+27
-5
lines changed

.github/workflows/main.yml

+16-4
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,7 @@ jobs:
77
runs-on: ${{ matrix.os }}
88
strategy:
99
matrix:
10-
# I don't really understand the build matrix here...
11-
build: [stable, beta, nightly, macos, windows, mingw]
10+
build: [stable, beta, nightly, minimal, macos, windows, mingw]
1211
include:
1312
- build: stable
1413
os: ubuntu-latest
@@ -48,11 +47,11 @@ jobs:
4847
- run: cargo test --features cloudflare_zlib --no-default-features
4948
if: matrix.build != 'mingw'
5049
- run: |
51-
if ! cargo check --no-default-features 2>&1 | grep "You need to choose"; then
50+
if ! cargo check --no-default-features 2>&1 | grep "You need to choose"; then
5251
echo "expected message stating a zlib backend must be chosen"
5352
exit 1
5453
fi
55-
if: matrix.build == 'stable'
54+
if: matrix.build == 'stable'
5655
5756
rustfmt:
5857
name: Rustfmt & Docs
@@ -75,3 +74,16 @@ jobs:
7574
- name: Install Rust
7675
run: rustup update stable && rustup default stable && rustup target add ${{ matrix.target }}
7776
- run: cargo build --target ${{ matrix.target }}
77+
78+
minimum:
79+
name: Minimum Rust compiler
80+
runs-on: ubuntu-latest
81+
env:
82+
# If this is changed to pass tests, then set `rust-version` in `Cargo.toml` to the same version.
83+
version: 1.56.1
84+
steps:
85+
- uses: actions/checkout@v4
86+
- name: Install Rust (rustup)
87+
run: rustup update ${version} --no-self-update && rustup default ${version}
88+
shell: bash
89+
- run: cargo build

Cargo.toml

+1
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ version = "1.0.31"
55
edition = "2018"
66
license = "MIT OR Apache-2.0"
77
readme = "README.md"
8+
rust-version = "1.56.1"
89
keywords = ["gzip", "deflate", "zlib", "zlib-ng", "encoding"]
910
categories = ["compression", "api-bindings"]
1011
repository = "https://github.com/rust-lang/flate2-rs"

README.md

+10-1
Original file line numberDiff line numberDiff line change
@@ -23,10 +23,19 @@ flate2 = "1.0"
2323

2424
## MSRV (Minimum Supported Rust Version) Policy
2525

26-
This crate supports the current stable and the last stable for the latest version.
26+
This crate supports the current stable and the last stable compiler for the latest version.
2727
For example, if the current stable is 1.64, this crate supports 1.64 and 1.63.
2828
Older stables may work, but we don't guarantee these will continue to work.
2929

30+
The `Cargo.toml` file specifies a minimum version for which builds passed at some point.
31+
This value is indicative only, and may change at any time.
32+
33+
The minimum version is a best-effort measured value and is different to the MSRV
34+
which is a support guarantee. The minimum version can be incremented by a PR in order
35+
to pass tests, as long as the MSRV holds. When the minimum version increases, the next
36+
release should be a minor version, to allow any affected users to pin to a previous
37+
minor version.
38+
3039
## Compression
3140

3241
```rust

0 commit comments

Comments
 (0)