Use meson in Travis CI (#220)
This commit is contained in:
parent
745a9ed9b0
commit
dfbb7a71f5
2 changed files with 41 additions and 93 deletions
15
.travis.yml
15
.travis.yml
|
|
@ -7,6 +7,8 @@ branches:
|
|||
- dev
|
||||
- /^release-.*$/
|
||||
- /^prerelease-.*$/
|
||||
- /^travis-.*$/
|
||||
- /^import-.*$/
|
||||
|
||||
services:
|
||||
- docker
|
||||
|
|
@ -14,10 +16,6 @@ services:
|
|||
jobs:
|
||||
fast_finish: true
|
||||
include:
|
||||
# emscripten
|
||||
# os: linux
|
||||
# - name: WASM
|
||||
# env: EMSCRIPTEN=1
|
||||
# Linux with GCC on PowerPC
|
||||
- os: linux
|
||||
name: PPC64
|
||||
|
|
@ -54,10 +52,6 @@ jobs:
|
|||
- binutils-powerpc64le-linux-gnu
|
||||
|
||||
allow_failures:
|
||||
# Emscripten
|
||||
#- os: linux
|
||||
# name: WASM
|
||||
# env: EMSCRIPTEN=1
|
||||
# Linux with GCC on PowerPC
|
||||
- os: linux
|
||||
arch: ppc64le
|
||||
|
|
@ -76,8 +70,6 @@ jobs:
|
|||
apt:
|
||||
packages:
|
||||
- binutils-mingw-w64-x86-64
|
||||
- os: linux
|
||||
env: COMPILER_NAME=clang CXX=clang++ CC=clang ASAN=1 ASAN_OPTIONS=detect_odr_violation=0 LSAN_OPTIONS=detect_leaks=0 CFLAGS="-DRZ_ASSERT_STDOUT=1"
|
||||
|
||||
cache:
|
||||
- ccache
|
||||
|
|
@ -85,5 +77,6 @@ cache:
|
|||
script:
|
||||
- export PR_NAME=$(echo $TRAVIS_PULL_REQUEST_SLUG | cut -d'/' -f1)
|
||||
- |
|
||||
pip3 install 'git+https://github.com/rizinorg/rz-pipe#egg=rzpipe&subdirectory=python'
|
||||
pip3 install -U --user meson ninja
|
||||
pip3 install --user 'git+https://github.com/rizinorg/rz-pipe#egg=rzpipe&subdirectory=python'
|
||||
$SHELL travis-script
|
||||
|
|
|
|||
113
travis-script
113
travis-script
|
|
@ -4,90 +4,45 @@ set -x
|
|||
export PATH=${TRAVIS_BUILD_DIR}/install/bin:${PATH}
|
||||
export LD_LIBRARY_PATH=${TRAVIS_BUILD_DIR}/install/lib/$(uname -m)-linux-gnu:${TRAVIS_BUILD_DIR}/install/lib:${TRAVIS_BUILD_DIR}/install/lib64:${LD_LIBRARY_PATH}
|
||||
|
||||
if [ "${EMSCRIPTEN}" = "1" ] ; then
|
||||
git clone https://github.com/emscripten-core/emsdk.git || exit 1
|
||||
cd emsdk || exit 1
|
||||
./emsdk install latest || exit 1
|
||||
./emsdk activate latest || exit 1
|
||||
source ./emsdk_env.sh
|
||||
cd ..
|
||||
sys/emscripten.sh
|
||||
exit $?
|
||||
fi
|
||||
echo "Installing with meson + ninja"
|
||||
|
||||
if [ "${INSTALL_SYSTEM}" == "meson" ] ; then
|
||||
echo "Installing with meson + ninja"
|
||||
|
||||
if [ "`uname`" = Darwin ]; then
|
||||
HOMEBREW_NO_AUTO_UPDATE=1 brew install meson libuv
|
||||
pip3 install --upgrade meson
|
||||
fi
|
||||
|
||||
OPTS="-Duse_webui=true"
|
||||
if [ "${RZ_SYS_CAPSTONE}" != "" ] ; then
|
||||
OPTS="-Duse_webui=true"
|
||||
if [ "${RZ_SYS_CAPSTONE}" != "" ] ; then
|
||||
OPTS="${OPTS} -D use_sys_capstone=${RZ_SYS_CAPSTONE}"
|
||||
fi
|
||||
if [ "${RZ_SYS_MAGIC}" != "" ] ; then
|
||||
OPTS="${OPTS} -D use_sys_magic=${RZ_SYS_MAGIC}"
|
||||
fi
|
||||
if [ "${RZ_SYS_ZLIB}" != "" ] ; then
|
||||
OPTS="${OPTS} -D use_sys_zlib=${RZ_SYS_ZLIB}"
|
||||
fi
|
||||
if [ "${RZ_SYS_ZIP}" != "" ] ; then
|
||||
OPTS="${OPTS} -D use_sys_zip=${RZ_SYS_ZIP}"
|
||||
fi
|
||||
if [ "${RZ_SYS_LZ4}" != "" ] ; then
|
||||
OPTS="${OPTS} -D use_sys_lz4=${RZ_SYS_LZ4}"
|
||||
fi
|
||||
if [ "${RZ_SYS_OPENSSL}" != "" ] ; then
|
||||
OPTS="${OPTS} -D use_sys_openssl=${RZ_SYS_OPENSSL}"
|
||||
fi
|
||||
if [ "${RZ_NEWSHELL}" != "" ] ; then
|
||||
OPTS="${OPTS} -D use_treesitter=${RZ_NEWSHELL}"
|
||||
fi
|
||||
if [ "${COVERAGE}" == "1" ] ; then
|
||||
OPTS="${OPTS} -Db_coverage=true"
|
||||
fi
|
||||
if [ "${ASAN}" == "1" ] ; then
|
||||
# -Db_lundef=false required for issue with clang+meson (see https://github.com/mesonbuild/meson/issues/764)
|
||||
OPTS="${OPTS} -Db_sanitize=address -Db_lundef=false"
|
||||
export CFLAGS="-DASAN=1 ${CFLAGS}"
|
||||
fi
|
||||
|
||||
meson --prefix=${TRAVIS_BUILD_DIR}/install ${OPTS} build || exit 1
|
||||
pushd build
|
||||
ninja || exit 1
|
||||
ninja install || exit 1
|
||||
popd
|
||||
export PKG_CONFIG_PATH=$(pwd)/build/meson-private:${PKG_CONFIG_PATH}
|
||||
else
|
||||
echo "Installing with acr + make"
|
||||
if [ "${RZ_PLUGINS_FILE}" != "" ] ; then
|
||||
cp "plugins.${RZ_PLUGINS_FILE}.cfg" plugins.cfg
|
||||
fi
|
||||
if [ "${ASAN}" == "1" ] ; then
|
||||
export CFLAGS="${CFLAGS} -O0 -ggdb -fsanitize=address -fno-omit-frame-pointer"
|
||||
export LDFLAGS="${LDFLAGS} -O0 -ggdb -fsanitize=address -fno-omit-frame-pointer"
|
||||
fi
|
||||
export PKG_CONFIG_PATH=${TRAVIS_BUILD_DIR}/pkgcfg:${PKG_CONFIG_PATH}
|
||||
./configure --prefix=${TRAVIS_BUILD_DIR}/install > /dev/null || exit 1
|
||||
make -s -j2 > /dev/null || exit 1
|
||||
make install > /dev/null || exit 1
|
||||
fi
|
||||
if [ "${RZ_SYS_MAGIC}" != "" ] ; then
|
||||
OPTS="${OPTS} -D use_sys_magic=${RZ_SYS_MAGIC}"
|
||||
fi
|
||||
if [ "${RZ_SYS_ZLIB}" != "" ] ; then
|
||||
OPTS="${OPTS} -D use_sys_zlib=${RZ_SYS_ZLIB}"
|
||||
fi
|
||||
if [ "${RZ_SYS_ZIP}" != "" ] ; then
|
||||
OPTS="${OPTS} -D use_sys_zip=${RZ_SYS_ZIP}"
|
||||
fi
|
||||
if [ "${RZ_SYS_LZ4}" != "" ] ; then
|
||||
OPTS="${OPTS} -D use_sys_lz4=${RZ_SYS_LZ4}"
|
||||
fi
|
||||
if [ "${RZ_SYS_OPENSSL}" != "" ] ; then
|
||||
OPTS="${OPTS} -D use_sys_openssl=${RZ_SYS_OPENSSL}"
|
||||
fi
|
||||
if [ "${RZ_NEWSHELL}" != "" ] ; then
|
||||
OPTS="${OPTS} -D use_treesitter=${RZ_NEWSHELL}"
|
||||
fi
|
||||
if [ "${COVERAGE}" == "1" ] ; then
|
||||
OPTS="${OPTS} -Db_coverage=true"
|
||||
fi
|
||||
|
||||
meson --prefix=${TRAVIS_BUILD_DIR}/install ${OPTS} build || exit 1
|
||||
ninja -C build || exit 1
|
||||
ninja -C build install || exit 1
|
||||
export PKG_CONFIG_PATH=$(pwd)/build/meson-private:${PKG_CONFIG_PATH}
|
||||
|
||||
if [ "${RZ_TESTS_DISABLE}" != "1" ] ; then
|
||||
export NOREPORT=1
|
||||
git clone https://github.com/rizinorg/rizin-testbins test/bins
|
||||
# Unit tests
|
||||
VERBOSE=1 RZ_TEST_ARGS=-t1920 ninja -C build test || exit 1
|
||||
# Integration tests
|
||||
cd test
|
||||
|
||||
git clone http://github.com/rizinorg/rz-pipe
|
||||
pip3 install --user "file://$(pwd)/rz-pipe#egg=rzpipe&subdirectory=python"
|
||||
|
||||
VERBOSE=1 RZ_TEST_ARGS=-t1920 make -k all || exit 1
|
||||
|
||||
if [ "${COVERAGE}" == "1" ] ; then
|
||||
cd ../build
|
||||
curl -s https://codecov.io/bash > ./codecov.sh
|
||||
chmod +x ./codecov.sh
|
||||
./codecov.sh -K -v 2>/dev/null
|
||||
fi
|
||||
rz-test -L -o results.json
|
||||
fi
|
||||
|
|
|
|||
Loading…
Reference in a new issue