From fffb7d9430dbe91884188496ed11de013bbbb4ab Mon Sep 17 00:00:00 2001 From: Craig Date: Mon, 17 Jan 2022 21:01:34 -0800 Subject: [PATCH 1/4] remove libc from default features, add alias for miniz-sys (miniz) that includes libc --- Cargo.toml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 08ee25b6..921d56d8 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -20,7 +20,7 @@ zlib, gzip, and raw deflate streams. members = ['systest'] [dependencies] -libc = "0.2.65" +libc = { version = "0.2.65", optional = true } cfg-if = "1.0.0" miniz-sys = { path = "miniz-sys", version = "0.1.11", optional = true } libz-sys = { version = "1.1.0", optional = true, default-features = false } @@ -43,9 +43,10 @@ futures = "0.1" [features] default = ["rust_backend"] -any_zlib = [] # note: this is not a real user-facing feature +any_zlib = ["libc"] # note: this is not a real user-facing feature zlib = ["any_zlib", "libz-sys"] zlib-ng-compat = ["zlib", "libz-sys/zlib-ng"] cloudflare_zlib = ["any_zlib", "cloudflare-zlib-sys"] +miniz = ["libc", "miniz-sys"] rust_backend = ["miniz_oxide"] tokio = ["tokio-io", "futures"] From a148c1e8ae606679329f963e7b4f0361f722ee62 Mon Sep 17 00:00:00 2001 From: Craig Date: Mon, 17 Jan 2022 21:15:25 -0800 Subject: [PATCH 2/4] fix pipeline for new feature name --- .github/workflows/main.yml | 54 +++++++++++++++++++------------------- 1 file changed, 27 insertions(+), 27 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 485df8d8..1983bc58 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -29,39 +29,39 @@ jobs: os: windows-latest rust: stable-x86_64-gnu steps: - - uses: actions/checkout@master - - name: Install Rust (rustup) - run: rustup update ${{ matrix.rust }} --no-self-update && rustup default ${{ matrix.rust }} - shell: bash - - run: cargo build - - run: rustdoc --test README.md -L target/debug/deps --extern flate2=target/debug/libflate2.rlib --edition=2018 - - run: cargo test - - run: cargo test --features zlib - - run: cargo test --features miniz-sys - - run: cargo test --features zlib --no-default-features - - run: cargo test --features zlib-ng-compat --no-default-features - - run: cargo test --features cloudflare_zlib --no-default-features - if: matrix.build != 'mingw' - - run: cargo test --features miniz-sys --no-default-features - - run: cargo test --features tokio + - uses: actions/checkout@master + - name: Install Rust (rustup) + run: rustup update ${{ matrix.rust }} --no-self-update && rustup default ${{ matrix.rust }} + shell: bash + - run: cargo build + - run: rustdoc --test README.md -L target/debug/deps --extern flate2=target/debug/libflate2.rlib --edition=2018 + - run: cargo test + - run: cargo test --features zlib + - run: cargo test --features miniz + - run: cargo test --features zlib --no-default-features + - run: cargo test --features zlib-ng-compat --no-default-features + - run: cargo test --features cloudflare_zlib --no-default-features + if: matrix.build != 'mingw' + - run: cargo test --features miniz --no-default-features + - run: cargo test --features tokio rustfmt: name: Rustfmt runs-on: ubuntu-latest steps: - - uses: actions/checkout@master - - name: Install Rust - run: rustup update stable && rustup default stable && rustup component add rustfmt - - run: cargo fmt -- --check + - uses: actions/checkout@master + - name: Install Rust + run: rustup update stable && rustup default stable && rustup component add rustfmt + - run: cargo fmt -- --check systest: name: Systest runs-on: ubuntu-latest steps: - - uses: actions/checkout@master - - name: Install Rust - run: rustup update stable && rustup default stable - - run: cargo run --manifest-path systest/Cargo.toml + - uses: actions/checkout@master + - name: Install Rust + run: rustup update stable && rustup default stable + - run: cargo run --manifest-path systest/Cargo.toml wasm: name: WebAssembly @@ -70,10 +70,10 @@ jobs: matrix: target: [wasm32-unknown-unknown, wasm32-wasi] steps: - - uses: actions/checkout@master - - name: Install Rust - run: rustup update stable && rustup default stable && rustup target add ${{ matrix.target }} - - run: cargo build --target ${{ matrix.target }} + - uses: actions/checkout@master + - name: Install Rust + run: rustup update stable && rustup default stable && rustup target add ${{ matrix.target }} + - run: cargo build --target ${{ matrix.target }} publish_docs: name: Publish Documentation From 3cc41467a4ef798d5f792b8c17e88699cc6d6608 Mon Sep 17 00:00:00 2001 From: Craig Date: Mon, 17 Jan 2022 21:17:44 -0800 Subject: [PATCH 3/4] revert indent changes from autoformat --- .github/workflows/main.yml | 54 +++++++++++++++++++------------------- 1 file changed, 27 insertions(+), 27 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 1983bc58..90454d17 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -29,39 +29,39 @@ jobs: os: windows-latest rust: stable-x86_64-gnu steps: - - uses: actions/checkout@master - - name: Install Rust (rustup) - run: rustup update ${{ matrix.rust }} --no-self-update && rustup default ${{ matrix.rust }} - shell: bash - - run: cargo build - - run: rustdoc --test README.md -L target/debug/deps --extern flate2=target/debug/libflate2.rlib --edition=2018 - - run: cargo test - - run: cargo test --features zlib - - run: cargo test --features miniz - - run: cargo test --features zlib --no-default-features - - run: cargo test --features zlib-ng-compat --no-default-features - - run: cargo test --features cloudflare_zlib --no-default-features - if: matrix.build != 'mingw' - - run: cargo test --features miniz --no-default-features - - run: cargo test --features tokio + - uses: actions/checkout@master + - name: Install Rust (rustup) + run: rustup update ${{ matrix.rust }} --no-self-update && rustup default ${{ matrix.rust }} + shell: bash + - run: cargo build + - run: rustdoc --test README.md -L target/debug/deps --extern flate2=target/debug/libflate2.rlib --edition=2018 + - run: cargo test + - run: cargo test --features zlib + - run: cargo test --features miniz + - run: cargo test --features zlib --no-default-features + - run: cargo test --features zlib-ng-compat --no-default-features + - run: cargo test --features cloudflare_zlib --no-default-features + if: matrix.build != 'mingw' + - run: cargo test --features miniz --no-default-features + - run: cargo test --features tokio rustfmt: name: Rustfmt runs-on: ubuntu-latest steps: - - uses: actions/checkout@master - - name: Install Rust - run: rustup update stable && rustup default stable && rustup component add rustfmt - - run: cargo fmt -- --check + - uses: actions/checkout@master + - name: Install Rust + run: rustup update stable && rustup default stable && rustup component add rustfmt + - run: cargo fmt -- --check systest: name: Systest runs-on: ubuntu-latest steps: - - uses: actions/checkout@master - - name: Install Rust - run: rustup update stable && rustup default stable - - run: cargo run --manifest-path systest/Cargo.toml + - uses: actions/checkout@master + - name: Install Rust + run: rustup update stable && rustup default stable + - run: cargo run --manifest-path systest/Cargo.toml wasm: name: WebAssembly @@ -70,10 +70,10 @@ jobs: matrix: target: [wasm32-unknown-unknown, wasm32-wasi] steps: - - uses: actions/checkout@master - - name: Install Rust - run: rustup update stable && rustup default stable && rustup target add ${{ matrix.target }} - - run: cargo build --target ${{ matrix.target }} + - uses: actions/checkout@master + - name: Install Rust + run: rustup update stable && rustup default stable && rustup target add ${{ matrix.target }} + - run: cargo build --target ${{ matrix.target }} publish_docs: name: Publish Documentation From b59f0fb800fa0e7be15b7ada09ac9c424cd9b66f Mon Sep 17 00:00:00 2001 From: Craig Date: Mon, 17 Jan 2022 21:56:30 -0800 Subject: [PATCH 4/4] fix readme for renamed feature --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 5525e001..d401f310 100644 --- a/README.md +++ b/README.md @@ -85,7 +85,7 @@ documentation](https://crates.io/crates/cloudflare-zlib-sys). Note that uses another version of zlib/libz. For compatibility with previous versions of `flate2`, the C version of `miniz.c` -is still available, using the feature `miniz-sys`. +is still available, using the feature `miniz`. # License