From cbb55ba27d98ca24e364f1c26b6fa96b3ade6e32 Mon Sep 17 00:00:00 2001 From: Rob Ede Date: Wed, 19 Jun 2024 23:40:22 +0100 Subject: [PATCH] ci: use just for feature combos check --- .cargo/config.toml | 10 ---------- .github/workflows/ci-post-merge.yml | 14 +++++++------- actix-http/Cargo.toml | 16 ++++++++-------- actix-http/src/lib.rs | 8 ++++---- justfile | 15 ++++++++++++++- 5 files changed, 33 insertions(+), 30 deletions(-) delete mode 100644 .cargo/config.toml diff --git a/.cargo/config.toml b/.cargo/config.toml deleted file mode 100644 index a2345e18460..00000000000 --- a/.cargo/config.toml +++ /dev/null @@ -1,10 +0,0 @@ -[alias] -lint = "clippy --workspace --all-targets -- -Dclippy::todo" -lint-all = "clippy --workspace --all-features --all-targets -- -Dclippy::todo" - -# lib checking -ci-check-min = "hack --workspace check --no-default-features" -ci-check-default = "hack --workspace check" -ci-check-default-tests = "check --workspace --tests" -ci-check-all-feature-powerset="hack --workspace --feature-powerset --depth=4 --skip=__compress,experimental-io-uring check" -ci-check-all-feature-powerset-linux="hack --workspace --feature-powerset --depth=4 --skip=__compress check" diff --git a/.github/workflows/ci-post-merge.yml b/.github/workflows/ci-post-merge.yml index 67a6d0f8f38..59a17e70a1d 100644 --- a/.github/workflows/ci-post-merge.yml +++ b/.github/workflows/ci-post-merge.yml @@ -76,16 +76,16 @@ jobs: - name: Free Disk Space run: ./scripts/free-disk-space.sh + - name: Setup mold linker + uses: rui314/setup-mold@v1 + - name: Install Rust uses: actions-rust-lang/setup-rust-toolchain@v1.9.0 - - name: Install cargo-hack + - name: Install just, cargo-hack uses: taiki-e/install-action@v2.39.1 with: - tool: cargo-hack - - - name: check feature combinations - run: cargo ci-check-all-feature-powerset + tool: just,cargo-hack - - name: check feature combinations - run: cargo ci-check-all-feature-powerset-linux + - name: Check feature combinations + run: just check-feature-combinations diff --git a/actix-http/Cargo.toml b/actix-http/Cargo.toml index 25e8b28f507..5f6a424e852 100644 --- a/actix-http/Cargo.toml +++ b/actix-http/Cargo.toml @@ -59,14 +59,14 @@ allowed_external_types = [ default = [] # HTTP/2 protocol support -http2 = ["h2"] +http2 = ["dep:h2"] # WebSocket protocol implementation ws = [ - "local-channel", - "base64", - "rand", - "sha1", + "dep:local-channel", + "dep:base64", + "dep:rand", + "dep:sha1", ] # TLS via OpenSSL @@ -88,9 +88,9 @@ rustls-0_22 = ["__tls", "actix-tls/accept", "actix-tls/rustls-0_22"] rustls-0_23 = ["__tls", "actix-tls/accept", "actix-tls/rustls-0_23"] # Compression codecs -compress-brotli = ["__compress", "brotli"] -compress-gzip = ["__compress", "flate2"] -compress-zstd = ["__compress", "zstd"] +compress-brotli = ["__compress", "dep:brotli"] +compress-gzip = ["__compress", "dep:flate2"] +compress-zstd = ["__compress", "dep:zstd"] # Internal (PRIVATE!) features used to aid testing and checking feature status. # Don't rely on these whatsoever. They are semver-exempt and may disappear at anytime. diff --git a/actix-http/src/lib.rs b/actix-http/src/lib.rs index b76032ba3dd..ac79433c6ee 100644 --- a/actix-http/src/lib.rs +++ b/actix-http/src/lib.rs @@ -6,10 +6,10 @@ //! | ------------------- | ------------------------------------------- | //! | `http2` | HTTP/2 support via [h2]. | //! | `openssl` | TLS support via [OpenSSL]. | -//! | `rustls` | TLS support via [rustls] 0.20. | -//! | `rustls-0_21` | TLS support via [rustls] 0.21. | -//! | `rustls-0_22` | TLS support via [rustls] 0.22. | -//! | `rustls-0_23` | TLS support via [rustls] 0.23. | +//! | `rustls-0_20` | TLS support via rustls 0.20. | +//! | `rustls-0_21` | TLS support via rustls 0.21. | +//! | `rustls-0_22` | TLS support via rustls 0.22. | +//! | `rustls-0_23` | TLS support via [rustls] 0.23. | //! | `compress-brotli` | Payload compression support: Brotli. | //! | `compress-gzip` | Payload compression support: Deflate, Gzip. | //! | `compress-zstd` | Payload compression support: Zstd. | diff --git a/justfile b/justfile index 646c6b44d9d..985e2b35aa2 100644 --- a/justfile +++ b/justfile @@ -22,7 +22,7 @@ non_linux_all_features_list := ``` cargo metadata --format-version=1 \ | jq '.packages[] | select(.source == null) | .features | keys' \ | jq -r --slurp \ - --arg exclusions "tokio-uring,io-uring,experimental-io-uring" \ + --arg exclusions "__tls,__compress,tokio-uring,io-uring,experimental-io-uring" \ 'add | unique | . - ($exclusions | split(",")) | join(",")' ``` @@ -93,6 +93,19 @@ update-readmes: && fmt cd ./actix-multipart && cargo rdme --force cd ./actix-test && cargo rdme --force +feature_combo_skip_list := if os() == "linux" { + "__tls,__compress" +} else { + "__tls,__compress,experimental-io-uring" +} + +# Checks compatibility of feature combinations. +check-feature-combinations: + cargo hack --workspace \ + --feature-powerset --depth=4 \ + --skip={{ feature_combo_skip_list }} \ + check + # Check for unintentional external type exposure on all crates in workspace. check-external-types-all toolchain="+nightly": #!/usr/bin/env bash