From 387b9c65c33bbb4c1db1b9cfdbbc9887a655bf90 Mon Sep 17 00:00:00 2001 From: Jiahao XU <30436523+NobodyXu@users.noreply.github.com> Date: Fri, 23 Aug 2024 23:25:45 +1000 Subject: [PATCH 1/7] Fix msrv: Run msrv checks with minimal versions Since it is possible to for dependencies to bump MSRV in patch release, msrv checking should use the minimal versions supported by flate2. Users cares deeply about msrv can also pin them to the minimal versions to maintain their current msrv. This would have also help discover bugs in #424 --- .github/workflows/main.yml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 25b643fe..80ef35f3 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -84,6 +84,9 @@ jobs: steps: - uses: actions/checkout@v4 - name: Install Rust (rustup) - run: rustup update ${version} --no-self-update && rustup default ${version} + run: | + rustup toolchain install ${version} nightly --profile minimal --no-self-update + rustup default ${version} + cargo +nightly update -Zminimal-versions shell: bash - run: cargo build From f51da32f640bddd5cb68afbc6d70820f19cd0952 Mon Sep 17 00:00:00 2001 From: Jiahao XU <30436523+NobodyXu@users.noreply.github.com> Date: Fri, 23 Aug 2024 23:34:44 +1000 Subject: [PATCH 2/7] Run msrv CI on windows and macos --- .github/workflows/main.yml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 80ef35f3..a0102eb7 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -77,7 +77,10 @@ jobs: minimum: name: Minimum Rust compiler - runs-on: ubuntu-latest + runs-on: ${{ matrix.os }} + strategy: + matrix: + os: [windows-2022, macos-latest, 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 From b332bac2f3c77399cd2c7acf0d949617c57781f4 Mon Sep 17 00:00:00 2001 From: Jiahao XU <30436523+NobodyXu@users.noreply.github.com> Date: Fri, 23 Aug 2024 23:42:17 +1000 Subject: [PATCH 3/7] Run msrv with different features --- .github/workflows/main.yml | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index a0102eb7..0c0c3bc5 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -93,3 +93,10 @@ jobs: cargo +nightly update -Zminimal-versions shell: bash - run: cargo build + - run: cargo build --features zlib + - run: cargo build --features zlib --no-default-features + - run: cargo build --features zlib-default --no-default-features + - run: cargo build --features zlib-ng-compat --no-default-features + - run: cargo build --features zlib-ng --no-default-features + - run: cargo build --features zlib-rs --no-default-features + - run: cargo build --features cloudflare_zlib --no-default-features From 80fc1e5ddd1977fa942d94a2f4a51a2cec8751de Mon Sep 17 00:00:00 2001 From: Jiahao XU <30436523+NobodyXu@users.noreply.github.com> Date: Fri, 23 Aug 2024 23:51:55 +1000 Subject: [PATCH 4/7] Do not check msrv for feature zlib-rs --- .github/workflows/main.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 0c0c3bc5..ed861a08 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -98,5 +98,4 @@ jobs: - run: cargo build --features zlib-default --no-default-features - run: cargo build --features zlib-ng-compat --no-default-features - run: cargo build --features zlib-ng --no-default-features - - run: cargo build --features zlib-rs --no-default-features - run: cargo build --features cloudflare_zlib --no-default-features From a5d38e8fc629b4d3e74825024cc9b14aa84af02a Mon Sep 17 00:00:00 2001 From: Sebastian Thiel Date: Fri, 23 Aug 2024 15:01:32 +0200 Subject: [PATCH 5/7] increase minimal versions of `libz-ng-sys` and `libz-sys` to their latest releases. That way, those compiling with `-Zminimal-versions` have higher chances of it to work. See https://github.com/Byron/gitoxide/pull/1541 for reference. --- Cargo.toml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 69d4e2de..541b8160 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -19,8 +19,8 @@ and raw deflate streams. exclude = [".*"] [dependencies] -libz-sys = { version = "1.1.8", optional = true, default-features = false } -libz-ng-sys = { version = "1.1.8", optional = true } +libz-sys = { version = "1.1.20", optional = true, default-features = false } +libz-ng-sys = { version = "1.1.16", optional = true } libz-rs-sys = { version = "0.2.1", optional = true, default-features = false, features = ["std", "rust-allocator"] } cloudflare-zlib-sys = { version = "0.3.0", optional = true } miniz_oxide = { version = "0.8.0", optional = true, default-features = false, features = ["with-alloc"] } From 66c6907f300928e5c1113f37036f7103fd268863 Mon Sep 17 00:00:00 2001 From: Sebastian Thiel Date: Fri, 23 Aug 2024 16:00:18 +0200 Subject: [PATCH 6/7] bump patch level for new release that builds with `-Zminimal-versions` --- Cargo.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Cargo.toml b/Cargo.toml index 541b8160..47c7421d 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "flate2" authors = ["Alex Crichton ", "Josh Triplett "] -version = "1.0.32" +version = "1.0.33" edition = "2018" license = "MIT OR Apache-2.0" readme = "README.md" From a2df1db3e68f8df78bf097c49dafe1c69cc9f50d Mon Sep 17 00:00:00 2001 From: Sebastian Thiel Date: Fri, 23 Aug 2024 16:03:39 +0200 Subject: [PATCH 7/7] bump *tested* MSRV to 1.63 That way it should compile with minimal versions. Reason for this is the following: ```` error: package `cc v1.0.98` cannot be built because it requires rustc 1.63 or newer, while the currently active rustc version is 1.56.1 ```` Note that the expressed MSRV is still a lower one as it may work for some people that use different settings and/or configuration. --- .github/workflows/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index ed861a08..3cef1ada 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -83,7 +83,7 @@ jobs: os: [windows-2022, macos-latest, 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 + version: 1.63.0 steps: - uses: actions/checkout@v4 - name: Install Rust (rustup)