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

Concrete playback needs tweak with overridden rust-toolchain #1581

Closed
zhassan-aws opened this issue Aug 23, 2022 · 1 comment · Fixed by #2464
Closed

Concrete playback needs tweak with overridden rust-toolchain #1581

zhassan-aws opened this issue Aug 23, 2022 · 1 comment · Fixed by #2464
Labels
[C] Bug This is a bug. Something isn't working.

Comments

@zhassan-aws
Copy link
Contributor

The instructions for the concrete playback feature mention that once a concrete playback test is generated, one can run it with cargo test. For packages that pin a specific rust toolchain (e.g. via a rust-toolchain file), this could result in an error if the pinned rust toolchain is a stable release because compiling Kani requires using nightly due to the usage of unstable features.

Steps to reproduce:

  1. cargo new --lib conc_playback
  2. cd conc_playback
  3. Add kani to the dev dependencies in Cargo.toml:
[dev-dependencies]
kani = { git = "https://github.com/model-checking/kani", features = ["concrete_playback"] }
  1. Create a file to pin the rust toolchain:
echo "1.63.0" > rust-toolchain
  1. Replace src/lib.rs with the following:
#[kani::proof]
fn main() {
    let x: u8 = kani::any();
    let y: u8 = kani::any();
    assert_eq!(x, y);
}
  1. Run Kani:
cargo kani --harness main --enable-unstable --concrete-playback=inplace
  1. Run cargo test kani_concrete_playback_main_241008145652399799 to run the concrete trace. This errors out with:
   Compiling conc_playback v0.1.0 (/home/ubuntu/examples/new-iss8/conc_playback)
   Compiling quote v1.0.21
   Compiling syn v1.0.99
   Compiling kani_macros v0.9.0 (https://github.com/model-checking/kani#6405617b)
   Compiling kani v0.9.0 (https://github.com/model-checking/kani#6405617b)
error[E0554]: `#![feature]` may not be used on the stable release channel
 --> /home/ubuntu/.cargo/git/checkouts/kani-0ce0dacf5e98886d/6405617/library/kani/src/lib.rs:5:1
  |
5 | #![feature(rustc_attrs)]
  | ^^^^^^^^^^^^^^^^^^^^^^^^

For more information about this error, try `rustc --explain E0554`.
error: could not compile `kani` due to previous error
@zhassan-aws zhassan-aws added the [C] Bug This is a bug. Something isn't working. label Aug 23, 2022
@zhassan-aws
Copy link
Contributor Author

The workaround is to run cargo test with nightly, e.g.:

cargo +nightly-2022-08-16 test kani_concrete_playback_main_241008145652399799

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

Successfully merging a pull request may close this issue.

2 participants