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

Conversation

thomasspriggs
Copy link
Contributor

@thomasspriggs thomasspriggs commented Mar 29, 2021

Includes updating z3 to 4.8.10 for Windows CI jobs. So that the version, which is currently most recently released is available for use in Windows regression tests. Z3 installation was previously broken, due to the chocolatey package being out of date / broken and due to the installation being missing from various jobs.

  • Each commit message has a non-empty body, explaining why the change was made.
  • Methods or procedures I have added are documented, following the guidelines provided in CODING_STANDARD.md.
  • The feature or user visible behaviour I have added or modified has been documented in the User Guide in doc/cprover-manual/
  • Regression or unit tests are included, or existing tests cover the modified code (in this case I have detailed which ones those are in the commit message).
  • My commit message includes data points confirming performance improvements (if claimed).
  • My PR is restricted to a single feature or bugfix.
  • White-space or formatting changes outside the feature-related changed lines are in commits of their own.

@thomasspriggs thomasspriggs requested a review from a team as a code owner March 29, 2021 18:06
Copy link
Contributor

@NlightNFotis NlightNFotis left a comment

Choose a reason for hiding this comment

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

I have a couple of remarks:

  1. This PR claims to be upgrading z3 on windows, but it also makes a number of other changes, such as probing for z3 version on mac and ubuntu jobs? Is this on purpose? If that's the case, can the PR be renamed to accurately reflect scope of changes, or submit the changes as another PR?
  2. One of the CI jobs is failing because it's probing for z3 when it's not installed.

@@ -287,7 +287,7 @@ jobs:
submodules: recursive
- name: Fetch dependencies
run: |
choco install winflexbison3 strawberryperl
choco install winflexbison3 strawberryperl z3
Copy link
Contributor

Choose a reason for hiding this comment

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

Should this commit be dropped?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This commit exists, so that I am not doing both adding and updating in subsequent commits.

@codecov
Copy link

codecov bot commented Mar 29, 2021

Codecov Report

Merging #5983 (037ec0b) into develop (a387193) will increase coverage by 0.07%.
The diff coverage is 94.79%.

Impacted file tree graph

@@             Coverage Diff             @@
##           develop    #5983      +/-   ##
===========================================
+ Coverage    75.04%   75.12%   +0.07%     
===========================================
  Files         1433     1435       +2     
  Lines       155817   156301     +484     
===========================================
+ Hits        116932   117416     +484     
  Misses       38885    38885              
Impacted Files Coverage Δ
...nalyses/variable-sensitivity/abstract_object_set.h 100.00% <ø> (ø)
...lyses/variable-sensitivity/abstract_value_object.h 87.71% <ø> (ø)
...ses/variable-sensitivity/constant_abstract_value.h 100.00% <ø> (ø)
...s/variable-sensitivity/value_set_abstract_object.h 100.00% <ø> (ø)
src/ansi-c/c_typecheck_base.h 100.00% <ø> (ø)
src/ansi-c/expr2c_class.h 100.00% <ø> (ø)
src/goto-programs/goto_convert_class.h 87.30% <ø> (ø)
src/goto-symex/goto_state.h 100.00% <ø> (ø)
src/solvers/smt2/smt2_conv.h 100.00% <ø> (ø)
src/util/expr.h 97.84% <ø> (ø)
... and 49 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 44b5936...037ec0b. Read the comment docs.

Copy link
Contributor

@TGWDB TGWDB left a comment

Choose a reason for hiding this comment

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

