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

Kani doesn't consider cargo arguments when finding the packages in a workspace #3816

Open
carolynzech opened this issue Jan 7, 2025 · 0 comments
Assignees
Labels
[C] Bug This is a bug. Something isn't working. T-User Tag user issues / requests

Comments

@carolynzech
Copy link
Contributor

I tried this code: parent.zip

using the following command line invocation:

cargo kani --manifest-path=manifest-test/add/Cargo.toml --package add --debug

with Kani version: 0.57

I expected to see this happen: verification of the harness succeeds.

Instead, this happened:

cargo kani --manifest-path=manifest-test/add/Cargo.toml --package add --debug
Kani Rust Verifier 0.57.0 (cargo plugin)
kani_driver::call_cargo: packages_to_verify args package_selection=["add"] package_exclusion=[] workspace=false
[Kani] Running: `/Users/cmzech/.kani/kani-0.57.0/toolchain/bin/cargo pkgid add`
error: could not find `Cargo.toml` in `/Users/cmzech/parent` or any parent directory
2025-01-07T20:19:51.627821Z DEBUG kani_driver: main_failure error=Failed to retrieve information for `add`
error: Failed to retrieve information for `add`

With Kani v0.56, verification succeeds.

The solution is to update the to_package_ids function introduced in #3593 to include --manifest-path (and any other provided cargo arguments) as part of the command, i.e.:

fn to_package_ids<'a>(..) {
 let mut cmd = setup_cargo_command()?;
 cmd.arg("pkgid");
 cmd.arg(pkg);
 // include --manifest-path if provided
... }
@carolynzech carolynzech added [C] Bug This is a bug. Something isn't working. T-User Tag user issues / requests labels Jan 7, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[C] Bug This is a bug. Something isn't working. T-User Tag user issues / requests
Projects
None yet
Development

No branches or pull requests

2 participants