-
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
Implement the 'frontend' of public-private dependencies #6772
Changes from all commits
87f1a4b
be9ae5e
715d6ac
8185564
8a45e5c
e578fc1
a22a7db
8c8824f
df4d209
2de44c4
f4aac94
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -18,6 +18,7 @@ use crate::core::resolver::Method; | |
use crate::core::{ | ||
Package, PackageId, PackageIdSpec, PackageSet, Resolve, Source, SourceId, Verbosity, Workspace, | ||
}; | ||
use crate::core::Feature; | ||
use crate::ops; | ||
use crate::sources::PathSource; | ||
use crate::util::errors::{CargoResult, CargoResultExt}; | ||
|
@@ -590,6 +591,14 @@ fn run_verify(ws: &Workspace<'_>, tar: &FileLock, opts: &PackageOpts<'_>) -> Car | |
let pkg_fingerprint = hash_all(&dst)?; | ||
let ws = Workspace::ephemeral(new_pkg, config, None, true)?; | ||
|
||
let rustc_args = if pkg.manifest().features().require(Feature::public_dependency()).is_ok() { | ||
// FIXME: Turn this on at some point in the future | ||
//Some(vec!["-D exported_private_dependencies".to_string()]) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Sorry for my ignorance. I don't know what this will do or why it is off now. Can you elaborate? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This turns all I thought it was best to leave it off for now, so that we don't imemdiately break publishing for people who enable this feature. |
||
None | ||
} else { | ||
None | ||
}; | ||
|
||
let exec: Arc<dyn Executor> = Arc::new(DefaultExecutor); | ||
ops::compile_ws( | ||
&ws, | ||
|
@@ -604,7 +613,7 @@ fn run_verify(ws: &Workspace<'_>, tar: &FileLock, opts: &PackageOpts<'_>) -> Car | |
required_features_filterable: true, | ||
}, | ||
target_rustdoc_args: None, | ||
target_rustc_args: None, | ||
target_rustc_args: rustc_args, | ||
local_rustdoc_args: None, | ||
export_dir: None, | ||
}, | ||
|
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.
Just to be sure I understand, this calculates the direct (not transitive) public dependencies for each package. Yes?
Why the the
d.kind() == Kind::Normal
?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.
The other kinds are
Development
andBuild
, neither of which can ever be exposed as transitive dependencies.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.
That makes sense. Should we have an error if you try a Cargo.toml that has a
Development
orBuild
dep with public set to true? Then add asserts in theset_public
to make sure we never let it slip in?