Skip to content

Commit 24282af

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 rust-lang#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 24282af

File tree

3 files changed

+17
-5
lines changed

3 files changed

+17
-5
lines changed

.github/workflows/main.yml

+6-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
@@ -19,6 +18,9 @@ jobs:
1918
- build: nightly
2019
os: ubuntu-latest
2120
rust: nightly
21+
- build: minimal
22+
os: ubuntu-latest
23+
rust: 1.56.1
2224
- build: macos
2325
os: macos-latest
2426
rust: stable
@@ -48,11 +50,11 @@ jobs:
4850
- run: cargo test --features cloudflare_zlib --no-default-features
4951
if: matrix.build != 'mingw'
5052
- run: |
51-
if ! cargo check --no-default-features 2>&1 | grep "You need to choose"; then
53+
if ! cargo check --no-default-features 2>&1 | grep "You need to choose"; then
5254
echo "expected message stating a zlib backend must be chosen"
5355
exit 1
5456
fi
55-
if: matrix.build == 'stable'
57+
if: matrix.build == 'stable'
5658
5759
rustfmt:
5860
name: Rustfmt & Docs

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)