Skip to content

Commit

Permalink
Use a specific version of CBMC for both Ubuntu and macOS (rust-lang#1183
Browse files Browse the repository at this point in the history
)
  • Loading branch information
zhassan-aws authored Jul 20, 2022
1 parent a234448 commit beedd6a
Show file tree
Hide file tree
Showing 8 changed files with 34 additions and 11 deletions.
3 changes: 1 addition & 2 deletions .github/actions/setup/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,7 @@ runs:
shell: bash

- name: Install cbmc-viewer
# If you update this version number, remember to bump it in `src/setup.rs` too
run: ./scripts/setup/install_viewer.sh 3.5
run: ./scripts/setup/install_viewer.sh
shell: bash

- name: Install Rust toolchain
Expand Down
3 changes: 3 additions & 0 deletions kani-dependencies
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
CBMC_VERSION="5.61.0"
# If you update this version number, remember to bump it in `src/setup.rs` too
CBMC_VIEWER_VERSION="3.5"
3 changes: 2 additions & 1 deletion scripts/ci/copyright-exclude
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ gitattributes
gitignore
gitmodules
ignore
kani-dependencies
scripts/ci/copyright-exclude
tests/remote-target-lists/.*
tools/make-kani-release/license-notes.txt
tools/make-kani-release/license-notes.txt
9 changes: 6 additions & 3 deletions scripts/setup/install_viewer.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,14 @@ set -eu

# Install cbmc-viewer

if [[ $# -ne 1 ]]; then
echo "$0: Error: Specify the version to install"
# Source kani-dependencies to get CBMC_VIEWER_VERSION
source kani-dependencies

if [ -z "${CBMC_VIEWER_VERSION:-}" ]; then
echo "$0: Error: CBMC_VIEWER_VERSION is not specified"
exit 1
fi

set -x

python3 -m pip install cbmc-viewer==$1
python3 -m pip install cbmc-viewer==$CBMC_VIEWER_VERSION
14 changes: 12 additions & 2 deletions scripts/setup/macos-10.15/install_cbmc.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,15 @@

set -eux

# Install CBMC for macOS 10.15
brew install cbmc
# Source kani-dependencies to get CBMC_VERSION
source kani-dependencies

if [ -z "${CBMC_VERSION:-}" ]; then
echo "$0: Error: CBMC_VERSION is not specified"
exit 1
fi

# Install CBMC for macOS 10.15 from CBMC tap
# https://github.com/diffblue/cbmc/blob/develop/doc/ADR/homebrew_tap.md
brew tap diffblue/cbmc
brew install diffblue/cbmc/cbmc@${CBMC_VERSION}
2 changes: 1 addition & 1 deletion scripts/setup/macos-10.15/install_deps.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ set -eux
# Github promises weekly build image updates, so we can skip the update step and
# worst case we should only be 1-2 weeks behind upstream brew.
# https://docs.github.com/en/actions/using-github-hosted-runners/about-github-hosted-runners#supported-software
brew update
#brew update

# Install dependencies via `brew`
brew install universal-ctags wget
Expand Down
9 changes: 8 additions & 1 deletion scripts/setup/ubuntu/install_cbmc.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,15 @@

set -eu

# Source kani-dependencies to get CBMC_VERSION
source kani-dependencies

if [ -z "${CBMC_VERSION:-}" ]; then
echo "$0: Error: CBMC_VERSION is not specified"
exit 1
fi

UBUNTU_VERSION=$(lsb_release -rs)
CBMC_VERSION=5.61.0
FILE="ubuntu-${UBUNTU_VERSION}-cbmc-${CBMC_VERSION}-Linux.deb"
URL="https://github.com/diffblue/cbmc/releases/download/cbmc-${CBMC_VERSION}/$FILE"

Expand Down
2 changes: 1 addition & 1 deletion src/setup.rs
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ fn setup_python_deps(kani_dir: &Path, os: &os_info::Info) -> Result<()> {
println!("[4/6] Installing Kani python dependencies...");
let pyroot = kani_dir.join("pyroot");

// TODO: this is a repetition of versions from kani/scripts/setup/$OS/install_deps.sh
// TODO: this is a repetition of versions from kani/kani-dependencies
let pkg_versions = &["cbmc-viewer==3.5", "colorama==0.4.3"];

if os.os_type() == os_info::Type::Ubuntu
Expand Down

0 comments on commit beedd6a

Please sign in to comment.