-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
Add --public
support for cargo add
#13037
Comments
@rustbot claim |
@hi-rustin if you are ok handing this off, I think @linyihai was interested in contributing to public-private dependencies and I made this as a starting point for them. |
Never mind, if this issue you are instersted in then i will pick another #13038, it is ok for me :) |
Oh, I didn't know that. Please feel free to take it. |
I found it on the zuilp :( Please take it and give it a shot! Have a nice hacking time! |
@rustbot claim |
Add `--public` for `cargo add` ## What does this PR try to resolve? Complete #13037 This PR want to add `--public/--no public` flag for `cargo add` Note: this assumes we'll remove workspace inheritance support for `public` as it sounds like we'll be reverting it rust-lang/rust#44663 (comment). If we decide to keep workspace inheritance, we'll need to come back and update this. ## How should we test and review this PR? Most of Code were reference `cargo add --optional`, So can reviewed the new code based on the part of `optional` code. The new testcases were origin from the `cargo add --optional` part. - `public` testcase:there is no dependencies and will be add `public` dependencies. - `no_public` testcase: there is no dependencies and will be add `no_public` dependencies. - `overwrite_public` testcase: the dependencies already exists but will be overwrite with `public`. - `overwrite_no_public` testcase: the dependencies already exists but will be overwrite with `no_public`. - `overwrite_public_with_no_public` testcase: the dependencies already marked as `no_public` and will be overwrite with `public`. - `overwrite_no_public_with_public` testcase: the dependencies already marked as `public` and will be overwrite with `no_public`.
Resolved by #13046. Thank people for your inputs! |
Problem
rust-lang/rfcs#3516 calls for controlling the new
public
field incargo add
Proposed Solution
Add
--public
and--no-public
flags. This will mirror--optional
/--no-optional
Test cases
See the test cases for
--optional
for patterns in naming, etc.Notes
The RFC called for
--public <bool>
. ... I don't remember why I did that. I think it might have been due to some aspects of a previous design of the RFC and I forgot to update it. We can note this in the tracking issue for us to approve this deviation.The text was updated successfully, but these errors were encountered: