-
Notifications
You must be signed in to change notification settings - Fork 100
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
Move all rustc arguments to kani-driver #2174
Conversation
1. It's good to have one source of truth. 2. This is needed for us to properly support caching compiler artifacts.
We need to at least set the panic strategy for this to succeed. I removed the harness here since we don't try to execute it, and this is really just trying to run code generation.
@@ -50,8 +50,7 @@ cd std_lib_test | |||
|
|||
# Add some content to the rust file including an std function that is non-generic. | |||
echo ' | |||
#[kani::proof] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why was this removed?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So we don't have to manually inject Kani dependency here. Since our goal for this script is to make sure we can generate code for the standard library, this seems much easier to maintain than duplicating a bunch of the compiler flags here.
@@ -68,7 +67,7 @@ echo "Starting cargo build with Kani" | |||
export RUST_BACKTRACE=1 | |||
export RUSTC_LOG=error | |||
export KANIFLAGS="--goto-c --ignore-global-asm --reachability=legacy" | |||
export RUSTFLAGS="--kani-flags" | |||
export RUSTFLAGS="--kani-flags -C panic=abort" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why this change?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I had to change this because in this script we are invoking kani-compiler
via cargo build
not via cargo kani
. This is the only relevant flag for the codegen to go through.
Description of changes:
Move all rustc arguments to kani-driver
Resolved issues:
None. It's part of #2137 and needed for #2036.
Related RFC:
Optional #ISSUE-NUMBER.
Call-outs:
Testing:
How is this change tested? Current tests
Is this a refactor change? Yes
Checklist
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 and MIT licenses.