1

I have a project using library Z3 solver, and want to apply Travis-CI for continuous testing. However, I could not set up z3 on the remote machine in Travis-CI.

Here is further information about my project:

  • Created from IDE Eclipse Mars
  • Use JDK 8
  • Use Ant to buid build.xml

The content file .travis.yml

 language: java
 sudo: enabled
 jdk:
   - oraclejdk8
 before_install:
 - sudo apt-get update
 - sudo apt-get install z3 -y
 script:
 - ant build
 - ant 'MyJUnitTest'

The output on the remote machine console

... (be removed for clarity)
$ sudo apt-get install z3 -y
Reading package lists... Done
Building dependency tree       
Reading state information... Done
E: Unable to locate package z3
The command "sudo apt-get install z3 -y" failed and exited with 100 during .
Your build has been stopped.

I have understood that the problem could be solved by adding the repository containing Z3 solver to .travis.yml (section before_install). I found one repository: https://launchpad.net/~hvr/+archive/ubuntu/z3. However, this repository does not work anymore. More clearly, after 10 minutes (default waiting time on Travis-CI machine), there is no response from this repository.

$ sudo add-apt-repository ppa:hvr/z3

More info: https://launchpad.net/~hvr/+archive/ubuntu/z3
Press [ENTER] to continue or ctrl-c to cancel adding it
No output has been received in the last 10m0s, this potentially indicates a stalled build or something wrong with the build itself.
Check the details on how to adjust your build configuration on: https://docs.travis-ci.com/user/common-build-problems/#Build-times-out-because-no-output-was-received
The build has been terminated
ducanhnguyen
  • 161
  • 1
  • 10

1 Answers1

1

As far as I know there's no official/supported way to do this. It would be nice if there was a maintained repo indeed. But it is possible to do so with some hacking, by directly pulling down the releases and installing them on the build machine.

Using Nightly Z3 builds

Z3 folks do maintain nightly-builds on github, so it is indeed possible to pull the latest code and integrate it with Travis-CI (for Linux and Mac) and also Appveyor (for Windows).

As an example of how to do this in travis, see:

https://github.com/LeventErkok/sbv/blob/master/.travis.yml#L46-L66

For Appveyor setup, see:

https://github.com/LeventErkok/sbv/blob/master/.appveyor.yml#L10-L13

Depending on your exact needs, you should be able to adopt this to your own problem. (Note that the travis bit is doing a bit more than z3 by installing some other dependencies on Mac; you should leave those out. Ping if you need help!)

A note on stability

Unfortunately, this trick is not 100% fool-proof, and it does need occasional maintenance as it relies on where Z3 is stored, how the nightly builds are named, how travis/appveyor handle environment etc; but it has worked for me rather reliably for quite some time now. Good luck!

Using Stable Z3 versions

If you want the "stable" build instead of "nightly" z3, you can use a similar trick by modifying the locations slightly; by essentially getting them from: https://github.com/Z3Prover/bin/tree/master/releases instead of https://github.com/Z3Prover/bin/tree/master/nightly

alias
  • 28,120
  • 2
  • 23
  • 40