A couple of bookkeeping changes:

  1. The PR comment claims "latest version", which may be true today but will not be in future. Since the PR explicitly sets the version to 4.8.10 can we make that clear? (Specially since we could probably also use something like https://github.com/Z3Prover/z3/releases/latest for the true latest.)
  2. Several places claim to "Check z3 version", but I think they only display the version, there does not appear to be a "check" that this is correct?

@thomasspriggs
Copy link
Contributor Author

After discussion with Fotis, I am going to change this PR to fix Z3 installation across all jobs and add a test. Please wait for me to push the extra changes, before reviewing.

@thomasspriggs thomasspriggs changed the title Update z3 to 4.8.10 for Windows CI jobs Fix z3 installation on PR CI jobs Mar 30, 2021
@thomasspriggs
Copy link
Contributor Author

A couple of bookkeeping changes:

  1. The PR comment claims "latest version", which may be true today but will not be in future. Since the PR explicitly sets the version to 4.8.10 can we make that clear? (Specially since we could probably also use something like https://github.com/Z3Prover/z3/releases/latest for the true latest.)

I think this should now be fixed.

  1. Several places claim to "Check z3 version", but I think they only display the version, there does not appear to be a "check" that this is correct?

It is useful as is for confirming that Z3 is installed, in the path and logging the version. We could in theory check that the information printed is what we expect. But I think the changes are useful as is, without adding more functionality. I'll re-word the message a little, in order to try and make this clear.

This was previously missing, which would cause any tests which needed Z3
to fail this job.
Because the `choco` installation of `z3` seems to be broken/outdated.

Using `Invoke-WebRequest` instead of `choco` allows us to pin the
version installed and to get a version which includes the `z3.exe`, not
just `z3.dll`. Using `nuget` was also considered, so that we were still
using a package manager. But the up to date `nuget` package was missing
the `.exe` file.

`wget` is supposed to be aliased to `Invoke-WebRequest` in powershell.
However `Invoke-WebRequest` is used rather than `wget` as `wget` does
not seem to work for windows github actions jobs.
This was previously missing, which would cause any tests which needed Z3
to fail this job.
@thomasspriggs thomasspriggs force-pushed the tas/update_windows_z3 branch from 5ea7a5a to 4c6f240 Compare March 30, 2021 10:01
For confirmation of version and that installation is successfull. This
supports easier debugging for both the github actions `.yaml` and for
future test failures. As a bonus we get fast failing CI jobs if the
dependency isn't installed properly, because it fails at this step
rather than during testing.

This z3 version check is done as a separate step because adding to
`$env:GITHUB_PATH` doesn't take effect the path until the next step.
This confirms that Z3 is present and working in CI, as well as that
cbmc's support for Z3 is not entirely broken.
@thomasspriggs thomasspriggs force-pushed the tas/update_windows_z3 branch from 7dc7632 to 037ec0b Compare March 30, 2021 16:53
@thomasspriggs
Copy link
Contributor Author

@TGWDB Your comments should now be addressed. Please re-review when you have a minute.

@SaswatPadhi
Copy link
Contributor

Not a blocker if we don't have broken tests right now, but we might soon run into cases where a regression test might pass on Windows & Mac but failing on Ubuntu 18.04 or 20.04 because they're running older versions of Z3 (4.4.1 and 4.8.7 respectively).

Would it be possible to wget the https://github.com/Z3Prover/z3/releases/download/z3-4.8.10/z3-4.8.10-x64-ubuntu-18.04.zip binary from https://github.com/Z3Prover/z3/releases/tag/z3-4.8.10 and just move it to /usr/local/bin or some directory in $PATH?

@tautschnig is listed as the maintainer of the z3 Ubuntu package (https://packages.ubuntu.com/bionic/z3), may be he could help too.

Copy link
Contributor

@NlightNFotis NlightNFotis left a comment

Choose a reason for hiding this comment

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

LGTM

@NlightNFotis NlightNFotis merged commit 9f0dcfd into diffblue:develop Mar 31, 2021
@thomasspriggs thomasspriggs deleted the tas/update_windows_z3 branch March 31, 2021 09:23
@thomasspriggs
Copy link
Contributor Author

@SaswatPadhi Now that this is merged, you should be able to re-base and merge #5904

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.

4 participants