diff --git a/.travis.yml b/.travis.yml index fab494d911..db4f05a283 100644 --- a/.travis.yml +++ b/.travis.yml @@ -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 diff --git a/Dockerfile.travis b/Dockerfile.travis index fa1a14027f..240c9e732b 100644 --- a/Dockerfile.travis +++ b/Dockerfile.travis @@ -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 diff --git a/binr/rasm2/rasm2.c b/binr/rasm2/rasm2.c index db9030ff76..6ec53ded5a 100644 --- a/binr/rasm2/rasm2.c +++ b/binr/rasm2/rasm2.c @@ -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); diff --git a/libr/magic/d/default/html b/libr/magic/d/default/html index 9fe940d3b0..4f4419999c 100644 --- a/libr/magic/d/default/html +++ b/libr/magic/d/default/html @@ -1,2 +1,2 @@ -0 string HTML document -0 string HTML document +0 string \74html\76 HTML document +0 string \74HTML\76 HTML document diff --git a/plugins.tiny.cfg b/plugins.tiny.cfg index 8371ea526a..0a6f0d5a60 100644 --- a/plugins.tiny.cfg +++ b/plugins.tiny.cfg @@ -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 diff --git a/travis-extract-var.sh b/travis-extract-var.sh index f55472a276..484cec60ae 100644 --- a/travis-extract-var.sh +++ b/travis-extract-var.sh @@ -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}" diff --git a/travis-script b/travis-script index 4d8f7e8105..5c601b942f 100644 --- a/travis-script +++ b/travis-script @@ -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,22 +44,32 @@ 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 -export NOOK=1 -export NOREPORT=1 -cd radare2-regressions -git remote -v -git branch -git rev-parse HEAD -VERBOSE=1 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 +if [ "${R2_TESTS_DISABLE}" != "1" ] ; then + export NOOK=1 + export NOREPORT=1 + cd radare2-regressions + git remote -v + git branch + git rev-parse HEAD + VERBOSE=1 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 fi