Skip to content

Fix z3 installation on PR CI jobs #5983

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

Merged
merged 5 commits into from
Mar 31, 2021
Merged
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
28 changes: 26 additions & 2 deletions .github/workflows/pull-request-checks.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ jobs:
run: |
sudo apt-get update
sudo apt-get install --no-install-recommends -yq gcc gdb g++ maven jq flex bison libxml2-utils ccache cmake z3
- name: Confirm z3 solver is available and log the version installed
run: z3 --version
- name: Prepare ccache
uses: actions/cache@v2
with:
Expand Down Expand Up @@ -78,6 +80,8 @@ jobs:
sudo apt-get install --no-install-recommends -yq clang-10 clang++-10 gdb maven jq flex bison libxml2-utils cpanminus ccache z3
make -C src minisat2-download
cpanm Thread::Pool::Simple
- name: Confirm z3 solver is available and log the version installed
run: z3 --version
- name: Prepare ccache
uses: actions/cache@v2
with:
Expand Down Expand Up @@ -129,6 +133,8 @@ jobs:
run: |
sudo apt-get update
sudo apt-get install --no-install-recommends -yq cmake ninja-build gcc g++ maven flex bison libxml2-utils dpkg-dev ccache doxygen z3
- name: Confirm z3 solver is available and log the version installed
run: z3 --version
- name: Prepare ccache
uses: actions/cache@v2
with:
Expand Down Expand Up @@ -172,6 +178,8 @@ jobs:
submodules: recursive
- name: Fetch dependencies
run: brew install maven flex bison parallel ccache z3
- name: Confirm z3 solver is available and log the version installed
run: z3 --version
- name: Prepare ccache
uses: actions/cache@v2
with:
Expand Down Expand Up @@ -212,6 +220,8 @@ jobs:
submodules: recursive
- name: Fetch dependencies
run: brew install cmake ninja maven flex bison ccache z3
- name: Confirm z3 solver is available and log the version installed
run: z3 --version
- name: Prepare ccache
uses: actions/cache@v2
with:
Expand Down Expand Up @@ -248,9 +258,14 @@ jobs:
submodules: recursive
- name: Fetch dependencies
run: |
choco install winflexbison3 z3
choco install winflexbison3
nuget install clcache -OutputDirectory "c:\tools" -ExcludeVersion -Version 4.1.0
echo "c:\tools\clcache\clcache-4.1.0" >> $env:GITHUB_PATH
Invoke-WebRequest -Uri https://github.com/Z3Prover/z3/releases/download/z3-4.8.10/z3-4.8.10-x64-win.zip -OutFile .\z3.zip
Expand-Archive -LiteralPath '.\z3.Zip' -DestinationPath C:\tools
echo "c:\tools\z3-4.8.10-x64-win\bin;" >> $env:GITHUB_PATH
- name: Confirm z3 solver is available and log the version installed
run: z3 --version
- name: Setup Visual Studio environment
uses: microsoft/[email protected]
- name: Prepare ccache
Expand Down Expand Up @@ -292,6 +307,11 @@ jobs:
echo "c:\tools\clcache\clcache-4.1.0" >> $env:GITHUB_PATH
echo "c:\ProgramData\chocolatey\bin" >> $env:GITHUB_PATH
echo "c:\Strawberry\" >> $env:GITHUB_PATH
Invoke-WebRequest -Uri https://github.com/Z3Prover/z3/releases/download/z3-4.8.10/z3-4.8.10-x64-win.zip -OutFile .\z3.zip
Expand-Archive -LiteralPath '.\z3.Zip' -DestinationPath C:\tools
echo "c:\tools\z3-4.8.10-x64-win\bin;" >> $env:GITHUB_PATH
- name: Confirm z3 solver is available and log the version installed
run: z3 --version
- name: Setup MSBuild
uses: microsoft/[email protected]
- name: Initialise Developer Command Line
Expand Down Expand Up @@ -428,11 +448,13 @@ jobs:
- name: Fetch dependencies
run: |
sudo apt-get update
sudo apt-get install --no-install-recommends -y g++ flex bison cmake ninja-build maven jq libxml2-utils dpkg-dev ccache
sudo apt-get install --no-install-recommends -y g++ flex bison cmake ninja-build maven jq libxml2-utils dpkg-dev ccache z3
# remove libgcc-s1, which isn't normally available in Ubuntu 18.04
target=$(dpkg-query -W --showformat='${Version}\n' gcc-8-base | head -n 1)
# libgcc1 uses an epoch, thus the extra 1:
sudo apt-get install -y --allow-downgrades --reinstall gcc g++ libgcc-s1- libstdc++6=$target liblsan0=$target libtsan0=$target libcc1-0=$target libgcc1=1:$target
- name: Confirm z3 solver is available and log the version installed
run: z3 --version
- name: Prepare ccache
uses: actions/cache@v2
with:
Expand Down Expand Up @@ -515,6 +537,8 @@ jobs:
run: |
sudo apt-get update
sudo apt-get install --no-install-recommends -y g++ gcc binutils flex bison cmake maven jq libxml2-utils openjdk-11-jdk-headless lcov ccache z3
- name: Confirm z3 solver is available and log the version installed
run: z3 --version
- name: Prepare ccache
uses: actions/cache@v2
with:
Expand Down
8 changes: 8 additions & 0 deletions regression/cbmc/z3/invalid.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#include <assert.h>

int main()
{
unsigned int non_det;
assert(non_det * non_det != 9u);
return 0;
}
14 changes: 14 additions & 0 deletions regression/cbmc/z3/invalid.desc
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
CORE
invalid.c
--trace --smt2 --z3
^EXIT=10$
^SIGNAL=0$
line 6 assertion non_det \* non_det != 9u: FAILURE
non_det=\d+u
VERIFICATION FAILED
--
line 6 assertion non_det \* non_det != 9u: ERROR
error running SMT2 solver
--
Run cbmc with the --z3 option to confirm that support for the Z3 solver is
available and working for an invalid program where the assertion may fail.
8 changes: 8 additions & 0 deletions regression/cbmc/z3/valid.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#include <assert.h>

int main()
{
unsigned int non_det;
assert(non_det * non_det != 12u);
return 0;
}
13 changes: 13 additions & 0 deletions regression/cbmc/z3/valid.desc
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
CORE
valid.c
--trace --smt2 --z3
^EXIT=0$
^SIGNAL=0$
line 6 assertion non_det \* non_det != 12u: SUCCESS
VERIFICATION SUCCESSFUL
--
line 6 assertion non_det \* non_det != 12u: ERROR
error running SMT2 solver
--
Run cbmc with the --z3 option to confirm that support for the Z3 solver is
available and working for a valid program.