-
Notifications
You must be signed in to change notification settings - Fork 12.8k
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
RFC3239: Implement cfg(target)
- Part 1
#96909
Conversation
Awesome, thanks! |
This comment has been minimized.
This comment has been minimized.
Apparently my concern in the original RFC was never elaborated on, nor is the RFC in any way clear on this, but is this really intended to be a plain string comparison instead of a semantic comparison? That feels pretty wrong to me, but no one ever clarified it. (e.g. |
Maybe the part 2 will answer your question? You can see it there: #96913 |
Part 2 is the other part of the RFC, that is less controversial and properly defined. Unless that PR also somehow builds on top of this one and I missed something, but they seem pretty distinct from what I'm seeing. |
Sorry, I thought you asked about having more control about the checks. You can have the full one (which is the same as returned by cargo iirc) or you can check each sub element directly (implemented in part 2). |
I would've assumed the one that this PR implements (yet again the RFC never clarified what this PR is supposed to do) to first parse the string into its parts and then compare it semantically, i.e. parse it and lower it into the representation of part 2. |
Okay, so since this wasn't clarified in the original RFC, I'd like to properly open up the discussion about this again. Can this be implemented as a triple parser instead and then be lowered to the other representation? Basically I'd like to see |
Sounds acceptable to me. What do you think @joshtriplett ? |
I don't think it would be possible or even something that we would want because:
Given all the aforementioned points, I don't think we should go on that direction. |
Given the @CryZe's comments I don't think we should go on this direction either. I feel really skeptical about this whole thing. This only works for built-in targets, custom targets parsed from json files don't have full names. We need to stabilize |
Except that the RFC was accepted and this a needed feature. So what do we do at this point? |
This might seems weird but I actually agree that this direction this not great either.
Agree, especially with "over-fitting" instead of using the proper
I thought of that but because the RFC was accepted, I assumed that the risk was considered acceptable but I now realize that I was wrong. I don't know what would be a solution here.
🔽 This:
👍 |
The harm from this feature was significantly underestimated compared to the benefits when this RFC was evaluated, IMO. I think we need to start stabilizing the unstable Every use of a target by its full name means that we are missing some finer-grained controls (or hitting some very rare case, then it's not that important to improve its ergonomics, especially if those improvements come with significant downsides). |
I don't have any objection to re-evaluating the use cases for the whole-target-string part of the RFC. I do think the target shorthand syntax may make that less necessary. |
In order to move this forward (close or merge), T-lang could discussion in this in a triage meeting or at least be pinged on this PR. @joshtriplett |
The |
Nominating for lang team discussion. The specific lang team ask:
|
We discussed this in today's @rust-lang/lang meeting. We agreed that we'd like to drop the Could someone please send a PR to the RFCs repository, adding a note to the top of this RFC that we decided to only accept the For this PR, we'd love to have a version that just implements the target shorthand. |
I believe this was done in #96913, or am I missing something? |
Ok, then closing this PR. |
This pull-request implements the
cfg(target = "...")
part of RFC 3239.cc @GuillaumeGomez
r? @petrochenkov