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 work with Rust versions below 1.77 #3967

Open
clubby789 opened this issue Mar 31, 2025 · 3 comments
Open

Kani doesn't work with Rust versions below 1.77 #3967

clubby789 opened this issue Mar 31, 2025 · 3 comments
Labels
[C] Feature / Enhancement A new feature request or enhancement to an existing feature.

Comments

@clubby789
Copy link

cargo +1.76 new demo
cd demo
cargo +1.76 kani

This results in the error

error: expected a version like "1.32"
error: Failed to execute cargo (exit status: 101). Found 0 compilation errors.

#3593 uses the package ID from cargo metadata as the argument to -p, but before the package ID spec was stabilized in 1.77, the package ID couldn't be used in this way.

Feel free to close if supporting older Rust versions is not desired

@clubby789 clubby789 added the [C] Bug This is a bug. Something isn't working. label Mar 31, 2025
@tautschnig
Copy link
Member

We'd very much welcome patches to support both old and new versions. Else we'd have to ask you to use an older version of Kani, which should still be available from our releases page.

@tautschnig tautschnig added [C] Feature / Enhancement A new feature request or enhancement to an existing feature. and removed [C] Bug This is a bug. Something isn't working. labels Mar 31, 2025
@clubby789
Copy link
Author

@carolynzech To elaborate on the issue above: While Kani mostly uses the linked nightly Rust toolchain, when gathering metadata we run cargo metadata which uses the system's rustup cargo shim. This respects any +version overrides, rust-toolchain.toml in the project directory etc. If rustup resolves to a pre-1.77 version of Cargo, this means we get a package identifier that has an invalid format for the -p argument leading to the above error.

@carolynzech
Copy link
Contributor

This respects any +version overrides, rust-toolchain.toml in the project directory etc. If rustup resolves to a pre-1.77 version of Cargo, this means we get a package identifier that has an invalid format for the -p argument leading to the above error.

Right, that makes sense to me. My point in #3972 is that users shouldn't invoke Kani with +version overrides anyway, so rather than quietly fix it in the background by using our rust-toolchain.toml file, it's better to error so they get a hint that they're doing something wrong. If we just fix it in the background, they'll think that we're using their +version when we're not, which may lead to more confusion down the line.

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.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants