Skip to content

Commit 9f0dcfd

Browse files
authored
Merge pull request #5983 from thomasspriggs/tas/update_windows_z3
Fix z3 installation on PR CI jobs
2 parents abba3d7 + 037ec0b commit 9f0dcfd

File tree

5 files changed

+69
-2
lines changed

5 files changed

+69
-2
lines changed

.github/workflows/pull-request-checks.yaml

Lines changed: 26 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@ jobs:
1818
run: |
1919
sudo apt-get update
2020
sudo apt-get install --no-install-recommends -yq gcc gdb g++ maven jq flex bison libxml2-utils ccache cmake z3
21+
- name: Confirm z3 solver is available and log the version installed
22+
run: z3 --version
2123
- name: Prepare ccache
2224
uses: actions/cache@v2
2325
with:
@@ -78,6 +80,8 @@ jobs:
7880
sudo apt-get install --no-install-recommends -yq clang-10 clang++-10 gdb maven jq flex bison libxml2-utils cpanminus ccache z3
7981
make -C src minisat2-download
8082
cpanm Thread::Pool::Simple
83+
- name: Confirm z3 solver is available and log the version installed
84+
run: z3 --version
8185
- name: Prepare ccache
8286
uses: actions/cache@v2
8387
with:
@@ -129,6 +133,8 @@ jobs:
129133
run: |
130134
sudo apt-get update
131135
sudo apt-get install --no-install-recommends -yq cmake ninja-build gcc g++ maven flex bison libxml2-utils dpkg-dev ccache doxygen z3
136+
- name: Confirm z3 solver is available and log the version installed
137+
run: z3 --version
132138
- name: Prepare ccache
133139
uses: actions/cache@v2
134140
with:
@@ -172,6 +178,8 @@ jobs:
172178
submodules: recursive
173179
- name: Fetch dependencies
174180
run: brew install maven flex bison parallel ccache z3
181+
- name: Confirm z3 solver is available and log the version installed
182+
run: z3 --version
175183
- name: Prepare ccache
176184
uses: actions/cache@v2
177185
with:
@@ -212,6 +220,8 @@ jobs:
212220
submodules: recursive
213221
- name: Fetch dependencies
214222
run: brew install cmake ninja maven flex bison ccache z3
223+
- name: Confirm z3 solver is available and log the version installed
224+
run: z3 --version
215225
- name: Prepare ccache
216226
uses: actions/cache@v2
217227
with:
@@ -248,9 +258,14 @@ jobs:
248258
submodules: recursive
249259
- name: Fetch dependencies
250260
run: |
251-
choco install winflexbison3 z3
261+
choco install winflexbison3
252262
nuget install clcache -OutputDirectory "c:\tools" -ExcludeVersion -Version 4.1.0
253263
echo "c:\tools\clcache\clcache-4.1.0" >> $env:GITHUB_PATH
264+
Invoke-WebRequest -Uri https://github.com/Z3Prover/z3/releases/download/z3-4.8.10/z3-4.8.10-x64-win.zip -OutFile .\z3.zip
265+
Expand-Archive -LiteralPath '.\z3.Zip' -DestinationPath C:\tools
266+
echo "c:\tools\z3-4.8.10-x64-win\bin;" >> $env:GITHUB_PATH
267+
- name: Confirm z3 solver is available and log the version installed
268+
run: z3 --version
254269
- name: Setup Visual Studio environment
255270
uses: microsoft/[email protected]
256271
- name: Prepare ccache
@@ -292,6 +307,11 @@ jobs:
292307
echo "c:\tools\clcache\clcache-4.1.0" >> $env:GITHUB_PATH
293308
echo "c:\ProgramData\chocolatey\bin" >> $env:GITHUB_PATH
294309
echo "c:\Strawberry\" >> $env:GITHUB_PATH
310+
Invoke-WebRequest -Uri https://github.com/Z3Prover/z3/releases/download/z3-4.8.10/z3-4.8.10-x64-win.zip -OutFile .\z3.zip
311+
Expand-Archive -LiteralPath '.\z3.Zip' -DestinationPath C:\tools
312+
echo "c:\tools\z3-4.8.10-x64-win\bin;" >> $env:GITHUB_PATH
313+
- name: Confirm z3 solver is available and log the version installed
314+
run: z3 --version
295315
- name: Setup MSBuild
296316
uses: microsoft/[email protected]
297317
- name: Initialise Developer Command Line
@@ -428,11 +448,13 @@ jobs:
428448
- name: Fetch dependencies
429449
run: |
430450
sudo apt-get update
431-
sudo apt-get install --no-install-recommends -y g++ flex bison cmake ninja-build maven jq libxml2-utils dpkg-dev ccache
451+
sudo apt-get install --no-install-recommends -y g++ flex bison cmake ninja-build maven jq libxml2-utils dpkg-dev ccache z3
432452
# remove libgcc-s1, which isn't normally available in Ubuntu 18.04
433453
target=$(dpkg-query -W --showformat='${Version}\n' gcc-8-base | head -n 1)
434454
# libgcc1 uses an epoch, thus the extra 1:
435455
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
456+
- name: Confirm z3 solver is available and log the version installed
457+
run: z3 --version
436458
- name: Prepare ccache
437459
uses: actions/cache@v2
438460
with:
@@ -515,6 +537,8 @@ jobs:
515537
run: |
516538
sudo apt-get update
517539
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
540+
- name: Confirm z3 solver is available and log the version installed
541+
run: z3 --version
518542
- name: Prepare ccache
519543
uses: actions/cache@v2
520544
with:

regression/cbmc/z3/invalid.c

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
#include <assert.h>
2+
3+
int main()
4+
{
5+
unsigned int non_det;
6+
assert(non_det * non_det != 9u);
7+
return 0;
8+
}

regression/cbmc/z3/invalid.desc

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
CORE
2+
invalid.c
3+
--trace --smt2 --z3
4+
^EXIT=10$
5+
^SIGNAL=0$
6+
line 6 assertion non_det \* non_det != 9u: FAILURE
7+
non_det=\d+u
8+
VERIFICATION FAILED
9+
--
10+
line 6 assertion non_det \* non_det != 9u: ERROR
11+
error running SMT2 solver
12+
--
13+
Run cbmc with the --z3 option to confirm that support for the Z3 solver is
14+
available and working for an invalid program where the assertion may fail.

regression/cbmc/z3/valid.c

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
#include <assert.h>
2+
3+
int main()
4+
{
5+
unsigned int non_det;
6+
assert(non_det * non_det != 12u);
7+
return 0;
8+
}

regression/cbmc/z3/valid.desc

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
CORE
2+
valid.c
3+
--trace --smt2 --z3
4+
^EXIT=0$
5+
^SIGNAL=0$
6+
line 6 assertion non_det \* non_det != 12u: SUCCESS
7+
VERIFICATION SUCCESSFUL
8+
--
9+
line 6 assertion non_det \* non_det != 12u: ERROR
10+
error running SMT2 solver
11+
--
12+
Run cbmc with the --z3 option to confirm that support for the Z3 solver is
13+
available and working for a valid program.

0 commit comments

Comments
 (0)