Rename CClaimTrieCache to CClaimTrieUpdateBuffer #156

Closed
kaykurokawa wants to merge 276 commits from cclaimtriecache_change into master
Showing only changes of commit 3495c9a5b4 - Show all commits

View file

@ -30,6 +30,7 @@ CLEAN=false
BUILD_DEPENDENCIES=true BUILD_DEPENDENCIES=true
BUILD_LBRYCRD=true BUILD_LBRYCRD=true
TIMEOUT=false TIMEOUT=false
THREE_MB=3145728
while getopts :crldoth:w:d: FLAG; do while getopts :crldoth:w:d: FLAG; do
case $FLAG in case $FLAG in
@ -151,14 +152,19 @@ function wait_and_echo() {
# and wait until it completed # and wait until it completed
function background() { function background() {
$1 >> "$2" 2>&1 & $1 >> "$2" 2>&1 &
wait_and_echo $! "$3" BACKGROUND_PID=$!
wait_and_echo $BACKGROUND_PID "$3"
} }
function cleanup() { function cleanup() {
rv=$? rv=$?
# cat the log file if it exists # cat the log file if it exists
if [ -f "$2" ]; then if [ -f "$2" ]; then
cat "$2" echo
echo "Output of log file $2"
echo
tail -c $THREE_MB "$1"
echo
fi fi
# delete the build directory # delete the build directory
rm -rf "$1" rm -rf "$1"
@ -166,6 +172,22 @@ function cleanup() {
exit $rv exit $rv
} }
function cat_and_exit() {
rv=$?
# cat the log file if it exists
if [ -f "$1" ]; then
echo
echo "Output of log file $1"
echo
# log size is limited to 4MB on travis
# so hopefully the last 3MB is enough
# to debug whatever went wrong
tail -c $THREE_MB "$1"
echo
fi
exit $rv
}
function brew_if_not_installed() { function brew_if_not_installed() {
if ! brew ls | grep $1 --quiet; then if ! brew ls | grep $1 --quiet; then
brew install $1 brew install $1
@ -298,20 +320,19 @@ function build_lbrycrd() {
else else
cd "${SOURCE_DIR}" cd "${SOURCE_DIR}"
fi fi
./autogen.sh ./autogen.sh > "${LBRYCRD_LOG}" 2>&1
LDFLAGS="-L${OPENSSL_PREFIX}/lib/ -L${BDB_PREFIX}/lib/ -L${LIBEVENT_PREFIX}/lib/ -static-libstdc++" LDFLAGS="-L${OPENSSL_PREFIX}/lib/ -L${BDB_PREFIX}/lib/ -L${LIBEVENT_PREFIX}/lib/ -static-libstdc++"
CPPFLAGS="-I${OPENSSL_PREFIX}/include -I${BDB_PREFIX}/include -I${LIBEVENT_PREFIX}/include/" CPPFLAGS="-I${OPENSSL_PREFIX}/include -I${BDB_PREFIX}/include -I${LIBEVENT_PREFIX}/include/"
if [ "${OS_NAME}" = "osx" ]; then if [ "${OS_NAME}" = "osx" ]; then
./configure --without-gui --enable-cxx --enable-static --disable-shared --with-pic \ OPTIONS="--enable-cxx --enable-static --disable-shared --with-pic"
--with-boost="${BOOST_PREFIX}" \
LDFLAGS="${LDFLAGS}" \
CPPFLAGS="${CPPFLAGS}"
else else
./configure --without-gui --with-boost="${BOOST_PREFIX}" \ OPTIONS=""
LDFLAGS="${LDFLAGS}" \
CPPFLAGS="${CPPFLAGS}"
fi fi
make ./configure --without-gui ${OPTIONS} \
--with-boost="${BOOST_PREFIX}" \
LDFLAGS="${LDFLAGS}" \
CPPFLAGS="${CPPFLAGS}" >> "${LBRYCRD_LOG}" 2>&1
background make "${LBRYCRD_LOG}" "Waiting for lbrycrd to finish building"
# tests don't work on OSX. Should definitely figure out why # tests don't work on OSX. Should definitely figure out why
# that is but, for now, not letting that stop the rest # that is but, for now, not letting that stop the rest
# of the build # of the build
@ -344,5 +365,7 @@ set -u
if [ "${BUILD_LBRYCRD}" = true ]; then if [ "${BUILD_LBRYCRD}" = true ]; then
LBRYCRD_LOG="${LOG_DIR}/lbrycrd_build.log" LBRYCRD_LOG="${LOG_DIR}/lbrycrd_build.log"
echo "Building lbrycrd. tail -f ${LBRYCRD_LOG} to see the details and monitor progress" echo "Building lbrycrd. tail -f ${LBRYCRD_LOG} to see the details and monitor progress"
background build_lbrycrd "${LBRYCRD_LOG}" "Waiting for lbrycrd to finish building" trap 'cat_and_exit "${LBRYCRD_LOG}"' INT TERM EXIT
build_lbrycrd
trap - INT TERM EXIT
fi fi