Prerelease travis release (#13189)

* Add additional tests for release/prereleases
* Test different plugins configurations
* Add some libraries to docker image
* Disable SYS_CAPSTONE for now because there is only 3.0.5
* Fix html magic file to respect libmagic's format too

< can be used with string so it should be escaped if we want to match
the exact string "<html>"

* Use plugin License when printing rasm2 plugins in JSON format
* Build with system capstone, but do not run tests because they would fail
* Fix tiny plugins file to use xtr_fatmach0 instead of just fatmach0
* Use clang to compile with ASAN
* Use b_lundef=false
* Just test if different plugins configuration build, no r2r
* Use sys openssl as well
This commit is contained in:
Riccardo Schirone 2019-02-28 16:58:09 +01:00 committed by GitHub
parent 612a3ecf3e
commit afae8b6e34
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
7 changed files with 73 additions and 27 deletions

View File

@ -16,25 +16,49 @@ os: osx
matrix:
fast_finish: true
include:
# Linux with GCC
- os: linux
env: COMPILER_NAME=gcc CXX=g++ CC=gcc
# Linux with clang
- os: linux
env: COMPILER_NAME=clang CXX=clang++ CC=clang
# Linux with meson and coverage
- os: linux
env: COMPILER_NAME=gcc CXX=g++ CC=gcc INSTALL_SYSTEM=meson COVERAGE=1
- if: head_branch =~ ^fedora-* OR tag =~ ^release-* OR tag =~ ^fedora-*
os: linux
env: COMPILER_NAME=gcc CXX=g++ CC=gcc INSTALL_SYSTEM=meson R2_SYS_CAPSTONE=true R2_SYS_MAGIC=true R2_SYS_ZIP=true R2_SYS_LZ4=true R2_SYS_ZLIB=true
- if: head_branch =~ ^asan-* OR tag =~ ^release-* OR type = push
os: linux
env: COMPILER_NAME=clang CXX=clang++ CC=clang CFLAGS="-O0 -ggdb -fsanitize=address -fno-omit-frame-pointer -DR2_ASSERT_STDOUT=1" LDFLAGS="-O0 -ggdb -fsanitize=address -fno-omit-frame-pointer" ASAN_OPTIONS=detect_odr_violation=0 LSAN_OPTIONS=detect_leaks=0
# OS X with clang
- os: osx
env: COMPILER_NAME=clang CXX=clang++ CC=clang
# ASAN as a best effort on every push
- if: not head_branch =~ ^release-* AND not head_branch =~ ^prerelease-* AND (head_branch =~ ^asan-* OR type = push)
os: linux
env: COMPILER_NAME=clang CXX=clang++ CC=clang CFLAGS="-DR2_ASSERT_STDOUT=1" ASAN=1 ASAN_OPTIONS=detect_odr_violation=0 LSAN_OPTIONS=detect_leaks=0
# release-only: meson build with system libraries
- if: head_branch =~ ^release-* OR head_branch =~ ^prerelease-*
os: linux
env: COMPILER_NAME=gcc CXX=g++ CC=gcc INSTALL_SYSTEM=meson R2_SYS_MAGIC=true R2_SYS_ZIP=true R2_SYS_LZ4=true R2_SYS_ZLIB=true R2_SYS_OPENSSL=true
# release-only: meson build with ASAN and R2_ASSERT_STDOUT
- if: head_branch =~ ^release-* OR head_branch =~ ^prerelease-*
os: linux
env: COMPILER_NAME=clang CXX=clang++ CC=clang CFLAGS="-DR2_ASSERT_STDOUT=1" ASAN=1 ASAN_OPTIONS=detect_odr_violation=0 LSAN_OPTIONS=detect_leaks=0 RELEASE=1
# release-only: nogpl plugins file, just test if it builds
- if: head_branch =~ ^release-* OR head_branch =~ ^prerelease-*
os: linux
env: COMPILER_NAME=gcc CXX=g++ CC=gcc R2_PLUGINS_FILE=nogpl R2_TESTS_DISABLE=1
# release-only: static plugins file, just test if it builds
- if: head_branch =~ ^release-* OR head_branch =~ ^prerelease-*
os: linux
env: COMPILER_NAME=gcc CXX=g++ CC=gcc R2_PLUGINS_FILE=static R2_TESTS_DISABLE=1
# release-only: tiny plugins file, just test if it builds
- if: head_branch =~ ^release-* OR head_branch =~ ^prerelease-*
os: linux
env: COMPILER_NAME=gcc CXX=g++ CC=gcc R2_PLUGINS_FILE=tiny R2_TESTS_DISABLE=1
# release-only: system capstone (capstone3), just test if it builds
- if: head_branch =~ ^release-* OR head_branch =~ ^prerelease-*
os: linux
env: COMPILER_NAME=gcc CXX=g++ CC=gcc INSTALL_SYSTEM=meson R2_SYS_CAPSTONE=true R2_TESTS_DISABLE=1
allow_failures:
- os: linux
env: COMPILER_NAME=gcc CXX=g++ CC=gcc INSTALL_SYSTEM=meson R2_SYS_CAPSTONE=true R2_SYS_MAGIC=true R2_SYS_ZIP=true R2_SYS_LZ4=true R2_SYS_ZLIB=true
- os: linux
env: COMPILER_NAME=clang CXX=clang++ CC=clang CFLAGS="-O0 -ggdb -fsanitize=address -fno-omit-frame-pointer -DR2_ASSERT_STDOUT=1" LDFLAGS="-O0 -ggdb -fsanitize=address -fno-omit-frame-pointer" ASAN_OPTIONS=detect_odr_violation=0 LSAN_OPTIONS=detect_leaks=0
env: COMPILER_NAME=clang CXX=clang++ CC=clang CFLAGS="-DR2_ASSERT_STDOUT=1" ASAN=1 ASAN_OPTIONS=detect_odr_violation=0 LSAN_OPTIONS=detect_leaks=0
cache:
- ccache

View File

@ -18,14 +18,19 @@ RUN apt-get install -y \
jq \
libncurses5 \
libcapstone3 \
libcapstone-dev \
libmagic-dev \
libzip4 \
libzip-dev \
liblz4-1 \
liblz4-dev \
gnupg2 \
python-pip \
python3-pip \
pkg-config \
liblzma5 \
npm
npm \
zlib1g-dev
RUN pip3 install meson
RUN pip3 install ninja

View File

@ -229,7 +229,6 @@ static void rasm2_list(RAsmState *as, const char *arch) {
if (as->quiet) {
printf ("%s\n", h->name);
} else if (as->json) {
const char *license = "GPL";
pj_k (pj, h->name);
pj_o (pj);
pj_k (pj, "bits");
@ -237,7 +236,7 @@ static void rasm2_list(RAsmState *as, const char *arch) {
pj_i (pj, 32);
pj_i (pj, 64);
pj_end (pj);
pj_ks (pj, "license", license);
pj_ks (pj, "license", h->license? h->license: "unknown");
pj_ks (pj, "description", h->desc);
pj_ks (pj, "features", feat);
pj_end (pj);

View File

@ -1,2 +1,2 @@
0 string <html> HTML document
0 string <HTML> HTML document
0 string \74html\76 HTML document
0 string \74HTML\76 HTML document

View File

@ -42,7 +42,7 @@ bin.ningba
bin.ninds
bin.nin3ds
bin.xbe
bin_xtr.fatmach0
bin_xtr.xtr_fatmach0
bin_xtr.xtr_dyldcache
bp.arm
bp.bf

View File

@ -25,5 +25,6 @@ print_var TRAVIS "${TRAVIS}"
print_var INSTALL_SYSTEM "${INSTALL_SYSTEM}"
print_var MESON_OPTIONS "${MESON_OPTIONS}"
print_var COVERAGE "${COVERAGE}"
print_var ASAN "${ASAN}"
print_var SHIPPABLE "${SHIPPABLE}"
print_var CI "${CI}"

View File

@ -25,9 +25,16 @@ if [ "${INSTALL_SYSTEM}" == "meson" ] ; then
if [ "${R2_SYS_LZ4}" != "" ] ; then
OPTS="${OPTS} -D use_sys_lz4=${R2_SYS_LZ4}"
fi
if [ "${R2_SYS_OPENSSL}" != "" ] ; then
OPTS="${OPTS} -D use_sys_openssl=${R2_SYS_OPENSSL}"
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"
fi
meson --prefix=${TRAVIS_BUILD_DIR}/install ${OPTS} build || exit 1
pushd build
@ -37,11 +44,20 @@ if [ "${INSTALL_SYSTEM}" == "meson" ] ; then
export PKG_CONFIG_PATH=$(pwd)/build/meson-private:${PKG_CONFIG_PATH}
else
echo "Installing with acr + make"
if [ "${R2_PLUGINS_FILE}" != "" ] ; then
cp "plugins.${R2_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
./configure --prefix=${TRAVIS_BUILD_DIR}/install > /dev/null || exit 1
make -s -j2 > /dev/null || exit 1
make install > /dev/null || exit 1
export PKG_CONFIG_PATH=${TRAVIS_BUILD_DIR}/pkgcfg:${PKG_CONFIG_PATH}
fi
if [ "${R2_TESTS_DISABLE}" != "1" ] ; then
export NOOK=1
export NOREPORT=1
cd radare2-regressions
@ -56,3 +72,4 @@ if [ "${COVERAGE}" == "1" ] ; then
chmod +x ./codecov.sh
./codecov.sh -K -v 2>/dev/null
fi
fi