Skip to content

Commit

Permalink
Limit --exclude to workspace packages (#2808)
Browse files Browse the repository at this point in the history
Previously, --exclude would start from the set of all packages
referenced in a workspace, i.e., the workspace's packages plus any
dependencies. Without --exclude, we would at most look at all the
workspace's packages, so --exclude would result in possibly verifying a
larger set of packages.
  • Loading branch information
tautschnig authored Oct 5, 2023
1 parent 6d9575e commit 534b050
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion kani-driver/src/call_cargo.rs
Original file line number Diff line number Diff line change
Expand Up @@ -319,8 +319,14 @@ fn packages_to_verify<'b>(
.map(|pkg_name| metadata.packages.iter().find(|pkg| pkg.name == *pkg_name).unwrap())
.collect()
} else if !args.cargo.exclude.is_empty() {
// should be ensured by argument validation
assert!(args.cargo.workspace);
validate_package_names(&args.cargo.exclude, &metadata.packages)?;
metadata.packages.iter().filter(|pkg| !args.cargo.exclude.contains(&pkg.name)).collect()
metadata
.workspace_packages()
.into_iter()
.filter(|pkg| !args.cargo.exclude.contains(&pkg.name))
.collect()
} else {
match (args.cargo.workspace, metadata.root_package()) {
(true, _) | (_, None) => metadata.workspace_packages(),
Expand Down

0 comments on commit 534b050

Please sign in to comment.