From 144b67bb100d543aa01eb841f622dd524d64b4e3 Mon Sep 17 00:00:00 2001 From: Kornel Date: Tue, 10 Feb 2026 19:53:41 +0000 Subject: [PATCH] Support building without default features --- .github/workflows/ci.yml | 8 +++++++- Cargo.toml | 6 +++--- boring/Cargo.toml | 2 +- hyper-boring/Cargo.toml | 6 ++++-- tokio-boring/Cargo.toml | 6 ++++-- 5 files changed, 19 insertions(+), 9 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index d7f03cb5..1c104a3d 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -58,7 +58,7 @@ jobs: path: target key: clippy-${{ steps.rust-version.outputs.version }}-${{ hashFiles('Cargo.lock') }} - name: Run clippy - run: cargo clippy --all --all-targets + run: cargo clippy --all --all-targets --features rpk,mlkem - name: Check docs run: cargo doc --no-deps -p boring -p boring-sys -p hyper-boring -p tokio-boring --features rpk,underscore-wildcards env: @@ -415,9 +415,15 @@ jobs: - name: Install Rust (rustup) run: rustup update stable --no-self-update && rustup default stable shell: bash + - run: cargo check --no-default-features + name: Check `--no-default-features` + - run: cargo check --features mlkem,credential + name: Check `mlkem,credential` - run: cargo test --features rpk name: Run `rpk` tests - run: cargo test --features underscore-wildcards name: Run `underscore-wildcards` tests - run: cargo test --features rpk,underscore-wildcards name: Run `rpk,underscore-wildcards` tests + - run: cargo test --features rpk,underscore-wildcards,mlkem + name: Run `rpk,underscore-wildcards` tests diff --git a/Cargo.toml b/Cargo.toml index 80b80322..784bd44a 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -20,9 +20,9 @@ tag-prefix = "" publish = false [workspace.dependencies] -boring-sys = { version = "5.0.0", path = "./boring-sys" } -boring = { version = "5.0.0", path = "./boring" } -tokio-boring = { version = "5.0.0", path = "./tokio-boring" } +boring-sys = { version = "5.0.0", path = "./boring-sys", default-features = false } +boring = { version = "5.0.0", path = "./boring", default-features = false } +tokio-boring = { version = "5.0.0", path = "./tokio-boring", default-features = false } bindgen = { version = "0.72.0", default-features = false, features = ["runtime"] } bitflags = "2.9" diff --git a/boring/Cargo.toml b/boring/Cargo.toml index b4a5733d..71fe3230 100644 --- a/boring/Cargo.toml +++ b/boring/Cargo.toml @@ -17,7 +17,7 @@ features = ["rpk", "underscore-wildcards"] rustdoc-args = ["--cfg", "docsrs"] [features] -# Controlling the build +default = [] # Use a FIPS-validated version of BoringSSL. fips = ["boring-sys/fips"] diff --git a/hyper-boring/Cargo.toml b/hyper-boring/Cargo.toml index 9963e6ee..e8c833fd 100644 --- a/hyper-boring/Cargo.toml +++ b/hyper-boring/Cargo.toml @@ -16,6 +16,8 @@ features = [] rustdoc-args = ["--cfg", "docsrs"] [features] +default = ["boring/default", "tokio-boring/default"] + # Use a FIPS-validated version of boringssl. fips = ["boring/fips", "tokio-boring/fips"] @@ -25,9 +27,9 @@ http = { workspace = true } hyper = { workspace = true } hyper-util = { workspace = true, features = ["client", "client-legacy"] } linked_hash_set = { workspace = true } -boring = { workspace = true } +boring = { workspace = true, default-features = false } tokio = { workspace = true } -tokio-boring = { workspace = true } +tokio-boring = { workspace = true, default-features = false } tower-layer = { workspace = true } tower-service = { workspace = true } diff --git a/tokio-boring/Cargo.toml b/tokio-boring/Cargo.toml index 18d2f2b2..1830cc17 100644 --- a/tokio-boring/Cargo.toml +++ b/tokio-boring/Cargo.toml @@ -17,6 +17,8 @@ features = ["rpk"] rustdoc-args = ["--cfg", "docsrs"] [features] +default = ["boring/default"] + # Use a FIPS-validated version of boringssl. fips = ["boring/fips", "boring-sys/fips"] @@ -24,8 +26,8 @@ fips = ["boring/fips", "boring-sys/fips"] rpk = ["boring/rpk"] [dependencies] -boring = { workspace = true } -boring-sys = { workspace = true } +boring = { workspace = true, default-features = false } +boring-sys = { workspace = true, default-features = false } tokio = { workspace = true } [dev-dependencies]