From 968ab7984c682abc3f1d72a748c563a5edeff7f5 Mon Sep 17 00:00:00 2001 From: Matt Witherspoon <32485495+spoonincode@users.noreply.github.com> Date: Thu, 25 Apr 2019 14:01:15 -0400 Subject: [PATCH 1/7] reenable building of mongo c/cxx drivers --- .buildkite/pipeline.yml | 10 +- plugins/mongo_db_plugin/CMakeLists.txt | 42 ++------ scripts/eosio_build.sh | 2 +- scripts/eosio_build_amazon.sh | 144 ++++++++++++------------- scripts/eosio_build_centos.sh | 129 +++++++++++----------- scripts/eosio_build_darwin.sh | 7 +- scripts/eosio_build_ubuntu.sh | 139 ++++++++++++------------ 7 files changed, 224 insertions(+), 249 deletions(-) diff --git a/.buildkite/pipeline.yml b/.buildkite/pipeline.yml index 2a188f66eca..cc62b7e41a0 100644 --- a/.buildkite/pipeline.yml +++ b/.buildkite/pipeline.yml @@ -47,7 +47,7 @@ steps: ln -s "$(pwd)" /data/job cd /data/job echo "+++ Building :hammer:" - ./scripts/eosio_build.sh -y -P + ./scripts/eosio_build.sh -y -P -m echo "--- Compressing build directory :compression:" tar -pczf build.tar.gz build if [[ ! -f build.tar.gz ]]; then echo 'ERROR: No build.tar.gz artifact found!' && exit 1; fi @@ -60,7 +60,7 @@ steps: - command: | # Amazon Linux 2 Build echo "+++ :hammer: Building" - ./scripts/eosio_build.sh -y -P + ./scripts/eosio_build.sh -y -P -m echo "--- :compression: Compressing build directory" tar -pczf build.tar.gz build if [[ ! -f build.tar.gz ]]; then echo 'ERROR: No build.tar.gz artifact found!' && exit 1; fi @@ -83,7 +83,7 @@ steps: - command: | # CentOS 7 Build echo "+++ :hammer: Building" - ./scripts/eosio_build.sh -y -P + ./scripts/eosio_build.sh -y -P -m echo "--- :compression: Compressing build directory" tar -pczf build.tar.gz build if [[ ! -f build.tar.gz ]]; then echo 'ERROR: No build.tar.gz artifact found!' && exit 1; fi @@ -106,7 +106,7 @@ steps: - command: | # Ubuntu 16.04 Build echo "+++ :hammer: Building" - ./scripts/eosio_build.sh -y -P + ./scripts/eosio_build.sh -y -P -m echo "--- :compression: Compressing build directory" tar -pczf build.tar.gz build if [[ ! -f build.tar.gz ]]; then echo 'ERROR: No build.tar.gz artifact found!' && exit 1; fi @@ -129,7 +129,7 @@ steps: - command: | # Ubuntu 18.04 Build echo "+++ :hammer: Building" - ./scripts/eosio_build.sh -y -P + ./scripts/eosio_build.sh -y -P -m echo "--- :compression: Compressing build directory" tar -pczf build.tar.gz build if [[ ! -f build.tar.gz ]]; then echo 'ERROR: No build.tar.gz artifact found!' && exit 1; fi diff --git a/plugins/mongo_db_plugin/CMakeLists.txt b/plugins/mongo_db_plugin/CMakeLists.txt index dc76525f3a2..923e1f11c08 100644 --- a/plugins/mongo_db_plugin/CMakeLists.txt +++ b/plugins/mongo_db_plugin/CMakeLists.txt @@ -4,44 +4,22 @@ if(BUILD_MONGO_DB_PLUGIN) if (libmongoc-1.0_FOUND) - # EOS has no direct dependencies on libmongoc but its shared libraries - # will need to be present at runtime for the C++ libraries we use: - # libbsoncxx & libmongocxx (both from github.com/mongodb/mongo-cxx-driver) - - # The *.cmake package files provided by mongo-cxx-driver don't give us the - # absolute path to the libraries, which is needed whenever they are not - # installed in system-known locations. CMake requires the absolute paths - # in target_link_libraries() since we are builiding an archive and the - # link step for all executables using this archive must include the - # mongo-cxx-driver libraries libmongocxx and libbsoncxx. - find_package(libbsoncxx-static REQUIRED) - message(STATUS "Found bsoncxx headers: ${LIBBSONCXX_STATIC_INCLUDE_DIRS}") + find_library(EOS_LIBBSONCXX "libbsoncxx-static${CMAKE_STATIC_LIBRARY_SUFFIX}" PATHS ${LIBBSONCXX_STATIC_LIBRARY_DIRS}) - # mongo-cxx-driver 3.2 release altered LIBBSONCXX_LIBRARIES semantics. Instead of library names, - # it now hold library paths. - if((LIBBSONCXX_STATIC_VERSION_MAJOR LESS 3) OR ((LIBBSONCXX_STATIC_VERSION_MAJOR EQUAL 3) AND (LIBBSONCXX_STATIC_VERSION_MINOR LESS 2))) - find_library(EOS_LIBBSONCXX ${LIBBSONCXX_STATIC_LIBRARIES} - PATHS ${LIBBSONCXX_STATIC_LIBRARY_DIRS} NO_DEFAULT_PATH) - else() - set(EOS_LIBBSONCXX ${LIBBSONCXX_STATIC_LIBRARIES}) - endif() + find_package(libmongocxx-static REQUIRED) + find_library(EOS_LIBMONGOCXX "libmongocxx-static${CMAKE_STATIC_LIBRARY_SUFFIX}" PATHS ${LIBMONGOCXX_STATIC_LIBRARY_DIRS}) - message(STATUS "Found bsoncxx library: ${EOS_LIBBSONCXX}") + find_package(libmongoc-static-1.0 REQUIRED) + find_library(EOS_LIBMONGOC "libmongoc-static-1.0${CMAKE_STATIC_LIBRARY_SUFFIX}" PATHS ${LIBMONGOC_STATIC_LIBRARY_DIRS}) - find_package(libmongocxx-static REQUIRED) - message(STATUS "Found mongocxx headers: ${LIBMONGOCXX_STATIC_INCLUDE_DIRS}") + find_package(libbson-static-1.0 REQUIRED) + find_library(EOS_LIBBSONC "libbson-static-1.0${CMAKE_STATIC_LIBRARY_SUFFIX}" PATHS ${LIBBSON_STATIC_LIBRARY_DIRS}) - # mongo-cxx-driver 3.2 release altered LIBBSONCXX_LIBRARIES semantics. Instead of library names, - # it now hold library paths. - if((LIBMONGOCXX_STATIC_VERSION_MAJOR LESS 3) OR ((LIBMONGOCXX_STATIC_VERSION_MAJOR EQUAL 3) AND (LIBMONGOCXX_STATIC_VERSION_MINOR LESS 2))) - find_library(EOS_LIBMONGOCXX ${LIBMONGOCXX_STATIC_LIBRARIES} - PATHS ${LIBMONGOCXX_STATIC_LIBRARY_DIRS} NO_DEFAULT_PATH) - else() - set(EOS_LIBMONGOCXX ${LIBMONGOCXX_STATIC_LIBRARIES}) + if(NOT EOS_LIBBSONCXX OR NOT EOS_LIBMONGOCXX OR NOT EOS_LIBMONGOC OR NOT EOS_LIBBSONC) + message(FATAL_ERROR "Could not find one or more mongo driver static libraries") endif() - message(STATUS "Found mongocxx library: ${EOS_LIBMONGOCXX}") else() message("Could NOT find MongoDB. mongo_db_plugin with MongoDB support will not be included.") return() @@ -64,7 +42,7 @@ if(BUILD_MONGO_DB_PLUGIN) target_link_libraries(mongo_db_plugin PUBLIC chain_plugin eosio_chain appbase - ${EOS_LIBMONGOCXX} ${EOS_LIBBSONCXX} + ${EOS_LIBMONGOCXX} ${EOS_LIBBSONCXX} ${EOS_LIBMONGOC} ${EOS_LIBBSONC} resolv ) else() diff --git a/scripts/eosio_build.sh b/scripts/eosio_build.sh index 5c09ea6bae1..878243b0cd5 100755 --- a/scripts/eosio_build.sh +++ b/scripts/eosio_build.sh @@ -347,7 +347,7 @@ if [ "$ARCH" == "Darwin" ]; then export OS_NAME=MacOSX # opt/gettext: cleos requires Intl, which requires gettext; it's keg only though and we don't want to force linking: https://github.com/EOSIO/eos/issues/2240#issuecomment-396309884 # HOME/lib/cmake: mongo_db_plugin.cpp:25:10: fatal error: 'bsoncxx/builder/basic/kvp.hpp' file not found - LOCAL_CMAKE_FLAGS="-DCMAKE_PREFIX_PATH=/usr/local/opt/gettext;$HOME/lib/cmake ${LOCAL_CMAKE_FLAGS}" + LOCAL_CMAKE_FLAGS="-DCMAKE_PREFIX_PATH=/usr/local/opt/gettext;$HOME ${LOCAL_CMAKE_FLAGS}" FILE="${REPO_ROOT}/scripts/eosio_build_darwin.sh" OPENSSL_ROOT_DIR=/usr/local/opt/openssl fi diff --git a/scripts/eosio_build_amazon.sh b/scripts/eosio_build_amazon.sh index 5d0438ca314..df620ab475c 100755 --- a/scripts/eosio_build_amazon.sh +++ b/scripts/eosio_build_amazon.sh @@ -8,7 +8,9 @@ DISK_AVAIL_KB=$( df . | tail -1 | awk '{print $4}' ) DISK_TOTAL=$(( DISK_TOTAL_KB / 1048576 )) DISK_AVAIL=$(( DISK_AVAIL_KB / 1048576 )) -PINNED_TOOLCHAIN=-DCMAKE_TOOLCHAIN_FILE=$BUILD_DIR/pinned_toolchain.cmake +if [ $BUILD_CLANG8 ]; then + PINNED_TOOLCHAIN=-DCMAKE_TOOLCHAIN_FILE=$BUILD_DIR/pinned_toolchain.cmake +fi if [[ "${OS_NAME}" == "Amazon Linux AMI" ]]; then # Amazonlinux1 DEP_ARRAY=( @@ -120,18 +122,6 @@ fi printf "\\n" -### clean up force build before starting -if [ $FORCE_BUILD ];then - rm -rf \ - ${SRC_LOCATION}/cmake-$CMAKE_VERSION \ - ${SRC_LOCATION}/llvm ${OPT_LOCATION}/llvm4 \ - ${TMP_LOCATION}/clang8 ${OPT_LOCATION}/clang8 \ - ${SRC_LOCATION}/zlib ${OPT_LOCATION}/zlib \ - ${SRC_LOCATION}/boost \ - ${SRC_LOCATION}/mongodb-linux-x86_64-amazon-$MONGODB_VERSION \ - ${SRC_LOCATION}/mongo-c-driver-$MONGO_C_DRIVER_VERSION \ - ${SRC_LOCATION}/mongo-cxx-driver-r$MONGO_CXX_DRIVER_VERSION -fi printf "Checking CMAKE installation...\\n" if [ ! -e $CMAKE ] || [ $FORCE_BUILD ]; then @@ -154,8 +144,7 @@ if [ $? -ne 0 ]; then exit -1; fi printf "\\n" - -if [ $PIN_COMPILER ]; then +if $PIN_COMPILER; then printf "Checking Clang 8 support...\\n" if [ ! -d $CLANG8_ROOT ] || [ $FORCE_BUILD ]; then printf "Installing Clang 8...\\n" @@ -267,67 +256,6 @@ else printf "\\n" - if [ $BUILD_MONGO ]; then - printf "Checking MongoDB installation...\\n" - if [ ! -d $MONGODB_ROOT ] || [ $FORCE_BUILD ]; then - printf "Installing MongoDB into ${MONGODB_ROOT}...\\n" - curl -OL https://fastdl.mongodb.org/linux/mongodb-linux-x86_64-amazon-$MONGODB_VERSION.tgz \ - && tar -xzf mongodb-linux-x86_64-amazon-$MONGODB_VERSION.tgz \ - && mv $SRC_LOCATION/mongodb-linux-x86_64-amazon-$MONGODB_VERSION $MONGODB_ROOT \ - && touch $MONGODB_LOG_LOCATION/mongod.log \ - && rm -f mongodb-linux-x86_64-amazon-$MONGODB_VERSION.tgz \ - && cp -f $REPO_ROOT/scripts/mongod.conf $MONGODB_CONF \ - && mkdir -p $MONGODB_DATA_LOCATION \ - && rm -rf $MONGODB_LINK_LOCATION \ - && rm -rf $BIN_LOCATION/mongod \ - && ln -s $MONGODB_ROOT $MONGODB_LINK_LOCATION \ - && ln -s $MONGODB_LINK_LOCATION/bin/mongod $BIN_LOCATION/mongod \ - || exit 1 - printf " - MongoDB successfully installed @ ${MONGODB_ROOT} (Symlinked to ${MONGODB_LINK_LOCATION}).\\n" - else - printf " - MongoDB found with correct version @ ${MONGODB_ROOT} (Symlinked to ${MONGODB_LINK_LOCATION}).\\n" - fi - if [ $? -ne 0 ]; then exit -1; fi - printf "Checking MongoDB C driver installation...\\n" - if [ ! -d $MONGO_C_DRIVER_ROOT ] || [ $FORCE_BUILD ]; then - printf "Installing MongoDB C driver...\\n" - curl -LO https://github.com/mongodb/mongo-c-driver/releases/download/$MONGO_C_DRIVER_VERSION/mongo-c-driver-$MONGO_C_DRIVER_VERSION.tar.gz \ - && tar -xzf mongo-c-driver-$MONGO_C_DRIVER_VERSION.tar.gz \ - && cd mongo-c-driver-$MONGO_C_DRIVER_VERSION \ - && mkdir -p cmake-build \ - && cd cmake-build \ - && $CMAKE -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=$PREFIX -DENABLE_BSON=ON -DENABLE_SSL=OPENSSL -DENABLE_AUTOMATIC_INIT_AND_CLEANUP=OFF -DENABLE_STATIC=ON .. \ - && make -j"${JOBS}" \ - && make install \ - && cd ../.. \ - && rm mongo-c-driver-$MONGO_C_DRIVER_VERSION.tar.gz \ - || exit 1 - printf " - MongoDB C driver successfully installed @ ${MONGO_C_DRIVER_ROOT}.\\n" - else - printf " - MongoDB C driver found with correct version @ ${MONGO_C_DRIVER_ROOT}.\\n" - fi - if [ $? -ne 0 ]; then exit -1; fi - printf "Checking MongoDB C++ driver installation...\\n" - if [ ! -d $MONGO_CXX_DRIVER_ROOT ] || [ $FORCE_BUILD ]; then - printf "Installing MongoDB C++ driver...\\n" - curl -L https://github.com/mongodb/mongo-cxx-driver/archive/r$MONGO_CXX_DRIVER_VERSION.tar.gz -o mongo-cxx-driver-r$MONGO_CXX_DRIVER_VERSION.tar.gz \ - && tar -xzf mongo-cxx-driver-r${MONGO_CXX_DRIVER_VERSION}.tar.gz \ - && cd mongo-cxx-driver-r$MONGO_CXX_DRIVER_VERSION/build \ - && $CMAKE -DBUILD_SHARED_LIBS=OFF -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=$PREFIX .. \ - && make -j"${JOBS}" VERBOSE=1 \ - && make install \ - && cd ../.. \ - && rm -f mongo-cxx-driver-r$MONGO_CXX_DRIVER_VERSION.tar.gz \ - || exit 1 - printf " - MongoDB C++ driver successfully installed @ ${MONGO_CXX_DRIVER_ROOT}.\\n" - else - printf " - MongoDB C++ driver found with correct version @ ${MONGO_CXX_DRIVER_ROOT}.\\n" - fi - if [ $? -ne 0 ]; then exit -1; fi - - printf "\\n" - fi - printf "Checking LLVM 4 support...\\n" if [ ! -d $LLVM_ROOT ] || [ $FORCE_BUILD ]; then printf "Installing LLVM 4...\\n" @@ -351,6 +279,70 @@ else printf "\\n" fi +if [ $BUILD_MONGO ]; then + printf "Checking MongoDB installation...\\n" + if [ ! -d $MONGODB_ROOT ] || [ $FORCE_BUILD ]; then + printf "Installing MongoDB into ${MONGODB_ROOT}...\\n" + curl -OL https://fastdl.mongodb.org/linux/mongodb-linux-x86_64-amazon-$MONGODB_VERSION.tgz \ + && tar -xzf mongodb-linux-x86_64-amazon-$MONGODB_VERSION.tgz \ + && mv $SRC_LOCATION/mongodb-linux-x86_64-amazon-$MONGODB_VERSION $MONGODB_ROOT \ + && touch $MONGODB_LOG_LOCATION/mongod.log \ + && rm -f mongodb-linux-x86_64-amazon-$MONGODB_VERSION.tgz \ + && cp -f $REPO_ROOT/scripts/mongod.conf $MONGODB_CONF \ + && mkdir -p $MONGODB_DATA_LOCATION \ + && rm -rf $MONGODB_LINK_LOCATION \ + && rm -rf $BIN_LOCATION/mongod \ + && ln -s $MONGODB_ROOT $MONGODB_LINK_LOCATION \ + && ln -s $MONGODB_LINK_LOCATION/bin/mongod $BIN_LOCATION/mongod \ + || exit 1 + printf " - MongoDB successfully installed @ ${MONGODB_ROOT} (Symlinked to ${MONGODB_LINK_LOCATION}).\\n" + else + printf " - MongoDB found with correct version @ ${MONGODB_ROOT} (Symlinked to ${MONGODB_LINK_LOCATION}).\\n" + fi + if [ $? -ne 0 ]; then exit -1; fi + printf "Checking MongoDB C driver installation...\\n" + if [ ! -d $MONGO_C_DRIVER_ROOT ] || [ $FORCE_BUILD ]; then + printf "Installing MongoDB C driver...\\n" + curl -LO https://github.com/mongodb/mongo-c-driver/releases/download/$MONGO_C_DRIVER_VERSION/mongo-c-driver-$MONGO_C_DRIVER_VERSION.tar.gz \ + && tar -xzf mongo-c-driver-$MONGO_C_DRIVER_VERSION.tar.gz \ + && cd mongo-c-driver-$MONGO_C_DRIVER_VERSION \ + && mkdir -p cmake-build \ + && cd cmake-build \ + && $CMAKE -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=$PREFIX -DENABLE_BSON=ON -DENABLE_SSL=OPENSSL -DENABLE_AUTOMATIC_INIT_AND_CLEANUP=OFF -DENABLE_STATIC=ON -DENABLE_ICU=OFF $PINNED_TOOLCHAIN .. \ + && make -j"${JOBS}" \ + && make install \ + && cd ../.. \ + && rm mongo-c-driver-$MONGO_C_DRIVER_VERSION.tar.gz \ + || exit 1 + printf " - MongoDB C driver successfully installed @ ${MONGO_C_DRIVER_ROOT}.\\n" + else + printf " - MongoDB C driver found with correct version @ ${MONGO_C_DRIVER_ROOT}.\\n" + fi + if [ $? -ne 0 ]; then exit -1; fi + printf "Checking MongoDB C++ driver installation...\\n" + if [ ! -d $MONGO_CXX_DRIVER_ROOT ] || [ $FORCE_BUILD ]; then + printf "Installing MongoDB C++ driver...\\n" + curl -L https://github.com/mongodb/mongo-cxx-driver/archive/r$MONGO_CXX_DRIVER_VERSION.tar.gz -o mongo-cxx-driver-r$MONGO_CXX_DRIVER_VERSION.tar.gz \ + && tar -xzf mongo-cxx-driver-r${MONGO_CXX_DRIVER_VERSION}.tar.gz \ + && cd mongo-cxx-driver-r$MONGO_CXX_DRIVER_VERSION \ + && sed -i 's/"maxAwaitTimeMS", count/"maxAwaitTimeMS", static_cast(count)/' src/mongocxx/options/change_stream.cpp \ + && sed -i 's/add_subdirectory(test)//' src/mongocxx/CMakeLists.txt src/bsoncxx/CMakeLists.txt \ + && cd build \ + && $CMAKE -DBUILD_SHARED_LIBS=OFF -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=$PREFIX $PINNED_TOOLCHAIN .. \ + && make -j"${JOBS}" VERBOSE=1 \ + && make install \ + && cd ../.. \ + && rm -f mongo-cxx-driver-r$MONGO_CXX_DRIVER_VERSION.tar.gz \ + || exit 1 + printf " - MongoDB C++ driver successfully installed @ ${MONGO_CXX_DRIVER_ROOT}.\\n" + else + printf " - MongoDB C++ driver found with correct version @ ${MONGO_CXX_DRIVER_ROOT}.\\n" + fi + if [ $? -ne 0 ]; then exit -1; fi + + printf "\\n" +fi + function print_instructions() { return 0 } diff --git a/scripts/eosio_build_centos.sh b/scripts/eosio_build_centos.sh index 140705f4d6d..2e5688473bf 100755 --- a/scripts/eosio_build_centos.sh +++ b/scripts/eosio_build_centos.sh @@ -25,7 +25,9 @@ printf "Disk space total: ${DISK_TOTAL%.*}G\\n" printf "Disk space available: ${DISK_AVAIL%.*}G\\n" printf "Concurrent Jobs (make -j): ${JOBS}\\n" -PINNED_TOOLCHAIN=-DCMAKE_TOOLCHAIN_FILE=$BUILD_DIR/pinned_toolchain.cmake +if [ $BUILD_CLANG8 ]; then + PINNED_TOOLCHAIN=-DCMAKE_TOOLCHAIN_FILE=$BUILD_DIR/pinned_toolchain.cmake +fi if [ "${MEM_MEG}" -lt 7000 ]; then printf "\\nYour system must have 7 or more Gigabytes of physical memory installed.\\n" @@ -319,67 +321,6 @@ else printf "\\n" - if [ $BUILD_MONGO ]; then - printf "Checking MongoDB installation...\\n" - if [ ! -d $MONGODB_ROOT ] || [ $FORCE_BUILD ]; then - printf "Installing MongoDB into ${MONGODB_ROOT}...\\n" - curl -OL https://fastdl.mongodb.org/linux/mongodb-linux-x86_64-amazon-$MONGODB_VERSION.tgz \ - && tar -xzf mongodb-linux-x86_64-amazon-$MONGODB_VERSION.tgz \ - && mv $SRC_LOCATION/mongodb-linux-x86_64-amazon-$MONGODB_VERSION $MONGODB_ROOT \ - && touch $MONGODB_LOG_LOCATION/mongod.log \ - && rm -f mongodb-linux-x86_64-amazon-$MONGODB_VERSION.tgz \ - && cp -f $REPO_ROOT/scripts/mongod.conf $MONGODB_CONF \ - && mkdir -p $MONGODB_DATA_LOCATION \ - && rm -rf $MONGODB_LINK_LOCATION \ - && rm -rf $BIN_LOCATION/mongod \ - && ln -s $MONGODB_ROOT $MONGODB_LINK_LOCATION \ - && ln -s $MONGODB_LINK_LOCATION/bin/mongod $BIN_LOCATION/mongod \ - || exit 1 - printf " - MongoDB successfully installed @ ${MONGODB_ROOT} (Symlinked to ${MONGODB_LINK_LOCATION}).\\n" - else - printf " - MongoDB found with correct version @ ${MONGODB_ROOT} (Symlinked to ${MONGODB_LINK_LOCATION}).\\n" - fi - if [ $? -ne 0 ]; then exit -1; fi - printf "Checking MongoDB C driver installation...\\n" - if [ ! -d $MONGO_C_DRIVER_ROOT ] || [ $FORCE_BUILD ]; then - printf "Installing MongoDB C driver...\\n" - curl -LO https://github.com/mongodb/mongo-c-driver/releases/download/$MONGO_C_DRIVER_VERSION/mongo-c-driver-$MONGO_C_DRIVER_VERSION.tar.gz \ - && tar -xzf mongo-c-driver-$MONGO_C_DRIVER_VERSION.tar.gz \ - && cd mongo-c-driver-$MONGO_C_DRIVER_VERSION \ - && mkdir -p cmake-build \ - && cd cmake-build \ - && $CMAKE -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=$PREFIX -DENABLE_BSON=ON -DENABLE_SSL=OPENSSL -DENABLE_AUTOMATIC_INIT_AND_CLEANUP=OFF -DENABLE_STATIC=ON .. \ - && make -j"${JOBS}" \ - && make install \ - && cd ../.. \ - && rm mongo-c-driver-$MONGO_C_DRIVER_VERSION.tar.gz \ - || exit 1 - printf " - MongoDB C driver successfully installed @ ${MONGO_C_DRIVER_ROOT}.\\n" - else - printf " - MongoDB C driver found with correct version @ ${MONGO_C_DRIVER_ROOT}.\\n" - fi - if [ $? -ne 0 ]; then exit -1; fi - printf "Checking MongoDB C++ driver installation...\\n" - if [ ! -d $MONGO_CXX_DRIVER_ROOT ] || [ $FORCE_BUILD ]; then - printf "Installing MongoDB C++ driver...\\n" - curl -L https://github.com/mongodb/mongo-cxx-driver/archive/r$MONGO_CXX_DRIVER_VERSION.tar.gz -o mongo-cxx-driver-r$MONGO_CXX_DRIVER_VERSION.tar.gz \ - && tar -xzf mongo-cxx-driver-r${MONGO_CXX_DRIVER_VERSION}.tar.gz \ - && cd mongo-cxx-driver-r$MONGO_CXX_DRIVER_VERSION/build \ - && $CMAKE -DBUILD_SHARED_LIBS=OFF -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=$PREFIX .. \ - && make -j"${JOBS}" VERBOSE=1 \ - && make install \ - && cd ../.. \ - && rm -f mongo-cxx-driver-r$MONGO_CXX_DRIVER_VERSION.tar.gz \ - || exit 1 - printf " - MongoDB C++ driver successfully installed @ ${MONGO_CXX_DRIVER_ROOT}.\\n" - else - printf " - MongoDB C++ driver found with correct version @ ${MONGO_CXX_DRIVER_ROOT}.\\n" - fi - if [ $? -ne 0 ]; then exit -1; fi - - printf "\\n" - fi - printf "Checking LLVM 4 support...\\n" if [ ! -d $LLVM_ROOT ] || [ $FORCE_BUILD ]; then printf "Installing LLVM 4...\\n" @@ -402,6 +343,70 @@ else printf "\\n" fi +if [ $BUILD_MONGO ]; then + printf "Checking MongoDB installation...\\n" + if [ ! -d $MONGODB_ROOT ] || [ $FORCE_BUILD ]; then + printf "Installing MongoDB into ${MONGODB_ROOT}...\\n" + curl -OL https://fastdl.mongodb.org/linux/mongodb-linux-x86_64-amazon-$MONGODB_VERSION.tgz \ + && tar -xzf mongodb-linux-x86_64-amazon-$MONGODB_VERSION.tgz \ + && mv $SRC_LOCATION/mongodb-linux-x86_64-amazon-$MONGODB_VERSION $MONGODB_ROOT \ + && touch $MONGODB_LOG_LOCATION/mongod.log \ + && rm -f mongodb-linux-x86_64-amazon-$MONGODB_VERSION.tgz \ + && cp -f $REPO_ROOT/scripts/mongod.conf $MONGODB_CONF \ + && mkdir -p $MONGODB_DATA_LOCATION \ + && rm -rf $MONGODB_LINK_LOCATION \ + && rm -rf $BIN_LOCATION/mongod \ + && ln -s $MONGODB_ROOT $MONGODB_LINK_LOCATION \ + && ln -s $MONGODB_LINK_LOCATION/bin/mongod $BIN_LOCATION/mongod \ + || exit 1 + printf " - MongoDB successfully installed @ ${MONGODB_ROOT} (Symlinked to ${MONGODB_LINK_LOCATION}).\\n" + else + printf " - MongoDB found with correct version @ ${MONGODB_ROOT} (Symlinked to ${MONGODB_LINK_LOCATION}).\\n" + fi + if [ $? -ne 0 ]; then exit -1; fi + printf "Checking MongoDB C driver installation...\\n" + if [ ! -d $MONGO_C_DRIVER_ROOT ] || [ $FORCE_BUILD ]; then + printf "Installing MongoDB C driver...\\n" + curl -LO https://github.com/mongodb/mongo-c-driver/releases/download/$MONGO_C_DRIVER_VERSION/mongo-c-driver-$MONGO_C_DRIVER_VERSION.tar.gz \ + && tar -xzf mongo-c-driver-$MONGO_C_DRIVER_VERSION.tar.gz \ + && cd mongo-c-driver-$MONGO_C_DRIVER_VERSION \ + && mkdir -p cmake-build \ + && cd cmake-build \ + && $CMAKE -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=$PREFIX -DENABLE_BSON=ON -DENABLE_SSL=OPENSSL -DENABLE_AUTOMATIC_INIT_AND_CLEANUP=OFF -DENABLE_STATIC=ON -DENABLE_ICU=OFF $PINNED_TOOLCHAIN .. \ + && make -j"${JOBS}" \ + && make install \ + && cd ../.. \ + && rm mongo-c-driver-$MONGO_C_DRIVER_VERSION.tar.gz \ + || exit 1 + printf " - MongoDB C driver successfully installed @ ${MONGO_C_DRIVER_ROOT}.\\n" + else + printf " - MongoDB C driver found with correct version @ ${MONGO_C_DRIVER_ROOT}.\\n" + fi + if [ $? -ne 0 ]; then exit -1; fi + printf "Checking MongoDB C++ driver installation...\\n" + if [ ! -d $MONGO_CXX_DRIVER_ROOT ] || [ $FORCE_BUILD ]; then + printf "Installing MongoDB C++ driver...\\n" + curl -L https://github.com/mongodb/mongo-cxx-driver/archive/r$MONGO_CXX_DRIVER_VERSION.tar.gz -o mongo-cxx-driver-r$MONGO_CXX_DRIVER_VERSION.tar.gz \ + && tar -xzf mongo-cxx-driver-r${MONGO_CXX_DRIVER_VERSION}.tar.gz \ + && cd mongo-cxx-driver-r$MONGO_CXX_DRIVER_VERSION \ + && sed -i 's/"maxAwaitTimeMS", count/"maxAwaitTimeMS", static_cast(count)/' src/mongocxx/options/change_stream.cpp \ + && sed -i 's/add_subdirectory(test)//' src/mongocxx/CMakeLists.txt src/bsoncxx/CMakeLists.txt \ + && cd build \ + && $CMAKE -DBUILD_SHARED_LIBS=OFF -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=$PREFIX $PINNED_TOOLCHAIN .. \ + && make -j"${JOBS}" VERBOSE=1 \ + && make install \ + && cd ../.. \ + && rm -f mongo-cxx-driver-r$MONGO_CXX_DRIVER_VERSION.tar.gz \ + || exit 1 + printf " - MongoDB C++ driver successfully installed @ ${MONGO_CXX_DRIVER_ROOT}.\\n" + else + printf " - MongoDB C++ driver found with correct version @ ${MONGO_CXX_DRIVER_ROOT}.\\n" + fi + if [ $? -ne 0 ]; then exit -1; fi + + printf "\\n" +fi + function print_instructions() { printf "source ${PYTHON3PATH}/enable\\n" printf "source /opt/rh/devtoolset-7/enable\\n" diff --git a/scripts/eosio_build_darwin.sh b/scripts/eosio_build_darwin.sh index 64b6222e34f..8579a3f0370 100755 --- a/scripts/eosio_build_darwin.sh +++ b/scripts/eosio_build_darwin.sh @@ -227,7 +227,7 @@ if [ $BUILD_MONGO ]; then && cd mongo-c-driver-$MONGO_C_DRIVER_VERSION \ && mkdir -p cmake-build \ && cd cmake-build \ - && $CMAKE -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=$PREFIX -DENABLE_BSON=ON -DENABLE_SSL=DARWIN -DENABLE_AUTOMATIC_INIT_AND_CLEANUP=OFF -DENABLE_STATIC=ON .. \ + && $CMAKE -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=$PREFIX -DENABLE_BSON=ON -DENABLE_SSL=DARWIN -DENABLE_AUTOMATIC_INIT_AND_CLEANUP=OFF -DENABLE_STATIC=ON -DENABLE_ICU=OFF -DENABLE_SASL=OFF .. \ && make -j"${JOBS}" \ && make install \ && cd ../.. \ @@ -243,7 +243,10 @@ if [ $BUILD_MONGO ]; then printf "Installing MongoDB C++ driver...\\n" curl -L https://github.com/mongodb/mongo-cxx-driver/archive/r$MONGO_CXX_DRIVER_VERSION.tar.gz -o mongo-cxx-driver-r$MONGO_CXX_DRIVER_VERSION.tar.gz \ && tar -xzf mongo-cxx-driver-r${MONGO_CXX_DRIVER_VERSION}.tar.gz \ - && cd mongo-cxx-driver-r$MONGO_CXX_DRIVER_VERSION/build \ + && cd mongo-cxx-driver-r$MONGO_CXX_DRIVER_VERSION \ + && sed -i '' 's/"maxAwaitTimeMS", count/"maxAwaitTimeMS", static_cast(count)/' src/mongocxx/options/change_stream.cpp \ + && sed -i '' 's/add_subdirectory(test)//' src/mongocxx/CMakeLists.txt src/bsoncxx/CMakeLists.txt \ + && cd build \ && $CMAKE -DBUILD_SHARED_LIBS=OFF -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=$PREFIX .. \ && make -j"${JOBS}" VERBOSE=1 \ && make install \ diff --git a/scripts/eosio_build_ubuntu.sh b/scripts/eosio_build_ubuntu.sh index 6284d8e5a5a..d6d40828759 100755 --- a/scripts/eosio_build_ubuntu.sh +++ b/scripts/eosio_build_ubuntu.sh @@ -25,7 +25,9 @@ printf "Disk install: ${DISK_INSTALL}\\n" printf "Disk space total: ${DISK_TOTAL%.*}G\\n" printf "Disk space available: ${DISK_AVAIL%.*}G\\n" -PINNED_TOOLCHAIN=-DCMAKE_TOOLCHAIN_FILE=$BUILD_DIR/pinned_toolchain.cmake +if [ $BUILD_CLANG8 ]; then + PINNED_TOOLCHAIN=-DCMAKE_TOOLCHAIN_FILE=$BUILD_DIR/pinned_toolchain.cmake +fi if [ "${MEM_MEG}" -lt 7000 ]; then printf "Your system must have 7 or more Gigabytes of physical memory installed.\\n" @@ -286,76 +288,6 @@ else printf "\\n" - if [ $BUILD_MONGO ]; then - printf "Checking MongoDB installation...\\n" - if [ ! -d $MONGODB_ROOT ] || [ $FORCE_BUILD ]; then - printf "Installing MongoDB into ${MONGODB_ROOT}...\\n" - curl -OL http://downloads.mongodb.org/linux/mongodb-linux-x86_64-ubuntu$OS_MAJ$OS_MIN-$MONGODB_VERSION.tgz \ - && tar -xzf mongodb-linux-x86_64-ubuntu$OS_MAJ$OS_MIN-$MONGODB_VERSION.tgz \ - && mv $SRC_LOCATION/mongodb-linux-x86_64-ubuntu$OS_MAJ$OS_MIN-$MONGODB_VERSION $MONGODB_ROOT \ - && touch $MONGODB_LOG_LOCATION/mongod.log \ - && rm -f mongodb-linux-x86_64-ubuntu$OS_MAJ$OS_MIN-$MONGODB_VERSION.tgz \ - && cp -f $REPO_ROOT/scripts/mongod.conf $MONGODB_CONF \ - && mkdir -p $MONGODB_DATA_LOCATION \ - && rm -rf $MONGODB_LINK_LOCATION \ - && rm -rf $BIN_LOCATION/mongod \ - && ln -s $MONGODB_ROOT $MONGODB_LINK_LOCATION \ - && ln -s $MONGODB_LINK_LOCATION/bin/mongod $BIN_LOCATION/mongod \ - || exit 1 - printf " - MongoDB successfully installed @ ${MONGODB_ROOT} (Symlinked to ${MONGODB_LINK_LOCATION}).\\n" - else - printf " - MongoDB found with correct version @ ${MONGODB_ROOT} (Symlinked to ${MONGODB_LINK_LOCATION}).\\n" - fi - if [ $? -ne 0 ]; then exit -1; fi - printf "Checking MongoDB C driver installation...\\n" - if [ ! -d $MONGO_C_DRIVER_ROOT ] || [ $FORCE_BUILD ]; then - if [ ! $BUILD_CLANG8 ]; then - PINNED_TOOLCHAIN="" - fi - printf "Installing MongoDB C driver...\\n" - curl -LO https://github.com/mongodb/mongo-c-driver/releases/download/$MONGO_C_DRIVER_VERSION/mongo-c-driver-$MONGO_C_DRIVER_VERSION.tar.gz \ - && tar -xzf mongo-c-driver-$MONGO_C_DRIVER_VERSION.tar.gz \ - && cd mongo-c-driver-$MONGO_C_DRIVER_VERSION \ - && mkdir -p cmake-build \ - && cd cmake-build \ - && $CMAKE -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=$PREFIX -DENABLE_BSON=ON -DENABLE_SSL=OPENSSL -DENABLE_AUTOMATIC_INIT_AND_CLEANUP=OFF -DENABLE_STATIC=ON $PINNED_TOOLCHAIN .. \ - && make -j"${JOBS}" \ - && make install \ - && cd ../.. \ - && rm mongo-c-driver-$MONGO_C_DRIVER_VERSION.tar.gz \ - || exit 1 - printf " - MongoDB C driver successfully installed @ ${MONGO_C_DRIVER_ROOT}.\\n" - else - printf " - MongoDB C driver found with correct version @ ${MONGO_C_DRIVER_ROOT}.\\n" - fi - - if [ $? -ne 0 ]; then exit -1; fi - printf "Checking MongoDB C++ driver installation...\\n" - if [ ! -d $MONGO_CXX_DRIVER_ROOT ] || [ $FORCE_BUILD ]; then - if [ ! $BUILD_CLANG8 ]; then - PINNED_TOOLCHAIN="" - fi - printf "Installing MongoDB C++ driver...\\n" - curl -L https://github.com/mongodb/mongo-cxx-driver/archive/r$MONGO_CXX_DRIVER_VERSION.tar.gz -o mongo-cxx-driver-r$MONGO_CXX_DRIVER_VERSION.tar.gz \ - && tar -xzf mongo-cxx-driver-r${MONGO_CXX_DRIVER_VERSION}.tar.gz \ - && cd mongo-cxx-driver-r$MONGO_CXX_DRIVER_VERSION \ - && sed '111 s/count/static_cast(count)/' src/mongocxx/options/change_stream.cpp &> src/mongocxx/options/change_stream.cpp \ - && cd build \ - && $CMAKE -DBUILD_SHARED_LIBS=OFF -DCXX_CMAKE_FLAGS=-D_GLIBCXX_USE_CXX11_ABI=1 -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=$PREFIX $PINNED_TOOLCHAIN .. \ - && make -j"${JOBS}" VERBOSE=1 \ - && make install \ - && cd ../.. \ - && rm -f mongo-cxx-driver-r$MONGO_CXX_DRIVER_VERSION.tar.gz \ - || exit 1 - printf " - MongoDB C++ driver successfully installed @ ${MONGO_CXX_DRIVER_ROOT}.\\n" - else - printf " - MongoDB C++ driver found with correct version @ ${MONGO_CXX_DRIVER_ROOT}.\\n" - fi - if [ $? -ne 0 ]; then exit -1; fi - - printf "\\n" - fi - printf "Checking LLVM 4 support...\\n" if [ ! -d $LLVM_ROOT ] || [ $FORCE_BUILD ]; then ln -s /usr/lib/llvm-4.0 $LLVM_ROOT \ @@ -367,6 +299,71 @@ else if [ $? -ne 0 ]; then exit -1; fi fi +if [ $BUILD_MONGO ]; then + printf "Checking MongoDB installation...\\n" + if [ ! -d $MONGODB_ROOT ] || [ $FORCE_BUILD ]; then + printf "Installing MongoDB into ${MONGODB_ROOT}...\\n" + curl -OL http://downloads.mongodb.org/linux/mongodb-linux-x86_64-ubuntu$OS_MAJ$OS_MIN-$MONGODB_VERSION.tgz \ + && tar -xzf mongodb-linux-x86_64-ubuntu$OS_MAJ$OS_MIN-$MONGODB_VERSION.tgz \ + && mv $SRC_LOCATION/mongodb-linux-x86_64-ubuntu$OS_MAJ$OS_MIN-$MONGODB_VERSION $MONGODB_ROOT \ + && touch $MONGODB_LOG_LOCATION/mongod.log \ + && rm -f mongodb-linux-x86_64-ubuntu$OS_MAJ$OS_MIN-$MONGODB_VERSION.tgz \ + && cp -f $REPO_ROOT/scripts/mongod.conf $MONGODB_CONF \ + && mkdir -p $MONGODB_DATA_LOCATION \ + && rm -rf $MONGODB_LINK_LOCATION \ + && rm -rf $BIN_LOCATION/mongod \ + && ln -s $MONGODB_ROOT $MONGODB_LINK_LOCATION \ + && ln -s $MONGODB_LINK_LOCATION/bin/mongod $BIN_LOCATION/mongod \ + || exit 1 + printf " - MongoDB successfully installed @ ${MONGODB_ROOT} (Symlinked to ${MONGODB_LINK_LOCATION}).\\n" + else + printf " - MongoDB found with correct version @ ${MONGODB_ROOT} (Symlinked to ${MONGODB_LINK_LOCATION}).\\n" + fi + if [ $? -ne 0 ]; then exit -1; fi + printf "Checking MongoDB C driver installation...\\n" + if [ ! -d $MONGO_C_DRIVER_ROOT ] || [ $FORCE_BUILD ]; then + printf "Installing MongoDB C driver...\\n" + curl -LO https://github.com/mongodb/mongo-c-driver/releases/download/$MONGO_C_DRIVER_VERSION/mongo-c-driver-$MONGO_C_DRIVER_VERSION.tar.gz \ + && tar -xzf mongo-c-driver-$MONGO_C_DRIVER_VERSION.tar.gz \ + && cd mongo-c-driver-$MONGO_C_DRIVER_VERSION \ + && mkdir -p cmake-build \ + && cd cmake-build \ + && $CMAKE -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=$PREFIX -DENABLE_BSON=ON -DENABLE_SSL=OPENSSL -DENABLE_AUTOMATIC_INIT_AND_CLEANUP=OFF -DENABLE_STATIC=ON -DENABLE_ICU=OFF $PINNED_TOOLCHAIN .. \ + && make -j"${JOBS}" \ + && make install \ + && cd ../.. \ + && rm mongo-c-driver-$MONGO_C_DRIVER_VERSION.tar.gz \ + || exit 1 + printf " - MongoDB C driver successfully installed @ ${MONGO_C_DRIVER_ROOT}.\\n" + else + printf " - MongoDB C driver found with correct version @ ${MONGO_C_DRIVER_ROOT}.\\n" + fi + + if [ $? -ne 0 ]; then exit -1; fi + printf "Checking MongoDB C++ driver installation...\\n" + if [ ! -d $MONGO_CXX_DRIVER_ROOT ] || [ $FORCE_BUILD ]; then + printf "Installing MongoDB C++ driver...\\n" + curl -L https://github.com/mongodb/mongo-cxx-driver/archive/r$MONGO_CXX_DRIVER_VERSION.tar.gz -o mongo-cxx-driver-r$MONGO_CXX_DRIVER_VERSION.tar.gz \ + && tar -xzf mongo-cxx-driver-r${MONGO_CXX_DRIVER_VERSION}.tar.gz \ + && cd mongo-cxx-driver-r$MONGO_CXX_DRIVER_VERSION \ + && sed -i 's/"maxAwaitTimeMS", count/"maxAwaitTimeMS", static_cast(count)/' src/mongocxx/options/change_stream.cpp \ + && sed -i 's/add_subdirectory(test)//' src/mongocxx/CMakeLists.txt src/bsoncxx/CMakeLists.txt \ + && cd build \ + && $CMAKE -DBUILD_SHARED_LIBS=OFF -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=$PREFIX $PINNED_TOOLCHAIN .. \ + && make -j"${JOBS}" VERBOSE=1 \ + && make install \ + && cd ../.. \ + && rm -f mongo-cxx-driver-r$MONGO_CXX_DRIVER_VERSION.tar.gz \ + || exit 1 + printf " - MongoDB C++ driver successfully installed @ ${MONGO_CXX_DRIVER_ROOT}.\\n" + else + printf " - MongoDB C++ driver found with correct version @ ${MONGO_CXX_DRIVER_ROOT}.\\n" + fi + if [ $? -ne 0 ]; then exit -1; fi + + printf "\\n" +fi + cd .. printf "\\n" From 57fc7c347291815ac679131cc5f44c0059449c7d Mon Sep 17 00:00:00 2001 From: Matt Witherspoon <32485495+spoonincode@users.noreply.github.com> Date: Thu, 25 Apr 2019 16:36:22 -0400 Subject: [PATCH 2/7] Reenable mongod during buildkite serialized tests & revert VM --- .buildkite/pipeline.yml | 10 +++++----- scripts/serial-test.sh | 6 +++--- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/.buildkite/pipeline.yml b/.buildkite/pipeline.yml index cc62b7e41a0..bf0db2dc12e 100644 --- a/.buildkite/pipeline.yml +++ b/.buildkite/pipeline.yml @@ -190,7 +190,7 @@ steps: region: "us-west-2" docker#v2.1.0: debug: true - image: "436617320021.dkr.ecr.us-west-2.amazonaws.com/ci:amazonlinux2_2-3" + image: "436617320021.dkr.ecr.us-west-2.amazonaws.com/ci:amazonlinux2_2-2" propagate-environment: true workdir: /data/job timeout: 60 @@ -233,7 +233,7 @@ steps: region: "us-west-2" docker#v2.1.0: debug: true - image: "436617320021.dkr.ecr.us-west-2.amazonaws.com/ci:centos7_2-3" + image: "436617320021.dkr.ecr.us-west-2.amazonaws.com/ci:centos7_2-2" propagate-environment: true workdir: /data/job timeout: 60 @@ -276,7 +276,7 @@ steps: region: "us-west-2" docker#v2.1.0: debug: true - image: "436617320021.dkr.ecr.us-west-2.amazonaws.com/ci:ubuntu16_2-3" + image: "436617320021.dkr.ecr.us-west-2.amazonaws.com/ci:ubuntu16_2-2" propagate-environment: true workdir: /data/job timeout: 60 @@ -319,7 +319,7 @@ steps: region: "us-west-2" docker#v2.1.0: debug: true - image: "436617320021.dkr.ecr.us-west-2.amazonaws.com/ci:ubuntu18_2-3" + image: "436617320021.dkr.ecr.us-west-2.amazonaws.com/ci:ubuntu18_2-2" propagate-environment: true workdir: /data/job timeout: 60 @@ -382,7 +382,7 @@ steps: ./scripts/serial-test.sh label: ":darwin: Mojave NP Tests" agents: - - "role=tester-v2-2" + - "role=tester-v2-1" - "os=mojave" timeout: 60 diff --git a/scripts/serial-test.sh b/scripts/serial-test.sh index 109efb6e9d1..4e2b935e09c 100755 --- a/scripts/serial-test.sh +++ b/scripts/serial-test.sh @@ -4,8 +4,8 @@ set -e # exit on failure of any "simple" command (excludes &&, ||, or | chains) PATH=$PATH:~/opt/mongodb/bin echo "Extracting build directory..." [[ -z "${1}" ]] && tar -zxf build.tar.gz || tar -xzf $1 -#echo "Starting MongoDB..." -#~/bin/mongod --fork --dbpath ~/data/mongodb -f ~/etc/mongod.conf --logpath "$(pwd)"/mongod.log +echo "Starting MongoDB..." +mongod --fork --dbpath ~/data/mongodb -f ~/etc/mongod.conf --logpath "$(pwd)"/mongod.log cd /data/job/build # run tests echo "Running tests..." @@ -24,7 +24,7 @@ mv $(pwd)/Testing/$(ls $(pwd)/Testing/ | grep '20' | tail -n 1)/Test.xml $XML_FI buildkite-agent artifact upload config.ini buildkite-agent artifact upload genesis.json cd .. -#buildkite-agent artifact upload mongod.log +buildkite-agent artifact upload mongod.log cd build buildkite-agent artifact upload $XML_FILENAME echo "Done uploading artifacts." From 3042142088070dab1c139a0c74eb5827c2af728d Mon Sep 17 00:00:00 2001 From: Matt Witherspoon <32485495+spoonincode@users.noreply.github.com> Date: Thu, 25 Apr 2019 19:56:48 -0400 Subject: [PATCH 3/7] on macos, have cmake search through $PREFIX, not $HOME, as $HOME may no longer be where the script installed deps --- scripts/eosio_build.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/eosio_build.sh b/scripts/eosio_build.sh index 9987c42a2ac..f08a50dfa03 100755 --- a/scripts/eosio_build.sh +++ b/scripts/eosio_build.sh @@ -335,7 +335,7 @@ if [ "$ARCH" == "Darwin" ]; then export OS_NAME=MacOSX # opt/gettext: cleos requires Intl, which requires gettext; it's keg only though and we don't want to force linking: https://github.com/EOSIO/eos/issues/2240#issuecomment-396309884 # HOME/lib/cmake: mongo_db_plugin.cpp:25:10: fatal error: 'bsoncxx/builder/basic/kvp.hpp' file not found - LOCAL_CMAKE_FLAGS="-DCMAKE_PREFIX_PATH=/usr/local/opt/gettext;$HOME ${LOCAL_CMAKE_FLAGS}" + LOCAL_CMAKE_FLAGS="-DCMAKE_PREFIX_PATH=/usr/local/opt/gettext;$PREFIX ${LOCAL_CMAKE_FLAGS}" FILE="${REPO_ROOT}/scripts/eosio_build_darwin.sh" OPENSSL_ROOT_DIR=/usr/local/opt/openssl fi From 9ba29521a04cad0e980e9c7d4f2322f67dd1dd20 Mon Sep 17 00:00:00 2001 From: Matt Witherspoon <32485495+spoonincode@users.noreply.github.com> Date: Thu, 25 Apr 2019 22:07:15 -0400 Subject: [PATCH 4/7] restore a few pieces mistakingly dropped from amazon script during merge --- scripts/eosio_build_amazon.sh | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/scripts/eosio_build_amazon.sh b/scripts/eosio_build_amazon.sh index 2ae1bea3f98..141a3af592a 100755 --- a/scripts/eosio_build_amazon.sh +++ b/scripts/eosio_build_amazon.sh @@ -114,6 +114,18 @@ fi printf "\\n" +### clean up force build before starting +if [ $FORCE_BUILD ];then + rm -rf \ + ${SRC_LOCATION}/cmake-$CMAKE_VERSION \ + ${SRC_LOCATION}/llvm ${OPT_LOCATION}/llvm4 \ + ${TMP_LOCATION}/clang8 ${OPT_LOCATION}/clang8 \ + ${SRC_LOCATION}/zlib ${OPT_LOCATION}/zlib \ + ${SRC_LOCATION}/boost \ + ${SRC_LOCATION}/mongodb-linux-x86_64-amazon-$MONGODB_VERSION \ + ${SRC_LOCATION}/mongo-c-driver-$MONGO_C_DRIVER_VERSION \ + ${SRC_LOCATION}/mongo-cxx-driver-r$MONGO_CXX_DRIVER_VERSION +fi printf "Checking CMAKE installation...\\n" if [ ! -e $CMAKE ] || [ $FORCE_BUILD ]; then @@ -134,9 +146,10 @@ fi if [ $? -ne 0 ]; then exit -1; fi + printf "\\n" -if $PIN_COMPILER; then +if [ $PIN_COMPILER ]; then printf "Checking Clang 8 support...\\n" if [ ! -d $CLANG8_ROOT ] || [ $FORCE_BUILD ]; then printf "Installing Clang 8...\\n" From 5d8ef4153f11c05b5cf94ceea1c87ec8d048f2c1 Mon Sep 17 00:00:00 2001 From: Matt Witherspoon <32485495+spoonincode@users.noreply.github.com> Date: Fri, 26 Apr 2019 10:34:38 -0400 Subject: [PATCH 5/7] add NO_DEFAULT_PATH to mongo find_libraries to ensure we don't mistakingly pick up a static library from elsewhere --- plugins/mongo_db_plugin/CMakeLists.txt | 15 +++------------ 1 file changed, 3 insertions(+), 12 deletions(-) diff --git a/plugins/mongo_db_plugin/CMakeLists.txt b/plugins/mongo_db_plugin/CMakeLists.txt index 923e1f11c08..f4f65778ca8 100644 --- a/plugins/mongo_db_plugin/CMakeLists.txt +++ b/plugins/mongo_db_plugin/CMakeLists.txt @@ -5,20 +5,9 @@ if(BUILD_MONGO_DB_PLUGIN) if (libmongoc-1.0_FOUND) find_package(libbsoncxx-static REQUIRED) - find_library(EOS_LIBBSONCXX "libbsoncxx-static${CMAKE_STATIC_LIBRARY_SUFFIX}" PATHS ${LIBBSONCXX_STATIC_LIBRARY_DIRS}) - find_package(libmongocxx-static REQUIRED) - find_library(EOS_LIBMONGOCXX "libmongocxx-static${CMAKE_STATIC_LIBRARY_SUFFIX}" PATHS ${LIBMONGOCXX_STATIC_LIBRARY_DIRS}) - find_package(libmongoc-static-1.0 REQUIRED) - find_library(EOS_LIBMONGOC "libmongoc-static-1.0${CMAKE_STATIC_LIBRARY_SUFFIX}" PATHS ${LIBMONGOC_STATIC_LIBRARY_DIRS}) - find_package(libbson-static-1.0 REQUIRED) - find_library(EOS_LIBBSONC "libbson-static-1.0${CMAKE_STATIC_LIBRARY_SUFFIX}" PATHS ${LIBBSON_STATIC_LIBRARY_DIRS}) - - if(NOT EOS_LIBBSONCXX OR NOT EOS_LIBMONGOCXX OR NOT EOS_LIBMONGOC OR NOT EOS_LIBBSONC) - message(FATAL_ERROR "Could not find one or more mongo driver static libraries") - endif() else() message("Could NOT find MongoDB. mongo_db_plugin with MongoDB support will not be included.") @@ -42,7 +31,9 @@ if(BUILD_MONGO_DB_PLUGIN) target_link_libraries(mongo_db_plugin PUBLIC chain_plugin eosio_chain appbase - ${EOS_LIBMONGOCXX} ${EOS_LIBBSONCXX} ${EOS_LIBMONGOC} ${EOS_LIBBSONC} resolv + ${LIBMONGOCXX_STATIC_LIBRARY_PATH} ${LIBBSONCXX_STATIC_LIBRARY_PATH} + ${MONGOC_STATIC_LIBRARY} ${BSON_STATIC_LIBRARY} + resolv ) else() From 29e0ead7dc0d4a5433cb9e308dfa2b838e546b4c Mon Sep 17 00:00:00 2001 From: Matt Witherspoon <32485495+spoonincode@users.noreply.github.com> Date: Fri, 26 Apr 2019 13:58:42 -0400 Subject: [PATCH 6/7] fix the incorrect check on $BUILD_CLANG8 --- scripts/eosio_build_amazon.sh | 2 +- scripts/eosio_build_centos.sh | 2 +- scripts/eosio_build_ubuntu.sh | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/scripts/eosio_build_amazon.sh b/scripts/eosio_build_amazon.sh index 141a3af592a..3131cbfc755 100755 --- a/scripts/eosio_build_amazon.sh +++ b/scripts/eosio_build_amazon.sh @@ -8,7 +8,7 @@ DISK_AVAIL_KB=$( df . | tail -1 | awk '{print $4}' ) DISK_TOTAL=$(( DISK_TOTAL_KB / 1048576 )) DISK_AVAIL=$(( DISK_AVAIL_KB / 1048576 )) -if [ $BUILD_CLANG8 ]; then +if [ "$BUILD_CLANG8" = "true" ]; then PINNED_TOOLCHAIN=-DCMAKE_TOOLCHAIN_FILE=$BUILD_DIR/pinned_toolchain.cmake fi diff --git a/scripts/eosio_build_centos.sh b/scripts/eosio_build_centos.sh index 2479e8df282..0c1f7ce86ad 100755 --- a/scripts/eosio_build_centos.sh +++ b/scripts/eosio_build_centos.sh @@ -25,7 +25,7 @@ printf "Disk space total: ${DISK_TOTAL%.*}G\\n" printf "Disk space available: ${DISK_AVAIL%.*}G\\n" printf "Concurrent Jobs (make -j): ${JOBS}\\n" -if [ $BUILD_CLANG8 ]; then +if [ "$BUILD_CLANG8" = "true" ]; then PINNED_TOOLCHAIN=-DCMAKE_TOOLCHAIN_FILE=$BUILD_DIR/pinned_toolchain.cmake fi diff --git a/scripts/eosio_build_ubuntu.sh b/scripts/eosio_build_ubuntu.sh index 489266d28d7..acb25a16f31 100755 --- a/scripts/eosio_build_ubuntu.sh +++ b/scripts/eosio_build_ubuntu.sh @@ -25,7 +25,7 @@ printf "Disk install: ${DISK_INSTALL}\\n" printf "Disk space total: ${DISK_TOTAL%.*}G\\n" printf "Disk space available: ${DISK_AVAIL%.*}G\\n" -if [ $BUILD_CLANG8 ]; then +if [ "$BUILD_CLANG8" = "true" ]; then PINNED_TOOLCHAIN=-DCMAKE_TOOLCHAIN_FILE=$BUILD_DIR/pinned_toolchain.cmake fi From f2208a97f1b4ac2d8773071a5ef5ce4a442ed80c Mon Sep 17 00:00:00 2001 From: Matt Witherspoon <32485495+spoonincode@users.noreply.github.com> Date: Fri, 26 Apr 2019 14:41:09 -0400 Subject: [PATCH 7/7] when building mongo cxx driver, point cmake toward built c driver --- scripts/eosio_build_amazon.sh | 2 +- scripts/eosio_build_centos.sh | 2 +- scripts/eosio_build_darwin.sh | 2 +- scripts/eosio_build_ubuntu.sh | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/scripts/eosio_build_amazon.sh b/scripts/eosio_build_amazon.sh index 3131cbfc755..71953c48b25 100755 --- a/scripts/eosio_build_amazon.sh +++ b/scripts/eosio_build_amazon.sh @@ -333,7 +333,7 @@ if [ $BUILD_MONGO ]; then && sed -i 's/"maxAwaitTimeMS", count/"maxAwaitTimeMS", static_cast(count)/' src/mongocxx/options/change_stream.cpp \ && sed -i 's/add_subdirectory(test)//' src/mongocxx/CMakeLists.txt src/bsoncxx/CMakeLists.txt \ && cd build \ - && $CMAKE -DBUILD_SHARED_LIBS=OFF -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=$PREFIX $PINNED_TOOLCHAIN .. \ + && $CMAKE -DBUILD_SHARED_LIBS=OFF -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=$PREFIX -DCMAKE_PREFIX_PATH=$PREFIX $PINNED_TOOLCHAIN .. \ && make -j"${JOBS}" VERBOSE=1 \ && make install \ && cd ../.. \ diff --git a/scripts/eosio_build_centos.sh b/scripts/eosio_build_centos.sh index 0c1f7ce86ad..b48b5ea45f4 100755 --- a/scripts/eosio_build_centos.sh +++ b/scripts/eosio_build_centos.sh @@ -392,7 +392,7 @@ if [ $BUILD_MONGO ]; then && sed -i 's/"maxAwaitTimeMS", count/"maxAwaitTimeMS", static_cast(count)/' src/mongocxx/options/change_stream.cpp \ && sed -i 's/add_subdirectory(test)//' src/mongocxx/CMakeLists.txt src/bsoncxx/CMakeLists.txt \ && cd build \ - && $CMAKE -DBUILD_SHARED_LIBS=OFF -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=$PREFIX $PINNED_TOOLCHAIN .. \ + && $CMAKE -DBUILD_SHARED_LIBS=OFF -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=$PREFIX -DCMAKE_PREFIX_PATH=$PREFIX $PINNED_TOOLCHAIN .. \ && make -j"${JOBS}" VERBOSE=1 \ && make install \ && cd ../.. \ diff --git a/scripts/eosio_build_darwin.sh b/scripts/eosio_build_darwin.sh index 8579a3f0370..b6ddf93236c 100755 --- a/scripts/eosio_build_darwin.sh +++ b/scripts/eosio_build_darwin.sh @@ -247,7 +247,7 @@ if [ $BUILD_MONGO ]; then && sed -i '' 's/"maxAwaitTimeMS", count/"maxAwaitTimeMS", static_cast(count)/' src/mongocxx/options/change_stream.cpp \ && sed -i '' 's/add_subdirectory(test)//' src/mongocxx/CMakeLists.txt src/bsoncxx/CMakeLists.txt \ && cd build \ - && $CMAKE -DBUILD_SHARED_LIBS=OFF -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=$PREFIX .. \ + && $CMAKE -DBUILD_SHARED_LIBS=OFF -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=$PREFIX -DCMAKE_PREFIX_PATH=$PREFIX .. \ && make -j"${JOBS}" VERBOSE=1 \ && make install \ && cd ../.. \ diff --git a/scripts/eosio_build_ubuntu.sh b/scripts/eosio_build_ubuntu.sh index acb25a16f31..66c1d1203cc 100755 --- a/scripts/eosio_build_ubuntu.sh +++ b/scripts/eosio_build_ubuntu.sh @@ -335,7 +335,7 @@ if [ $BUILD_MONGO ]; then && sed -i 's/"maxAwaitTimeMS", count/"maxAwaitTimeMS", static_cast(count)/' src/mongocxx/options/change_stream.cpp \ && sed -i 's/add_subdirectory(test)//' src/mongocxx/CMakeLists.txt src/bsoncxx/CMakeLists.txt \ && cd build \ - && $CMAKE -DBUILD_SHARED_LIBS=OFF -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=$PREFIX $PINNED_TOOLCHAIN .. \ + && $CMAKE -DBUILD_SHARED_LIBS=OFF -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=$PREFIX -DCMAKE_PREFIX_PATH=$PREFIX $PINNED_TOOLCHAIN .. \ && make -j"${JOBS}" VERBOSE=1 \ && make install \ && cd ../.. \