Add cargo-hack to CI to check crate features#8927
Conversation
| channel: stable | ||
| - uses: taiki-e/install-action@cargo-hack | ||
| - name: Check types feature powerset | ||
| run: cargo hack check -p types --feature-powerset --no-dev-deps --exclude-features arbitrary-fuzz,portable |
There was a problem hiding this comment.
Note that I am excluding arbitrary-fuzz (since it is merely an alias of arbitrary) and portable (since it just enables a bls feature which should have no impact on our own compilation).
cargo-hack to CI to check crate features
|
We could also consider testing even more crates but using |
chong-he
left a comment
There was a problem hiding this comment.
Looks good. I have tested removing #[cfg(feature = "events")] in the eth2 crates and it will error. Just one comment below.
| cargo-hack: | ||
| name: cargo-hack |
There was a problem hiding this comment.
Instead of having a new check at the top-level (which makes the total check increases), I am wondering if we could combine all dependencies-related checks (cargo-udeps, cargo-sort and the current cargo-hack) into one top-level check, and then have these 3 cargo checks under it. We can name the top-level check something like "dependency-check". That will also reduce some boilerplate when defining the name etc required for a new top-level check. Just my 2 cents
Merge Queue Status
This pull request spent 29 minutes 28 seconds in the queue, including 27 minutes 8 seconds running CI. Required conditions to merge
|
Issue Addressed
#8926
Proposed Changes
Add a step to CI which runs
cargo checkacross all combinations of features for certain crates usingcargo-hackAdditional Info
I have only implemented checks for
eth2andtypessince these are our most "user-facing" crates but we can consider other candidates as well.The number of checks it makes scales at$2^N$ where N = number of features. So adding a single new feature effectively doubles the number of checks required. So when adding more features we should try to identify which features we can exclude if possible.