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

Enable All Except A Specific Feature From CLI #11467

Closed
tustvold opened this issue Dec 8, 2022 · 4 comments
Closed

Enable All Except A Specific Feature From CLI #11467

tustvold opened this issue Dec 8, 2022 · 4 comments
Labels
C-feature-request Category: proposal for a feature. Before PR, ping rust-lang/cargo if this is not `Feature accepted`

Comments

@tustvold
Copy link
Contributor

tustvold commented Dec 8, 2022

Problem

Within the arrow repository we have a workspace with a moderate number of library crates, each with their own features. In CI we would like to enable all features to ensure we run all the tests, unfortunately one of the features "simd" is only available on nightly compilers.

This leads to an error prone approach of having to list every feature apart from the one that can't be run on stable

cargo test -p arrow --features=force_validate,prettyprint,ipc_compression,ffi,dyn_cmp_dict,dyn_arith_dict,chrono-tz

It is not uncommon to accidentally miss a feature out from this list, especially as this has to be duplicated not only for cargo test but also the various cargo check and cargo clippy commands.

Proposed Solution

I would like to be able to use something like

cargo test --all-features-except simd

Which would enable all features except those listed

Notes

No response

@tustvold tustvold added the C-feature-request Category: proposal for a feature. Before PR, ping rust-lang/cargo if this is not `Feature accepted` label Dec 8, 2022
@weihanglo
Copy link
Member

Thank you for the report. I believe this is covered by #3126. People are brewing innovative ideas and syntaxes there. Any further discussion is suggested to happen in that thread. Closing now. Thanks again!

@weihanglo weihanglo closed this as not planned Won't fix, can't repro, duplicate, stale Dec 8, 2022
@tustvold
Copy link
Contributor Author

tustvold commented Dec 8, 2022

#3126 refers to disabling features which isn't what I'm asking for, and has complex semantics being debated on the issue. I'm instead asking for a way to enable everything except a specific feature, i.e. purely additive not subtractive, and purely constrained to the CLI?

@weihanglo
Copy link
Member

There are more comments talking about features=-foo syntax. For instance, --all-features --features -legacy-compat covers the usage of proposed --all-features-except option. I feel like we should consider them as a whole to avoid introducing too many new flags serving only few special purposes.

@tustvold
Copy link
Contributor Author

tustvold commented Dec 9, 2022

Fair enough, I guess I just hoped that by reducing the scope to something small and uncontroversial we could get something in, as opposed to waiting on something that has been being discussed for 6 years now... Perfect is the enemy of good and all that

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-feature-request Category: proposal for a feature. Before PR, ping rust-lang/cargo if this is not `Feature accepted`
Projects
None yet
Development

No branches or pull requests

2 participants