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 requires nightly rustc #1609

Open
celinval opened this issue Sep 1, 2022 · 7 comments
Open

Concrete playback requires nightly rustc #1609

celinval opened this issue Sep 1, 2022 · 7 comments
Assignees
Labels
[C] Bug This is a bug. Something isn't working.

Comments

@celinval
Copy link
Contributor

celinval commented Sep 1, 2022

I tried the following:

$ cargo init dummy
$ cd dummy
$ cargo --version
cargo 1.63.0 (fd9c4297c 2022-07-01)

I added the following line to Cargo.toml

[dev-dependencies]
kani = { git = "https://github.com/model-checking/kani", features = ["concrete_playback"] }

I opened src/main.rs

#[kani::proof]
fn force_failure() {
  assert!(kani::any());
}

using the following command line invocation:

cargo kani --enable-unstable --concrete-playback
cargo test

with Kani version: 0.9.0

I expected to see this happen: Cargo runs the new test and fail.

Instead, this happened: Cargo failed to build kani library with the following error:

error[E0554]: `#![feature]` may not be used on the stable release channel
 --> ~/.cargo/git/checkouts/kani-0ce0dacf5e98886d/281d0bb/library/kani/src/lib.rs:5:1
  |
5 | #![feature(rustc_attrs)]
  | ^^^^^^^^^^^^^^^^^^^^^^^^
@celinval celinval added the [C] Bug This is a bug. Something isn't working. label Sep 1, 2022
@celinval
Copy link
Contributor Author

celinval commented Sep 1, 2022

We could guard the usage of rustc_attrs and rustc_diagnostic_item with cfg_attr, but I was wondering if there's a cleaner solution.

@celinval
Copy link
Contributor Author

celinval commented Sep 1, 2022

This is very similar to #1581. Same root cause.

@adpaco-aws
Copy link
Contributor

I was wondering if there's a cleaner solution.

I haven't been able to find one, but IMHO the cfg_attr solution is quite clean already.

@celinval
Copy link
Contributor Author

celinval commented Apr 12, 2023

I was wondering if there's a cleaner solution.

I haven't been able to find one, but IMHO the cfg_attr solution is quite clean already.

We could probably use a macro or a proc_macro to do that. Unfortunately, #2199 has added another unstable feature.

I was wondering if we can modify the concrete_playback::any_raw_internal() to remove the transmute and use a loop instead. This only runs in the concrete execution so it shouldn't be a problem.

@jaisnan
Copy link
Contributor

jaisnan commented Apr 12, 2023

Would removing the transmute theoretically remove the dependency on nightly features entirely? If so, that seems like the cleanest solution and option.

But i imagine, we need incomplete_features for Arbitrary and that means we'll need nightly for arbitrary, is that correct?

@celinval
Copy link
Contributor Author

The way we are doing transmute is the reason why we need the incomplete_features for arbitrary.

@celinval
Copy link
Contributor Author

The transmute could be replaced by storing Any as described here: #1527

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
No open projects
Status: No status
Status: In Progress
Status: Todo
Development

No branches or pull requests

7 participants