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

Feature request: exclude crates from workspace at build time #2375

Closed
andreeaflorescu opened this issue Apr 14, 2023 · 0 comments · Fixed by #2399
Closed

Feature request: exclude crates from workspace at build time #2375

andreeaflorescu opened this issue Apr 14, 2023 · 0 comments · Fixed by #2399
Assignees
Labels
[C] Feature / Enhancement A new feature request or enhancement to an existing feature. [E] User Experience An UX enhancement for an existing feature. Including deprecation of an existing one. T-User Tag user issues / requests

Comments

@andreeaflorescu
Copy link

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

@andreeaflorescu andreeaflorescu added the [C] Feature / Enhancement A new feature request or enhancement to an existing feature. label Apr 14, 2023
@adpaco-aws adpaco-aws added [E] User Experience An UX enhancement for an existing feature. Including deprecation of an existing one. T-User Tag user issues / requests labels Apr 14, 2023
@adpaco-aws adpaco-aws self-assigned this Apr 18, 2023
@adpaco-aws adpaco-aws moved this to Todo in Kani 2023-05-08 Apr 18, 2023
@adpaco-aws adpaco-aws moved this from Todo to In Progress in Kani 2023-05-08 Apr 18, 2023
@adpaco-aws adpaco-aws moved this from In Progress to Done in Kani 2023-05-08 Apr 21, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[C] Feature / Enhancement A new feature request or enhancement to an existing feature. [E] User Experience An UX enhancement for an existing feature. Including deprecation of an existing one. T-User Tag user issues / requests
Projects
No open projects
Status: Done
Development

Successfully merging a pull request may close this issue.

2 participants