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

Move all rustc arguments to kani-driver #2174

Merged
merged 6 commits into from
Feb 3, 2023

Conversation

celinval
Copy link
Contributor

@celinval celinval commented Feb 2, 2023

Description of changes:

Move all rustc arguments to kani-driver

  1. It's good to have one source of truth.
  2. This is needed for us to properly support caching compiler artifacts

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

  • Each commit message has a non-empty body, explaining why the change was made
  • Methods or procedures are documented
  • Regression or unit tests are included, or existing tests cover the modified code
  • My PR is restricted to a single feature or bugfix

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 and MIT licenses.

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.
@celinval celinval requested a review from a team as a code owner February 2, 2023 01:24
kani-driver/src/call_cargo.rs Show resolved Hide resolved
kani-driver/src/call_single_file.rs Outdated Show resolved Hide resolved
@@ -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]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why was this removed?

Copy link
Contributor Author

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"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why this change?

Copy link
Contributor Author

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.

@celinval celinval merged commit 2b2c5f8 into model-checking:main Feb 3, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants