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

Conversation

karkhaz
Copy link
Contributor

@karkhaz karkhaz commented Mar 23, 2023

This ensures that the version string does not need to be updated in two places, either manually or via a release script.

Testing:

$ source kani-dependencies
$ echo $CBMC_VIEWER_VERSION                                                           
3.8

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.

This ensures that the version string does not need to be updated in two
places, either manually or via a release script.
@karkhaz karkhaz requested a review from a team as a code owner March 23, 2023 17:01
Copy link
Contributor

@jaisnan jaisnan left a comment

Choose a reason for hiding this comment

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

Thanks!

@@ -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.

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.

5 participants