2018-06-22 11:18:30 +00:00
|
|
|
#!/bin/bash
|
2018-07-06 21:35:55 +00:00
|
|
|
set -x
|
|
|
|
|
2018-06-23 12:48:33 +00:00
|
|
|
export PATH=${TRAVIS_BUILD_DIR}/install/bin:${PATH}
|
2018-09-12 10:24:19 +00:00
|
|
|
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}
|
2018-10-06 02:32:03 +00:00
|
|
|
git clone -q --depth 1 --branch "${R2R_BRANCH}" "${R2R_REPO}" || true # If cloning fails that's not an error: we simply fallback to master.
|
|
|
|
ls radare2-regressions >/dev/null 2>&1 || git clone -q --depth 1 --branch "${R2R_DEFAULT_BRANCH}" "${R2R_DEFAULT_REPO}"
|
2018-07-09 14:58:38 +00:00
|
|
|
|
|
|
|
if [ "${INSTALL_SYSTEM}" == "meson" ] ; then
|
|
|
|
echo "Installing with meson + ninja"
|
2018-07-17 21:01:40 +00:00
|
|
|
|
|
|
|
OPTS=""
|
|
|
|
if [ "${R2_SYS_CAPSTONE}" != "" ] ; then
|
2018-09-03 16:05:29 +00:00
|
|
|
OPTS="${OPTS} -D use_sys_capstone=${R2_SYS_CAPSTONE}"
|
2018-07-17 21:01:40 +00:00
|
|
|
fi
|
|
|
|
if [ "${R2_SYS_MAGIC}" != "" ] ; then
|
2018-09-03 16:05:29 +00:00
|
|
|
OPTS="${OPTS} -D use_sys_magic=${R2_SYS_MAGIC}"
|
2018-07-17 21:01:40 +00:00
|
|
|
fi
|
|
|
|
if [ "${R2_SYS_ZLIB}" != "" ] ; then
|
2018-09-03 16:05:29 +00:00
|
|
|
OPTS="${OPTS} -D use_sys_zlib=${R2_SYS_ZLIB}"
|
2018-07-17 21:01:40 +00:00
|
|
|
fi
|
|
|
|
if [ "${R2_SYS_ZIP}" != "" ] ; then
|
2018-09-03 16:05:29 +00:00
|
|
|
OPTS="${OPTS} -D use_sys_zip=${R2_SYS_ZIP}"
|
2018-07-17 21:01:40 +00:00
|
|
|
fi
|
|
|
|
if [ "${R2_SYS_LZ4}" != "" ] ; then
|
2018-09-03 16:05:29 +00:00
|
|
|
OPTS="${OPTS} -D use_sys_lz4=${R2_SYS_LZ4}"
|
|
|
|
fi
|
2019-02-28 15:58:09 +00:00
|
|
|
if [ "${R2_SYS_OPENSSL}" != "" ] ; then
|
|
|
|
OPTS="${OPTS} -D use_sys_openssl=${R2_SYS_OPENSSL}"
|
|
|
|
fi
|
2018-09-03 16:05:29 +00:00
|
|
|
if [ "${COVERAGE}" == "1" ] ; then
|
|
|
|
OPTS="${OPTS} -Db_coverage=true"
|
2018-07-17 21:01:40 +00:00
|
|
|
fi
|
2019-02-28 15:58:09 +00:00
|
|
|
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
|
2018-07-17 21:01:40 +00:00
|
|
|
|
2018-09-12 14:24:17 +00:00
|
|
|
meson --prefix=${TRAVIS_BUILD_DIR}/install ${OPTS} build || exit 1
|
2018-07-09 14:58:38 +00:00
|
|
|
pushd build
|
2018-09-12 14:24:17 +00:00
|
|
|
ninja || exit 1
|
|
|
|
ninja install || exit 1
|
2018-07-09 14:58:38 +00:00
|
|
|
popd
|
|
|
|
export PKG_CONFIG_PATH=$(pwd)/build/meson-private:${PKG_CONFIG_PATH}
|
2019-06-08 20:26:19 +00:00
|
|
|
elif [ "${INSTALL_SYSTEM}" == "static" ]; then
|
|
|
|
echo "Compiling static with sys/static.sh"
|
|
|
|
./sys/static.sh || exit 1
|
|
|
|
echo "Compiling Fuzzing Target"
|
|
|
|
export RADARE2_STATIC_BUILD=$(pwd)/r2-static
|
|
|
|
cd radare2-regressions/fuzz/targets
|
|
|
|
git remote -v
|
|
|
|
git branch
|
|
|
|
git rev-parse HEAD
|
|
|
|
# workaround for now
|
|
|
|
export LIB_FUZZING_ENGINE=" "
|
|
|
|
VERBOSE=1 make -j2 || exit 1
|
|
|
|
# This is a test key (change to production environment key later)
|
|
|
|
export FUZZIT_KEY=055d9d3ba41a36fe7e33fee3bf411b2102703c60e16b1756a7222ab529f16dbf8c687a35313f0b1666d8687e891e5c83
|
|
|
|
export ORG_ID=2zv5qI33roZkRm0oO2Mi
|
|
|
|
export TARGET_ID=YVkkS6RPVpKhSixyFWcT
|
|
|
|
wget -O fuzzit https://bin.fuzzit.dev/fuzzit-1.0
|
|
|
|
chmod a+x fuzzit
|
|
|
|
./fuzzit auth $FUZZIT_KEY $ORG_ID
|
|
|
|
echo "Creating fuzzing sanity job on fuzzit.dev:"
|
|
|
|
./fuzzit create job --type sanity --args "-fork=1 -close_fd_mask=3" --revision $TRAVIS_COMMIT --branch $TRAVIS_BRANCH $TARGET_ID ia_fuzz || exit 1
|
2018-07-09 14:58:38 +00:00
|
|
|
else
|
|
|
|
echo "Installing with acr + make"
|
2019-02-28 15:58:09 +00:00
|
|
|
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
|
2018-07-09 14:58:38 +00:00
|
|
|
./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
|
2018-09-03 16:05:29 +00:00
|
|
|
|
2019-02-28 15:58:09 +00:00
|
|
|
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
|
2018-09-03 16:05:29 +00:00
|
|
|
fi
|