Skip to content

Commit 78bbc72

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 78bbc72

File tree

3 files changed

+29
-7
lines changed

3 files changed

+29
-7
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

+12-3
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,18 @@ 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.
27-
For example, if the current stable is 1.64, this crate supports 1.64 and 1.63.
28-
Older stables may work, but we don't guarantee these will continue to work.
26+
This crate supports the current stable and the last stable compiler for the latest version.
27+
For example, if the current stable is 1.80, this crate supports 1.80 and 1.79.
28+
29+
Older stables may work, but failures may not be treated as a `flate2` bug.
30+
31+
The `Cargo.toml` file specifies a minimum version for which builds passed at some point.
32+
This value is indicative only, and may change at any time.
33+
34+
The minimum version is a best-effort measured value and is different to the MSRV. The
35+
minimum version can be incremented by a PR in order to pass tests, as long as the MSRV
36+
continues to hold. When the minimum version increases, the next release should be a minor
37+
version, to allow any affected users to pin to a previous minor version.
2938

3039
## Compression
3140

0 commit comments

Comments
 (0)