-
Notifications
You must be signed in to change notification settings - Fork 12.9k
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
Implement public/private dependency feature #57586
Conversation
r? @estebank (rust_highfive has picked a reviewer for you, use r? to override) |
if !self.tcx.features().public_private_dependencies { | ||
return false | ||
} | ||
let ret = self.required_visibility == ty::Visibility::Public && |
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.
This will report things used in pub
, but unreachable items, e.g.
mod private_details {
pub fn details() -> PrivateDep { ... } // Will be linted
}
, but that's probably okay for a start.
0cd5623
to
debcece
Compare
The job Click to expand the log.
I'm a bot! I can only do what humans tell me to, so if this was not helpful or you have suggestions for improvements, please ping or otherwise contact |
@estebank Otherwise, comments beside #57586 (comment) still need to be addressed. |
This is looking good to me, it is a lot smaller than I was expecting! Were there particular design questions that I should weigh in on? Or is it just technical details? |
|
☔ The latest upstream changes (presumably #55641) made this pull request unmergeable. Please resolve the merge conflicts. |
9eda2dd
to
fb74e48
Compare
The job Click to expand the log.
I'm a bot! I can only do what humans tell me to, so if this was not helpful or you have suggestions for improvements, please ping or otherwise contact |
d2dadee
to
369faae
Compare
@petrochenkov: I've rebased against master. |
@bors r+ |
📌 Commit 369faae has been approved by |
Implement public/private dependency feature Implements #44663 The core implementation is done - however, there are a few issues that still need to be resolved: - [x] The `EXTERNAL_PRIVATE_DEPENDENCY` lint currently does notthing when the `public_private_dependencies` is not enabled. Should mentioning the lint (in an `allow` or `deny` attribute) be an error if the feature is not enabled? (Resolved- the feature was removed) - [x] Crates with the name `core` and `std` are always marked public, without the need to explcitily specify them on the command line. Is this what we want to do? Do we want to allow`no_std`/`no_core` crates to explicitly control this in some way? (Resolved - private crates are now explicitly specified) - [x] Should I add additional UI tests? (Resolved - added more tests) - [x] Does it make sense to be able to allow/deny the `EXTERNAL_PRIVATE_DEPENDENCY` on an individual item? (Resolved - this is implemented)
☀️ Test successful - checks-travis, status-appveyor |
Grate work on getting this landed! Thank you! That is 1 of 3 major parts of the implementation for that RFC done! I am working on the cargo dependency resolution part. It is working, just exponentially slow. At any time I can make a PR (with the fuzz testing turned off) with something functional enough for someone to start working on the 3ed part. Namely the cargo front end part, adding it to the Cargo.toml, to the registry, a future flag, and passing the args to rustc. Let me know if I should make that PR. |
@Eh2406: That sounds like a good idea |
PR is up rust-lang/cargo#6653 |
part of the infrastructure for public & private dependencies in the resolver This is part of my work on public & private dependencies in the resolver from #6129. As discussed there the proptest fuzzers are happy to find exponential blow up with all the back jumping strategies I have tried. So this PR does not have a back jumping strategie nor does it have the proptest fuzzers generating public dependencies. These will both need to change for the feature to stabilize. In the meantime it gives the correct results on the cases it can handle. With rust-lang/rust#57586 landed there is a lot of work to do on Cargos front end. Adding a UI for this, passing the relevant things to rustc, passing it to crates.io, passing it to cargo-metadata. This is good enough to allow that work to proceed.
@Aaron1011 The PR is merged, we would love to guide you (or anyone) to doing the cargo-frontend side! |
I've started work on the cargo-frontend side. |
…petrochenkov Properly parse '--extern-private' with name and path It turns out that rust-lang#57586 didn't properly parse `--extern-private name=path`. This PR properly implements the `--extern-private` option. I've added a new `extern-private` option to `compiletest`, which causes an `--extern-private` option to be passed to the compiler with the proper path. Part of rust-lang#44663
Properly parse '--extern-private' with name and path It turns out that #57586 didn't properly parse `--extern-private name=path`. This PR properly implements the `--extern-private` option. I've added a new `extern-private` option to `compiletest`, which causes an `--extern-private` option to be passed to the compiler with the proper path. Part of #44663
Properly parse '--extern-private' with name and path It turns out that #57586 didn't properly parse `--extern-private name=path`. This PR properly implements the `--extern-private` option. I've added a new `extern-private` option to `compiletest`, which causes an `--extern-private` option to be passed to the compiler with the proper path. Part of #44663
@Aaron1011 Was |
Implements #44663
The core implementation is done - however, there are a few issues that still need to be resolved:
EXTERNAL_PRIVATE_DEPENDENCY
lint currently does notthing when thepublic_private_dependencies
is not enabled. Should mentioning the lint (in anallow
ordeny
attribute) be an error if the feature is not enabled? (Resolved- the feature was removed)core
andstd
are always marked public, without the need to explcitily specify them on the command line. Is this what we want to do? Do we want to allowno_std
/no_core
crates to explicitly control this in some way? (Resolved - private crates are now explicitly specified)EXTERNAL_PRIVATE_DEPENDENCY
on an individual item? (Resolved - this is implemented)