Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Maybe: require one of a set of features in --feature-powerset #182

Closed
CAD97 opened this issue Feb 4, 2023 · 1 comment · Fixed by #193
Closed

Maybe: require one of a set of features in --feature-powerset #182

CAD97 opened this issue Feb 4, 2023 · 1 comment · Fixed by #193
Labels
C-enhancement Category: A new feature or an improvement for an existing one

Comments

@CAD97
Copy link

CAD97 commented Feb 4, 2023

As an example, consider a crate which uses a hashmap, and has a feature std to use the std hashmap and a feature hashbrown to use the hashmap from hashbrown. This crate requires that at least one of std or hashbrown are used, so --feature-powerset won't work as-is, because it will want to test the noncompiling --no-default-features configuration. There are other feature flags which the library would like to test as well, so --exclude-no-default-features isn't sufficient.

Currently, the crate can use two runs of cargo hack, e.g.

cargo hack --feature-powerset --features=std check
cargo hack --feature-powerset --features=hashbrown check

If there's more than one such set of "require one of." you can see how this could get complicated quickly, basically being its own separate powerset.

cargo-hack could potentially provide a flag --required-features-group std,hashbrown with the semantics of discarding any feature set which does not include at least one of the listed features in order to make this situation easier to test.

@taiki-e
Copy link
Owner

taiki-e commented Feb 5, 2023

I would accept a PR to add this. (This appears to be a more manageable version of #115)

@taiki-e taiki-e added the C-enhancement Category: A new feature or an improvement for an existing one label Feb 5, 2023
kornelski added a commit to kornelski/hack-temp-pr that referenced this issue Sep 1, 2023
kornelski added a commit to kornelski/hack-temp-pr that referenced this issue Sep 1, 2023
kornelski added a commit to kornelski/hack-temp-pr that referenced this issue Sep 1, 2023
kornelski added a commit to kornelski/hack-temp-pr that referenced this issue Sep 1, 2023
kornelski added a commit to kornelski/hack-temp-pr that referenced this issue Sep 4, 2023
kornelski added a commit to kornelski/hack-temp-pr that referenced this issue Sep 4, 2023
kornelski added a commit to kornelski/hack-temp-pr that referenced this issue Sep 4, 2023
taiki-e pushed a commit that referenced this issue Sep 4, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-enhancement Category: A new feature or an improvement for an existing one
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants