Commit b3df1eb
Carolyn Zech
Use our toolchain when invoking
## Summary
Change our invocation of `cargo metadata` to use Kani's toolchain.
## Explanation
Kani uses the [cargo_metadata](https://crates.io/crates/cargo_metadata)
API to invoke `cargo metadata`. We were neglecting to override the Rust
toolchain version with the one from our `rust-toolchain.toml` file, so
the command would use the toolchain from the target crate. The issue is
that Rust 1.77 [stabilized the package id
format](https://doc.rust-lang.org/nightly/cargo/CHANGELOG.html#cargo-177-2024-03-21),
so Kani, which is past 1.77, would expect the new version, and therefore
can do this:
https://github.com/model-checking/kani/blob/5d76510f8881153292124176d02300e6c13c2ffa/kani-driver/src/call_cargo.rs#L207
and know that the string representation of the package ID will work with
`-p`. Pre-stabilization, Cargo made no such guarantees, so fetching the
metadata with a pre 1.77 toolchain would return an id that's not
compatible with the `-p` flag.
Resolves #3997
By submitting this pull request, I confirm that my contribution is made
under the terms of the Apache 2.0 and MIT licenses.cargo metadata (#4090)1 parent 485d8e0 commit b3df1eb
2 files changed
+21
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
7 | | - | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
8 | 10 | | |
9 | 11 | | |
10 | 12 | | |
| |||
247 | 249 | | |
248 | 250 | | |
249 | 251 | | |
| 252 | + | |
| 253 | + | |
| 254 | + | |
| 255 | + | |
250 | 256 | | |
251 | 257 | | |
252 | 258 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
439 | 439 | | |
440 | 440 | | |
441 | 441 | | |
| 442 | + | |
| 443 | + | |
| 444 | + | |
| 445 | + | |
| 446 | + | |
| 447 | + | |
| 448 | + | |
| 449 | + | |
| 450 | + | |
| 451 | + | |
| 452 | + | |
| 453 | + | |
| 454 | + | |
| 455 | + | |
0 commit comments