-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
Consider exposing target_feature
option in cargo CLI
#14524
Comments
Is this request specifically for |
Hard to say, |
Keeping it here for now in case we want this on other commands and so we'd want consistency. You mention CLI. For myself, I'm trying to be particular about what we add to the CLI. The CLI is front and center. As we add new flags, we make it harder to discover the flags that are already there. This means that adding a new flag, while having value for someone, can reduce the value gained by every other CLI flag for everyone. This is a phenomenon I've seen in clap where people ask for "new" features that exist or talk about things being impossible that are built-in. The cost of adding to the CLI is also discussed in #6100 (comment) For the use case given, I wonder if this is justified. This seems context dependent, like a Another approach is we do put this in the CLI but in a generic flag, like |
Interesting, I can understand that at minimum the
If the generic flag resolves the first problem, then it's already a win. |
Problem
When testing with
miri
one often has to enable target features (all SIMD features) to be sure to test SIMD instructions which tend to containunsafe
code. This requirestarget_feature
to be set in bothRUSTFLAGS
andRUSTDOCFLAGS
. Not only is this annoying but also a footgun. From my understandingmiri
just passes the arguments along so it's a cargo issue.Proposed Solution
Consider adding an argument that can set the target features as needed. Even better, also have an argument that enables all SIMD features.
Alternatively it could be decided that this is too niche and should be handled by
miri
and that may be the only tool that currently needs it, in which case I'll be happy to open an issue there.Notes
I've opened this as requested in #12739 (comment)
The text was updated successfully, but these errors were encountered: