forked from JonathanSalwan/Triton
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.travis.yml
128 lines (117 loc) · 7.45 KB
/
.travis.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
language: cpp
os: linux
notifications:
email: false
cache:
- apt
- ccache
jobs:
include:
- os: linux
name: "Linux Trusty with gcc 5.0, Python2.7 and the Pin tracer"
dist: trusty
compiler: gcc
addons:
apt:
sources: ['ubuntu-toolchain-r-test']
packages: ['g++-5', 'ccache', 'libboost1.55-all-dev', 'cmake', 'cmake-data', 'libpython2.7']
env: [ PINTOOL=ON, KERNEL4=ON, PYTHON36=OFF, CXX_COMPILER=g++-5, C_COMPILER=gcc-5, Z3_PKG=z3-4.6.0-x64-ubuntu-14.04, PYTHON_VERSION=2.7, PYTHON_BINARY=/usr/bin/python2.7 ]
- os: linux
name: "Linux Trusty with gcc 5.0 and Python3.6"
dist: trusty
compiler: gcc
addons:
apt:
sources: ['ubuntu-toolchain-r-test', 'deadsnakes']
packages: ['g++-5', 'ccache', 'libboost1.55-all-dev', 'cmake', 'cmake-data', 'python3.6-dev']
env: [ CXX_COMPILER=g++-5, C_COMPILER=gcc-5, Z3_PKG=z3-4.6.0-x64-ubuntu-14.04, PYTHON36=ON, PYTHON_VERSION=3.6, PYTHON_INCLUDE_DIR=/usr/include/python3.6m, PYTHON_LIBRARY=/usr/lib/libpython3.6m.so, PYTHON_BINARY=/usr/bin/python3.6 ]
- os: linux
name: "Linux Trusty with gcc 5.0, Python3.6 and GCOV"
dist: trusty
compiler: gcc
addons:
apt:
sources: ['ubuntu-toolchain-r-test', 'deadsnakes']
packages: ['g++-5', 'ccache', 'libboost1.55-all-dev', 'cmake', 'cmake-data', 'python3.6-dev']
env: [ GCOV=ON, CXX_COMPILER=g++-5, C_COMPILER=gcc-5, Z3_PKG=z3-4.6.0-x64-ubuntu-14.04, PYTHON36=ON, PYTHON_VERSION=3.6, PYTHON_INCLUDE_DIR=/usr/include/python3.6m, PYTHON_LIBRARY=/usr/lib/libpython3.6m.so, PYTHON_BINARY=/usr/bin/python3.6 ]
- os: linux
name: "Linux Trusty with clang 5.0 and Python3.6"
dist: trusty
compiler: clang
addons:
apt:
sources: ['ubuntu-toolchain-r-test', 'llvm-toolchain-trusty-5.0', 'deadsnakes']
packages: ['clang-5.0', 'ccache', 'libboost1.55-all-dev', 'cmake', 'cmake-data', 'python3.6-dev']
env: [ CXX_COMPILER=clang++-5.0, C_COMPILER=clang-5.0, Z3_PKG=z3-4.6.0-x64-ubuntu-14.04, PYTHON36=ON, PYTHON_VERSION=3.6, PYTHON_INCLUDE_DIR=/usr/include/python3.6m, PYTHON_LIBRARY=/usr/lib/libpython3.6m.so, PYTHON_BINARY=/usr/bin/python3.6 ]
- os: osx
name: "OSX with xcode 10 and Python2.7"
osx_image: xcode10
compiler: clang
env: [ CXX_COMPILER=clang++, C_COMPILER=clang, Z3_PKG=z3-4.6.0-x64-osx-10.11.6, PYTHON36=OFF, PYTHON_VERSION=2.7, PYTHON_BINARY=/usr/local/bin/python2 ]
before_install:
- if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then sudo apt-get install python-setuptools; fi
- export CC="$C_COMPILER"
- export CXX="$CXX_COMPILER"
# Install pip
- wget --no-check-certificate https://bootstrap.pypa.io/get-pip.py
- sudo ${PYTHON_BINARY} ./get-pip.py
# Install z3
- wget https://github.com/Z3Prover/z3/releases/download/z3-4.6.0/${Z3_PKG}.zip
- unzip ${Z3_PKG}.zip
- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then cp ${Z3_PKG}/bin/libz3.dylib /usr/local/lib/; fi
# Back to /home/travis/build/JonathanSalwan
- cd ..
# Install gcov
- if [[ "$GCOV" == "ON" ]]; then sudo ln -sf /usr/bin/gcov-5 /usr/bin/gcov; fi
- if [[ "$GCOV" == "ON" ]]; then wget http://ftp.de.debian.org/debian/pool/main/l/lcov/lcov_1.13.orig.tar.gz; fi
- if [[ "$GCOV" == "ON" ]]; then tar xf lcov_1.13.orig.tar.gz; fi
- if [[ "$GCOV" == "ON" ]]; then sudo make -C lcov-1.13/ install; fi
# Install capstone
- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then export DYLD_LIBRARY_PATH=/usr/local/opt/capstone/lib/:$DYLD_LIBRARY_PATH; fi
- wget https://github.com/aquynh/capstone/archive/4.0.1.tar.gz
- tar -xf ./4.0.1.tar.gz
- cd ./capstone-4.0.1
- bash ./make.sh
- sudo make install
- cd ../
# Install unicorn. Only test AArch64 with Unicorn on Linux.
- if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then git clone https://github.com/unicorn-engine/unicorn; fi
- if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then cd ./unicorn; fi
- if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then git checkout ec4c6365c3c91703b3725540100023f6a03db742; fi # 1.0.2-rc2
- if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then UNICORN_ARCHS="x86 arm aarch64" ./make.sh; fi # we use unicorn to only test some semantics
- if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then sudo make install; fi
- if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then cd bindings/python; fi
- if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then sudo ${PYTHON_BINARY} ./setup.py install; fi
- if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then cd ../../../; fi
# Install LIEF
- if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then sudo ${PYTHON_BINARY} -m pip install https://github.com/lief-project/LIEF/releases/download/0.7.0/linux_lief-0.7.0_py${PYTHON_VERSION}.tar.gz; fi
- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then sudo ${PYTHON_BINARY} -m pip install https://github.com/lief-project/LIEF/releases/download/0.7.0/osx_lief-0.7.0_py${PYTHON_VERSION}.tar.gz; fi
# Download pin
- if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then wget http://software.intel.com/sites/landingpage/pintool/downloads/pin-2.14-71313-gcc.4.4.7-linux.tar.gz; fi
- if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then tar -xf pin-2.14-71313-gcc.4.4.7-linux.tar.gz; fi
- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then wget http://software.intel.com/sites/landingpage/pintool/downloads/pin-2.14-71313-clang.4.2-mac.tar.gz; fi
- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then tar -xf pin-2.14-71313-clang.4.2-mac.tar.gz; fi
# Move Triton into pin
- if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then mv ./Triton ./pin-2.14-71313-gcc.4.4.7-linux/source/tools/; fi
- if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then cd ./pin-2.14-71313-gcc.4.4.7-linux/source/tools/Triton; fi
- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then mv ./Triton ./pin-2.14-71313-clang.4.2-mac/source/tools/; fi
- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then cd ./pin-2.14-71313-clang.4.2-mac/source/tools/Triton; fi
install:
# Prepare build
- mkdir build
- cd build
script:
# Needs for unittests
- if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then sudo sh -c "echo 0 > /proc/sys/kernel/yama/ptrace_scope"; fi
# Install
- if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then cmake -DZ3_INCLUDE_DIRS=$PWD/../${Z3_PKG}/include -DZ3_LIBRARIES=$PWD/../${Z3_PKG}/bin/libz3.so -DCMAKE_C_COMPILER=$C_COMPILER -DCMAKE_CXX_COMPILER=$CXX_COMPILER -DGCOV=${GCOV:OFF} -DPYTHON36=${PYTHON36:OFF} -DPINTOOL=${PINTOOL:OFF} -DKERNEL4=${KERNEL4:OFF} ..; fi
- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then cmake -DZ3_INCLUDE_DIRS=$PWD/../${Z3_PKG}/include -DZ3_LIBRARIES=$PWD/../${Z3_PKG}/bin/libz3.dylib -DPYTHON36=${PYTHON36:OFF} $(echo 'from os.path import abspath, join; from distutils.sysconfig import get_python_inc, get_python_lib; print "-DPYTHON_INCLUDE_DIR=%s -DPYTHON_LIBRARY=%s" % (get_python_inc(), abspath(join(get_python_lib(), "../../libpython2.7.dylib")))' | ${PYTHON_BINARY}) ..; fi
- make -j2
# Unittests
- travis_wait 60 make check
# Check installation succeed
- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then mkdir -p /Users/travis/Library/Python/2.7/lib/python/site-packages; fi
- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then echo 'import site; site.addsitedir("/usr/local/lib/python2.7/site-packages")' >> /Users/travis/Library/Python/2.7/lib/python/site-packages/homebrew.pth; fi
- sudo make install
after_success:
- if [[ "$GCOV" == "ON" ]]; then bash <(curl -s https://codecov.io/bash) || echo "Codecov did not collect coverage reports"; fi