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

Remove duplicated CBMC Viewer version string #2314

Open
wants to merge 1 commit 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
7 changes: 5 additions & 2 deletions kani-dependencies
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
CBMC_VERSION="5.79.0"
# If you update this version number, remember to bump it in `src/setup.rs` too
CBMC_VIEWER_VERSION="3.8"
CBMC_VIEWER_VERSION=$(
Copy link
Contributor

Choose a reason for hiding this comment

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

We wanted to use kani-dependencies as the single source of truth for versions of dependencies, so I would rather keep the version explicit here and instead update src/setup.rs to read the version from this file.

Copy link
Contributor

Choose a reason for hiding this comment

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

Thanks for catching that.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@zhassan-aws as part of @jaisnan's release script work, we will also need to store the GitHub repositories of each of these tools somewhere. It would be nice not to have to store them in two different places.

Can I suggest that we convert this file into JSON? The file is only ever used from the various install_*.sh scripts that run in CI. Thus, we could continue to read the versions if the CI has jq available. My proposal is to write the file like this:

{
  "CBMC_VIEWER": {
    "version": "3.8",
    "url": "https://github.com/model-checking/cbmc-viewer",
  }
}

Then install_cbmc.sh would do

CBMC_VERSION=$(jq -e CBMC.version < kani-dependencies.json)

and setup.rs would also parse the file with a JSON parser to find the CBMC Viewer version.

What do you think?

Copy link
Contributor

Choose a reason for hiding this comment

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

Converting it to a JSON file is definitely a good idea.

Copy link
Contributor

Choose a reason for hiding this comment

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

Actually, I don't understand why we want JSON here.

grep "cbmc-viewer==" < src/setup.rs |
awk -F== '{print $2}' |
awk -F '"' '{print $1}'
)
KISSAT_VERSION="3.0.0"
1 change: 0 additions & 1 deletion src/setup.rs
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,6 @@ fn setup_python_deps(kani_dir: &Path, os: &os_info::Info) -> Result<()> {
println!("[4/5] Installing Kani python dependencies...");
let pyroot = kani_dir.join("pyroot");

// TODO: this is a repetition of versions from kani/kani-dependencies
let pkg_versions = &["cbmc-viewer==3.8"];

if os_hacks::should_apply_ubuntu_18_04_python_hack(os)? {
Expand Down