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

Add script to automate build & running kani #78

Open
wants to merge 17 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 9 additions & 2 deletions .github/workflows/kani.yml

Choose a reason for hiding this comment

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

Since you are changing this file. Can you please rename line 19 (build) or give the workflow a nice name? 😊

Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ on:
paths:
- 'library/**'
- '.github/workflows/kani.yml'
- 'scripts/check_kani.sh'
- 'scripts/run-kani.sh'

defaults:
run:
Expand All @@ -35,4 +35,11 @@ jobs:
submodules: true

- name: Run Kani Script
Copy link
Member

Choose a reason for hiding this comment

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

Should this be named "Test Kani Script?"

Choose a reason for hiding this comment

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

I think this first step is in fact checking the standard library with Kani, right?

Copy link
Author

Choose a reason for hiding this comment

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

Yes, i shall separate the steps into test kani, following which I shall run kani on the standard library on the whole.

run: bash ./head/scripts/check_kani.sh ${{github.workspace}}/head
run: head/scripts/run-kani.sh --path ${{github.workspace}}/head

- name: Run Kani Script with --kani-args and -p
run: head/scripts/run-kani.sh -p ${{github.workspace}}/head --kani-args --harness ptr::verify::check_read_u128 --harness ptr::unique::verify::check_as_mut

Choose a reason for hiding this comment

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

I would suggest that you change the arguments to be something that doesn't depend on the harnesses configuration, or something very generic, like --harness ptr, which is less likely to be broken if we rename a harness.


- name: Run Kani Script without -p
working-directory: ${{github.workspace}}/head
Comment on lines +43 to +44
Copy link
Member

Choose a reason for hiding this comment

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

Couldn't the testing of the script itself be done in a separate job?

Copy link
Author

Choose a reason for hiding this comment

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

I'd initially put it in a separate job, but merged it all into one based on this comment #78 (comment)

Copy link
Member

Choose a reason for hiding this comment

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

Hmm, but given it's testing the script itself, shouldn't we have a workflow that doest just the script testing, and that workflow should only execute when any of the files relating to the script (the script itself plus toml files perhaps) change?

Choose a reason for hiding this comment

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

Just to clarify, I wasn't saying they had to be merged in the same job. It just wasn't clear to me what each workflow was doing.

I would suggest that you test the script as a separate job of this workflow. But make it clear what each step is testing, so people are not confused. Maybe add some comments explaining what this is testing.

run: scripts/run-kani.sh --kani-args --harness ptr::verify::check_read_u128 --harness ptr::unique::verify::check_as_mut
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,9 @@ Session.vim
## Build
/book/
/build/
/kani_build/
/target
/library/target
*.rlib
*.rmeta
*.mir
Expand Down
86 changes: 86 additions & 0 deletions library/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

55 changes: 0 additions & 55 deletions scripts/check_kani.sh

This file was deleted.

Loading
Loading