Skip to content
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 include and exclude information to metadata #13330

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions src/cargo/core/package.rs
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,8 @@ pub struct SerializedPackage {
metabuild: Option<Vec<String>>,
default_run: Option<String>,
rust_version: Option<RustVersion>,
include: Vec<String>,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

While it might be useful to have include and exclude in cargo metadata output, it doesn't seem to be a proper way to fix rust-lang/rust-clippy#11677. The solution might end up reimplement the logic Cargo find and package files, which includes .gitignore, shell glob syntax, symlinks handling, git dirty status, and other details (see #11405). cargo package --list might be more reliable, but not 100% accurate (see #8407 and #11666).

I would suggest starting the discussion from an issue, and jump back to implementation when the design is settled.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes that's a good point. I'll open an issue so it can be discussed.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I opened #13331.

exclude: Vec<String>,
}

impl Package {
Expand Down Expand Up @@ -262,6 +264,8 @@ impl Package {
publish: self.publish().as_ref().cloned(),
default_run: self.manifest().default_run().map(|s| s.to_owned()),
rust_version: self.rust_version().cloned(),
include: self.manifest().include().to_vec(),
exclude: self.manifest().exclude().to_vec(),
}
}
}
Expand Down
Loading
Loading