-
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
test(priv_dep): add test for verify public is respected recursively
#13183
Conversation
r? @ehuss (rustbot has picked a reviewer for you, use r? to override) |
d5fa7e2
to
10ff613
Compare
8dd77a7
to
d2b4b70
Compare
f9d2861
to
a5647da
Compare
Thanks for doing this investigation! Any thoughts on what test cases are worth merging now vs waiting on rust-lang/rust#119428? |
I think both test cases make sense. IMO, the test case And now I have no plans to add more use cases. If there is nothing else missing, I suggest a combined submission |
In the commit I add a We should also support upload the At least one |
verify public is respected recursively
verify public is respected recursively
1205b55
to
9398a1b
Compare
r? epage |
9398a1b
to
2633985
Compare
verify public is respected recursively
verify public is respected recursively
@@ -479,3 +479,220 @@ fn allow_priv_in_custom_build() { | |||
) | |||
.run() | |||
} | |||
|
|||
// A indirectly add D as private dependency. |
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.
These tests don't make it too clear that they are not expected behavior but that some help show existing bugs. We should call that out, linking to the issue in question
@@ -479,3 +479,220 @@ fn allow_priv_in_custom_build() { | |||
) | |||
.run() | |||
} | |||
|
|||
// A indirectly add D as private dependency. |
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've been unsure whether these should be merged before the related fix. Thinking on it more, and with rust-lang/rust#119428 being moved to the rust repo, I suspect we should hold off on tests that demonstrate bad behavior. The problem is that the fix would be merged into the rust repo but they can't update the tests in the same commit, adding more frustration to the process of fixing the bugs.
Sorry that I hadn't thought of it before you had put more time into polishing this up.
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.
It is ok to close this PR or add WIP to the title until the issue fixed in rust repo.
and what do you think this? Maybe this is not what you need to do now, because this will add a 'public' field to the user's local file |
test: support publish package with a `public` field. ### What does this PR try to resolve? This PR add a `public` alike method to support add a dependency as public/private, ``` Package::new("foo", "0.1.0") .cargo_feature("public-dependency").add_dep(Dependency::new("bar", "0.1.0").public(true)) ``` and then get it from registry in test. This PR was seperated from the #13183. ### How should we test and review this PR? You can review on per commit. After running the test case `publish_package_with_public_dependency`, you can check a "public" field in `./target/tmp/cit/t0/registry/3/b/bar`. ### Additional information r? epage
test: support publish package with a `public` field. ### What does this PR try to resolve? This PR add a `public` alike method to support add a dependency as public/private, ``` Package::new("foo", "0.1.0") .cargo_feature("public-dependency").add_dep(Dependency::new("bar", "0.1.0").public(true)) ``` and then get it from registry in test. This PR was seperated from the #13183. ### How should we test and review this PR? You can review on per commit. After running the test case `publish_package_with_public_dependency`, you can check a "public" field in `./target/tmp/cit/t0/registry/3/b/bar`. ### Additional information r? epage
Sorry, had overlooked that message. Yes, we need to add publish support. Looking at bindeps and artifacts, it looks like we do that for unstable features today. We will also need to make sure the crates.io side is implemented. |
☔ The latest upstream changes (presumably #13245) made this pull request unmergeable. Please resolve the merge conflicts. |
After talking in t-crates-io channel, I've gathered the information as below:
So is it deserves to make a PR to add |
This PR is outdated and there is no further progress to be made. |
What does this PR try to resolve?
This PR want to verify
public is respected recursively
by rustc.The original idea came from here: rust-lang/rust#44663 (comment).
How should we test and review this PR?
you can review and test on per commit.
Additional information
test case wait for add:
exported_private_dependencies
lint only take effect in innermost dependency rust#119428