From 309c2e6a3300b3e843d9039ae0a9320b6fa7c04b Mon Sep 17 00:00:00 2001 From: Michael Tautschnig Date: Thu, 5 Oct 2023 15:37:46 +0000 Subject: [PATCH] Limit --exclude to workspace packages 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. --- kani-driver/src/call_cargo.rs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/kani-driver/src/call_cargo.rs b/kani-driver/src/call_cargo.rs index 6bd6a0c35f38..eab035eab382 100644 --- a/kani-driver/src/call_cargo.rs +++ b/kani-driver/src/call_cargo.rs @@ -320,7 +320,11 @@ fn packages_to_verify<'b>( .collect() } else if !args.cargo.exclude.is_empty() { 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(),