Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Check minimal version of Rust that compiles #421

Merged
merged 1 commit into from
Aug 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 16 additions & 4 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,7 @@ jobs:
runs-on: ${{ matrix.os }}
strategy:
matrix:
# I don't really understand the build matrix here...
build: [stable, beta, nightly, macos, windows, mingw]
build: [stable, beta, nightly, minimal, macos, windows, mingw]
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

CI now fails on main, and I have a feeling that this entry might be the cause of it?

It's surprising that it didn't fail CI before.

In any case, your help for a fix will be welcome.

include:
- build: stable
os: ubuntu-latest
Expand Down Expand Up @@ -48,11 +47,11 @@ jobs:
- run: cargo test --features cloudflare_zlib --no-default-features
if: matrix.build != 'mingw'
- run: |
if ! cargo check --no-default-features 2>&1 | grep "You need to choose"; then
if ! cargo check --no-default-features 2>&1 | grep "You need to choose"; then
echo "expected message stating a zlib backend must be chosen"
exit 1
fi
if: matrix.build == 'stable'
if: matrix.build == 'stable'

rustfmt:
name: Rustfmt & Docs
Expand All @@ -75,3 +74,16 @@ jobs:
- name: Install Rust
run: rustup update stable && rustup default stable && rustup target add ${{ matrix.target }}
- run: cargo build --target ${{ matrix.target }}

minimum:
name: Minimum Rust compiler
runs-on: ubuntu-latest
env:
# If this is changed to pass tests, then set `rust-version` in `Cargo.toml` to the same version.
version: 1.56.1
steps:
- uses: actions/checkout@v4
- name: Install Rust (rustup)
run: rustup update ${version} --no-self-update && rustup default ${version}
shell: bash
- run: cargo build
1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ version = "1.0.31"
edition = "2018"
license = "MIT OR Apache-2.0"
readme = "README.md"
rust-version = "1.56.1"
keywords = ["gzip", "deflate", "zlib", "zlib-ng", "encoding"]
categories = ["compression", "api-bindings"]
repository = "https://github.com/rust-lang/flate2-rs"
Expand Down
15 changes: 12 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,18 @@ flate2 = "1.0"

## MSRV (Minimum Supported Rust Version) Policy

This crate supports the current stable and the last stable for the latest version.
For example, if the current stable is 1.64, this crate supports 1.64 and 1.63.
Older stables may work, but we don't guarantee these will continue to work.
This crate supports the current and previous stable versions of the Rust compiler.
For example, if the current stable is 1.80, this crate supports 1.80 and 1.79.

Other compiler versions may work, but failures may not be treated as a `flate2` bug.

The `Cargo.toml` file specifies a `rust-version` for which builds of the current version
passed at some point. This value is indicative only, and may change at any time.

The `rust-version` is a best-effort measured value and is different to the MSRV. The
`rust-version` can be incremented by a PR in order to pass tests, as long as the MSRV
continues to hold. When the `rust-version` increases, the next release should be a minor
version, to allow any affected users to pin to a previous minor version.

## Compression

Expand Down