-
Couldn't load subscription status.
- Fork 2.7k
Target features #1197 #7209
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
Target features #1197 #7209
Conversation
|
Thanks for the pull request, and welcome! The Rust team is excited to review your changes, and you should hear from @ehuss (or someone else) soon. If any changes to this PR are deemed necessary, please add them as extra commits. This ensures that the reviewer can see what has changed since they last reviewed the code. Due to the way GitHub handles out-of-date commits, this should also make it reasonably obvious what issues have or haven't been addressed. Large or tricky changes may require several passes of review and changes. Please see the contribution instructions for more information. |
|
Thanks @plyhun! This is pretty light on details though, mind filling in some information? Currently this has two commits, one of which says "Target features" and the other which says "Rustfmt". There's a long string of PRs I think leading to this one, but it'd be great to fill out a description and/or commit messages explaining what this PR does and how it does it. |
|
Thanks for the quick response @alexcrichton . In principle, my changes are:
Thus, the feature is still distinguished by a name, as before. Which is disputable, as only allows the unique feature being enabled or disabled according to the target # does not make sense on unix
[target.'cfg(windows)'.features]
winapi = []
# does not make sense on windows
[target.'cfg(unix)'.features]
root-utils = []Perhaps a move worth trying is to merge a feature name with platform, making them a single feature key, so the following constructions are also allowed: // This is not implemented!
[target.'cfg(windows)'.features]
dep = ["dep2/windows"]
[target.'cfg(unix)'.features]
dep = ["dep2/unix"]I did not dare to refactor the code that tough yet. |
| .with_stderr( | ||
| "\ | ||
| [COMPILING] c v1.0.0 ([..]) | ||
| [COMPILING] c v1.1.0 ([..]) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry for the long delay in replying, I did not have internet access for the past week. This is passing because it uses both c v1.0.0 and c v1.1.0 witch is only allowed as they are path dependencies. What happens when using Package::new("c", "1.0.0").publish() to test as Crates.io dependencies?
(btw you can rebase or merge in the same branch instead of opening new prs)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No worries. It may wait.
Have struggled fixing the windows' crlfs in place, so eventually had to recreate a PR.
tests/testsuite/metadata.rs
Outdated
| ], | ||
| "default_feat": [], | ||
| "optional_feat": [] | ||
| "default_feat": [ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am missing something, how is this a backwards compatible change to the metadata format?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Bah. My fault - I remember explicitly implementing this compatibility. The commit is on the way.
|
We discussed this in the cargo team meeting, and we agreed that this isn't something that should just directly appear as a PR on the Cargo repository. We agreed that this needs an RFC clearly discussing the user-visible behavior, use cases, and similar. If such an RFC gets accepted, this PR could be updated or a new one opened. |
|
Thanks for the update. That's fair. Will prepare the RFC asap. The last question, according to the comment above (last code block) - will it worth to change the implementation over (String, Platform) keys rather leaving just string keys? So there will be a possibility to have the same feature behaving differently on different platforms. |
|
☔ The latest upstream changes (presumably #7251) made this pull request unmergeable. Please resolve the merge conflicts. |
|
I'm gonna close this since it's been inactive for some time now and we decided previously that an RFC will be needed for this. |
No description provided.