ci: check the feature powerset with cargo-hack - #191
Merged
Conversation
Every plug enables kble-socket with both `stdio` and `tungstenite`, so a workspace build never compiles a single feature on its own — a crate can advertise a feature that fails to build by itself while CI stays green (kble-socket's `stdio`-only build has been broken since the repo opened). Run `cargo hack check --feature-powerset` over the workspace so every feature combination is compiled. cargo-hack is installed as a prebuilt binary via taiki-e/install-action rather than `cargo install`, so it need not satisfy the project's pinned toolchain (the latest cargo-hack's MSRV already exceeds it). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
sksat (sksat)
force-pushed
the
ci/cargo-hack-feature-powerset
branch
from
June 5, 2026 01:39
fe577d2 to
eb0e5c0
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Add a
cargo hack check --feature-powersetstep to CI so every feature combination of every workspace crate is compiled.Why
The plugs always pull in
kble-socketwith bothstdioandtungstenite. Thanks to Cargo's feature unification, a normalcargo testover the workspace therefore never buildskble-socketwith a single feature on its own — so a crate can advertise a feature that fails to compile by itself and CI stays green.That is exactly what happened:
kble-socketwithstdioalone (notungstenite) has failed to compile since the repo was first opened (7c463ac, 2023-04-12):from_stdiois#[cfg(feature = "tungstenite")]but was re-exported under#[cfg(feature = "stdio")]. #190 fixes the bug; this PR adds the guard that would have caught it (and will catch the next one).Demonstrating the catch (RED → GREEN)
cargo hack check --feature-powerset --no-dev-deps -p kble-socketon the currentmain:With #190's fix applied, all 15 workspace runs (incl. kble-socket's 8 combos) pass.
Notes
kble-socketis the only crate with[features], so the powerset is just its 2³ = 8 combinations; other members are checked once (no features). No combinatorial blowup.taiki-e/install-action(a prebuilt binary) rather thancargo install, because the latest cargo-hack's MSRV (1.85) already exceeds this repo's pinned toolchain (1.78). The prebuilt binary is toolchain-independent; the underlyingcargo checkstill runs under the pinned 1.78.🤖 Generated with Claude Code