Skip to content

Cargo hack exclude-features skips the all-features step #296

Description

@orlp

If you run cargo hack check --each-feature the following happens:

  1. The crate gets checked with --no-default-features.
  2. The crate gets checked with --no-default-features --feature foo for each foo.
  3. The crate gets checked with --all-features.

However, when you specify --exclude-features unstable, not only does the unstable flag get skipped in step 2, we notice that step three is completely omitted. This fundamentally changes what's tested: namely all features in combination. I only asked for a single feature to be excluded, not this entire step.

When exclude-features is specified the --all-features step should still run, just with --features <computed-feature-list>, which is the list of all features except the excluded features. The lack of a good Cargo API to specify "all except these features" is no excuse for Cargo hack (which is already calculating feature lists anyway) to skip this step.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-featuresArea: features (--feature-powerset, --each-feature, etc.)

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions