Add --must-have-and-exclude-feature
option.
#262
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.
Summary
This new option allows for more precise testing of packages that support
no_std
.The goal
I want to be able to properly test all packages that support
no_std
. The problem is tricky because I would like the command to be copy-pastable across 20 repositories and there's quite a bit of variation.Old solution
cargo hack clippy --workspace --locked --target x86_64-unknown-none --optional-deps --each-feature --ignore-unknown-features --features libm --exclude-features ${{ env.FEATURES_DEPENDING_ON_STD }}
This kind of works, but has problems:
std
.std
.std
due to the use of--target x86_64-unknown-none
. It is possible to overcome this, but it requires yet another per-workspace package exclusion configuration variable.New solution in this PR
With this new option, there is no longer a need for any configuration variables and the following command is universal:
Now
cargo-hack
will make sure to only select packages which actually have a feature calledstd
and it will also make sure to not enable any feature which would indirectly requirestd
.