-
Notifications
You must be signed in to change notification settings - Fork 129
Description
Requested feature
When building a workspace under kani, add the option to exclude certain crates from the build. Right now this functionality can be achieved by providing a list of the crates that should be built with kani and excluding the target crates from that list.
cargo kani -p crate1 crate2 crate3
This is not feasible to use when you have a workspace with lots of crates, out of which you want to exclude a comparatively small number. Instead, it would be nice to be able to specify a list of crates to exclude.
cargo kani --exclude test-crate
Use case
We are using kani in our project where we have 17 crates in one workspace. Out of these crates 2 binary crates are only relevant for Rust integration tests and we don't want to build them under kani. It is not feasible for us to pass 15 crates to the --package
option, so what we do instead is that we use cfg(kani)
to define a dummy main for the test related crates. This is making the code harder to read that it would be necessary, and it would be nice to exclude the test crates directly at build time instead.
Link to relevant documentation (Rust reference, Nomicon, RFC)
Cargo also defines a --exclude
flag: https://doc.rust-lang.org/cargo/commands/cargo-build.html#package-selection