Skip to content

Commit afae8b6

Browse files
authored
Prerelease travis release (radareorg#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
1 parent 612a3ec commit afae8b6

File tree

7 files changed

+73
-27
lines changed

7 files changed

+73
-27
lines changed

.travis.yml

+33-9
Original file line numberDiff line numberDiff line change
@@ -16,25 +16,49 @@ os: osx
1616
matrix:
1717
fast_finish: true
1818
include:
19+
# Linux with GCC
1920
- os: linux
2021
env: COMPILER_NAME=gcc CXX=g++ CC=gcc
22+
# Linux with clang
2123
- os: linux
2224
env: COMPILER_NAME=clang CXX=clang++ CC=clang
25+
# Linux with meson and coverage
2326
- os: linux
2427
env: COMPILER_NAME=gcc CXX=g++ CC=gcc INSTALL_SYSTEM=meson COVERAGE=1
25-
- if: head_branch =~ ^fedora-* OR tag =~ ^release-* OR tag =~ ^fedora-*
26-
os: linux
27-
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
28-
- if: head_branch =~ ^asan-* OR tag =~ ^release-* OR type = push
29-
os: linux
30-
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
28+
# OS X with clang
3129
- os: osx
3230
env: COMPILER_NAME=clang CXX=clang++ CC=clang
31+
# ASAN as a best effort on every push
32+
- if: not head_branch =~ ^release-* AND not head_branch =~ ^prerelease-* AND (head_branch =~ ^asan-* OR type = push)
33+
os: linux
34+
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
35+
# release-only: meson build with system libraries
36+
- if: head_branch =~ ^release-* OR head_branch =~ ^prerelease-*
37+
os: linux
38+
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
39+
# release-only: meson build with ASAN and R2_ASSERT_STDOUT
40+
- if: head_branch =~ ^release-* OR head_branch =~ ^prerelease-*
41+
os: linux
42+
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
43+
# release-only: nogpl plugins file, just test if it builds
44+
- if: head_branch =~ ^release-* OR head_branch =~ ^prerelease-*
45+
os: linux
46+
env: COMPILER_NAME=gcc CXX=g++ CC=gcc R2_PLUGINS_FILE=nogpl R2_TESTS_DISABLE=1
47+
# release-only: static plugins file, just test if it builds
48+
- if: head_branch =~ ^release-* OR head_branch =~ ^prerelease-*
49+
os: linux
50+
env: COMPILER_NAME=gcc CXX=g++ CC=gcc R2_PLUGINS_FILE=static R2_TESTS_DISABLE=1
51+
# release-only: tiny plugins file, just test if it builds
52+
- if: head_branch =~ ^release-* OR head_branch =~ ^prerelease-*
53+
os: linux
54+
env: COMPILER_NAME=gcc CXX=g++ CC=gcc R2_PLUGINS_FILE=tiny R2_TESTS_DISABLE=1
55+
# release-only: system capstone (capstone3), just test if it builds
56+
- if: head_branch =~ ^release-* OR head_branch =~ ^prerelease-*
57+
os: linux
58+
env: COMPILER_NAME=gcc CXX=g++ CC=gcc INSTALL_SYSTEM=meson R2_SYS_CAPSTONE=true R2_TESTS_DISABLE=1
3359
allow_failures:
3460
- os: linux
35-
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
36-
- os: linux
37-
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
61+
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
3862
cache:
3963
- ccache
4064

Dockerfile.travis

+6-1
Original file line numberDiff line numberDiff line change
@@ -18,14 +18,19 @@ RUN apt-get install -y \
1818
jq \
1919
libncurses5 \
2020
libcapstone3 \
21+
libcapstone-dev \
22+
libmagic-dev \
2123
libzip4 \
24+
libzip-dev \
2225
liblz4-1 \
26+
liblz4-dev \
2327
gnupg2 \
2428
python-pip \
2529
python3-pip \
2630
pkg-config \
2731
liblzma5 \
28-
npm
32+
npm \
33+
zlib1g-dev
2934

3035
RUN pip3 install meson
3136
RUN pip3 install ninja

binr/rasm2/rasm2.c

+1-2
Original file line numberDiff line numberDiff line change
@@ -229,15 +229,14 @@ static void rasm2_list(RAsmState *as, const char *arch) {
229229
if (as->quiet) {
230230
printf ("%s\n", h->name);
231231
} else if (as->json) {
232-
const char *license = "GPL";
233232
pj_k (pj, h->name);
234233
pj_o (pj);
235234
pj_k (pj, "bits");
236235
pj_a (pj);
237236
pj_i (pj, 32);
238237
pj_i (pj, 64);
239238
pj_end (pj);
240-
pj_ks (pj, "license", license);
239+
pj_ks (pj, "license", h->license? h->license: "unknown");
241240
pj_ks (pj, "description", h->desc);
242241
pj_ks (pj, "features", feat);
243242
pj_end (pj);

libr/magic/d/default/html

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
0 string <html> HTML document
2-
0 string <HTML> HTML document
1+
0 string \74html\76 HTML document
2+
0 string \74HTML\76 HTML document

plugins.tiny.cfg

+1-1
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ bin.ningba
4242
bin.ninds
4343
bin.nin3ds
4444
bin.xbe
45-
bin_xtr.fatmach0
45+
bin_xtr.xtr_fatmach0
4646
bin_xtr.xtr_dyldcache
4747
bp.arm
4848
bp.bf

travis-extract-var.sh

+1
Original file line numberDiff line numberDiff line change
@@ -25,5 +25,6 @@ print_var TRAVIS "${TRAVIS}"
2525
print_var INSTALL_SYSTEM "${INSTALL_SYSTEM}"
2626
print_var MESON_OPTIONS "${MESON_OPTIONS}"
2727
print_var COVERAGE "${COVERAGE}"
28+
print_var ASAN "${ASAN}"
2829
print_var SHIPPABLE "${SHIPPABLE}"
2930
print_var CI "${CI}"

travis-script

+29-12
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,16 @@ if [ "${INSTALL_SYSTEM}" == "meson" ] ; then
2525
if [ "${R2_SYS_LZ4}" != "" ] ; then
2626
OPTS="${OPTS} -D use_sys_lz4=${R2_SYS_LZ4}"
2727
fi
28+
if [ "${R2_SYS_OPENSSL}" != "" ] ; then
29+
OPTS="${OPTS} -D use_sys_openssl=${R2_SYS_OPENSSL}"
30+
fi
2831
if [ "${COVERAGE}" == "1" ] ; then
2932
OPTS="${OPTS} -Db_coverage=true"
3033
fi
34+
if [ "${ASAN}" == "1" ] ; then
35+
# -Db_lundef=false required for issue with clang+meson (see https://github.com/mesonbuild/meson/issues/764)
36+
OPTS="${OPTS} -Db_sanitize=address -Db_lundef=false"
37+
fi
3138

3239
meson --prefix=${TRAVIS_BUILD_DIR}/install ${OPTS} build || exit 1
3340
pushd build
@@ -37,22 +44,32 @@ if [ "${INSTALL_SYSTEM}" == "meson" ] ; then
3744
export PKG_CONFIG_PATH=$(pwd)/build/meson-private:${PKG_CONFIG_PATH}
3845
else
3946
echo "Installing with acr + make"
47+
if [ "${R2_PLUGINS_FILE}" != "" ] ; then
48+
cp "plugins.${R2_PLUGINS_FILE}.cfg" plugins.cfg
49+
fi
50+
if [ "${ASAN}" == "1" ] ; then
51+
export CFLAGS="${CFLAGS} -O0 -ggdb -fsanitize=address -fno-omit-frame-pointer"
52+
export LDFLAGS="${LDFLAGS} -O0 -ggdb -fsanitize=address -fno-omit-frame-pointer"
53+
fi
4054
./configure --prefix=${TRAVIS_BUILD_DIR}/install > /dev/null || exit 1
4155
make -s -j2 > /dev/null || exit 1
4256
make install > /dev/null || exit 1
4357
export PKG_CONFIG_PATH=${TRAVIS_BUILD_DIR}/pkgcfg:${PKG_CONFIG_PATH}
4458
fi
45-
export NOOK=1
46-
export NOREPORT=1
47-
cd radare2-regressions
48-
git remote -v
49-
git branch
50-
git rev-parse HEAD
51-
VERBOSE=1 make -k all || exit 1
5259

53-
if [ "${COVERAGE}" == "1" ] ; then
54-
cd ../build
55-
curl -s https://codecov.io/bash > ./codecov.sh
56-
chmod +x ./codecov.sh
57-
./codecov.sh -K -v 2>/dev/null
60+
if [ "${R2_TESTS_DISABLE}" != "1" ] ; then
61+
export NOOK=1
62+
export NOREPORT=1
63+
cd radare2-regressions
64+
git remote -v
65+
git branch
66+
git rev-parse HEAD
67+
VERBOSE=1 make -k all || exit 1
68+
69+
if [ "${COVERAGE}" == "1" ] ; then
70+
cd ../build
71+
curl -s https://codecov.io/bash > ./codecov.sh
72+
chmod +x ./codecov.sh
73+
./codecov.sh -K -v 2>/dev/null
74+
fi
5875
fi

0 commit comments

Comments
 (0)