cargo
cargo copied to clipboard
test(priv_dep): add test for `verify public is respected recursively`
What does this PR try to resolve?
This PR want to verify public is respected recursively
by rustc.
The original idea came from here: https://github.com/rust-lang/rust/issues/44663#issuecomment-1851227083.
How should we test and review this PR?
you can review and test on per commit.
Additional information
r? @ehuss
(rustbot has picked a reviewer for you, use r? to override)
Thanks for doing this investigation!
Any thoughts on what test cases are worth merging now vs waiting on rust-lang/rust#119428?
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 recursive_package_pub_no_warning
verifies the recursively public API does not cause warnings
. recursive_package_priv_warning
It's also a use case and a reminder of our current processing logic. It's ok to be updated recursive_package_priv_warning
when this issue https://github.com/rust-lang/rust/issues/119428 has any progress.
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 public
field when publish a crate, but this is only for test.
We should also support upload the public
field when publish crates to cratess-io
and so on.
At least one public
needs to be added here: https://github.com/rust-lang/cargo/blob/master/crates/crates-io/lib.rs#L67,
and optional: dep.is_public()
in https://github.com/rust-lang/cargo/blob/master/src/cargo/ops/registry/publish.rs#L353C45-L353C45
r? epage
In the commit I add a
public
field when publish a crate, but this is only for test.We should also support upload the
public
field when publish crates tocratess-io
and so on.At least one
public
needs to be added here: https://github.com/rust-lang/cargo/blob/master/crates/crates-io/lib.rs#L67, andoptional: dep.is_public()
in https://github.com/rust-lang/cargo/blob/master/src/cargo/ops/registry/publish.rs#L353C45-L353C45
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
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
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.
:umbrella: The latest upstream changes (presumably #13245) made this pull request unmergeable. Please resolve the merge conflicts.
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.
After talking in t-crates-io channel, I've gathered the information as below:
- the crates-io currently not suport
public
field. - if they plan to support that they may ignore the
public
in metadata carried with the publish api.
So is it deserves to make a PR to add public
field when publish crates?