Changeset View
Changeset View
Standalone View
Standalone View
contrib/teamcity/build-configurations.sh
Show All 26 Lines | |||||
BUILD_DIR=$(cd "${BUILD_DIR}"; pwd) | BUILD_DIR=$(cd "${BUILD_DIR}"; pwd) | ||||
export BUILD_DIR | export BUILD_DIR | ||||
cd "${BUILD_DIR}" | cd "${BUILD_DIR}" | ||||
# Determine the number of build threads | # Determine the number of build threads | ||||
THREADS=$(nproc || sysctl -n hw.ncpu) | THREADS=$(nproc || sysctl -n hw.ncpu) | ||||
export THREADS | export THREADS | ||||
CI_SCRIPTS_DIR="${TOPLEVEL}/contrib/teamcity" | |||||
DEVTOOLS_DIR="${TOPLEVEL}/contrib/devtools" | DEVTOOLS_DIR="${TOPLEVEL}/contrib/devtools" | ||||
CMAKE_PLATFORMS_DIR="${TOPLEVEL}/cmake/platforms" | CMAKE_PLATFORMS_DIR="${TOPLEVEL}/cmake/platforms" | ||||
# Base directories for sanitizer related files | # Base directories for sanitizer related files | ||||
SAN_SUPP_DIR="${TOPLEVEL}/test/sanitizer_suppressions" | SAN_SUPP_DIR="${TOPLEVEL}/test/sanitizer_suppressions" | ||||
SAN_LOG_DIR="/tmp/sanitizer_logs" | SAN_LOG_DIR="/tmp/sanitizer_logs" | ||||
# Create the log directory if it doesn't exist and clear it | # Create the log directory if it doesn't exist and clear it | ||||
▲ Show 20 Lines • Show All 41 Lines • ▼ Show 20 Lines | |||||
build_with_cmake() { | build_with_cmake() { | ||||
CMAKE_FLAGS="${CMAKE_FLAGS[*]}" "${DEVTOOLS_DIR}"/build_cmake.sh "$@" | CMAKE_FLAGS="${CMAKE_FLAGS[*]}" "${DEVTOOLS_DIR}"/build_cmake.sh "$@" | ||||
} | } | ||||
build_with_autotools() { | build_with_autotools() { | ||||
CONFIGURE_FLAGS="${CONFIGURE_FLAGS[*]}" "${DEVTOOLS_DIR}"/build_autotools.sh "$@" | CONFIGURE_FLAGS="${CONFIGURE_FLAGS[*]}" "${DEVTOOLS_DIR}"/build_autotools.sh "$@" | ||||
} | } | ||||
run_ibd() { | |||||
"${TOPLEVEL}"/contrib/teamcity/ibd.sh "$@" | |||||
} | |||||
build_static_dependencies() { | |||||
"${DEVTOOLS_DIR}"/build_depends.sh | |||||
} | |||||
case "$ABC_BUILD_NAME" in | case "$ABC_BUILD_NAME" in | ||||
build-asan) | build-asan) | ||||
# Build with the address sanitizer, then run unit tests and functional tests. | # Build with the address sanitizer, then run unit tests and functional tests. | ||||
CMAKE_FLAGS=( | CMAKE_FLAGS=( | ||||
"-DCMAKE_CXX_FLAGS=-DARENA_DEBUG" | "-DCMAKE_CXX_FLAGS=-DARENA_DEBUG" | ||||
"-DCMAKE_BUILD_TYPE=Debug" | "-DCMAKE_BUILD_TYPE=Debug" | ||||
# ASAN does not support assembly code: https://github.com/google/sanitizers/issues/192 | # ASAN does not support assembly code: https://github.com/google/sanitizers/issues/192 | ||||
# This will trigger a segfault if the SSE4 implementation is selected for SHA256. | # This will trigger a segfault if the SSE4 implementation is selected for SHA256. | ||||
▲ Show 20 Lines • Show All 169 Lines • ▼ Show 20 Lines | build-without-zmq) | ||||
ninja check-functional | ninja check-functional | ||||
run_test_bitcoin "without zmq" | run_test_bitcoin "without zmq" | ||||
;; | ;; | ||||
build-ibd) | build-ibd) | ||||
build_with_cmake | build_with_cmake | ||||
"${CI_SCRIPTS_DIR}"/ibd.sh -disablewallet -debug=net | run_ibd -disablewallet -debug=net | ||||
;; | ;; | ||||
build-ibd-no-assumevalid-checkpoint) | build-ibd-no-assumevalid-checkpoint) | ||||
build_with_cmake | build_with_cmake | ||||
"${CI_SCRIPTS_DIR}"/ibd.sh -disablewallet -assumevalid=0 -checkpoints=0 -debug=net | run_ibd -disablewallet -assumevalid=0 -checkpoints=0 -debug=net | ||||
;; | ;; | ||||
build-clang-10) | build-clang-10) | ||||
# Use clang-10 for this build instead of the default clang-8. | # Use clang-10 for this build instead of the default clang-8. | ||||
# This allow for checking that no warning is introduced for newer versions | # This allow for checking that no warning is introduced for newer versions | ||||
# of the compiler | # of the compiler | ||||
CMAKE_FLAGS=( | CMAKE_FLAGS=( | ||||
"-DCMAKE_C_COMPILER=clang-10" | "-DCMAKE_C_COMPILER=clang-10" | ||||
▲ Show 20 Lines • Show All 73 Lines • ▼ Show 20 Lines | if [ $(wc -l < "${CLANG_TIDY_WARNING_FILE}") -gt 1 ]; then | ||||
echo "clang-tidy found issues !" | echo "clang-tidy found issues !" | ||||
cat "${CLANG_TIDY_WARNING_FILE}" | cat "${CLANG_TIDY_WARNING_FILE}" | ||||
exit 1 | exit 1 | ||||
fi | fi | ||||
popd | popd | ||||
;; | ;; | ||||
build-win64) | build-win64) | ||||
"${DEVTOOLS_DIR}"/build_depends.sh | build_static_dependencies | ||||
CMAKE_FLAGS=( | CMAKE_FLAGS=( | ||||
"-DCMAKE_TOOLCHAIN_FILE=${CMAKE_PLATFORMS_DIR}/Win64.cmake" | "-DCMAKE_TOOLCHAIN_FILE=${CMAKE_PLATFORMS_DIR}/Win64.cmake" | ||||
"-DBUILD_BITCOIN_SEEDER=OFF" | "-DBUILD_BITCOIN_SEEDER=OFF" | ||||
"-DCPACK_STRIP_FILES=ON" | "-DCPACK_STRIP_FILES=ON" | ||||
) | ) | ||||
build_with_cmake | build_with_cmake | ||||
# Build all the targets that are not built as part of the default target | # Build all the targets that are not built as part of the default target | ||||
Show All 14 Lines | build-win64) | ||||
# Run the tests. Not all will run with wine, so exclude them | # Run the tests. Not all will run with wine, so exclude them | ||||
find src -name "libbitcoinconsensus*.dll" -exec cp {} src/test/ \; | find src -name "libbitcoinconsensus*.dll" -exec cp {} src/test/ \; | ||||
wine ./src/test/test_bitcoin.exe --run_test=\!radix_tests,rcu_tests | wine ./src/test/test_bitcoin.exe --run_test=\!radix_tests,rcu_tests | ||||
;; | ;; | ||||
build-osx) | build-osx) | ||||
export PYTHONPATH="${TOPLEVEL}/depends/x86_64-apple-darwin16/native/lib/python3/dist-packages:${PYTHONPATH:-}" | export PYTHONPATH="${TOPLEVEL}/depends/x86_64-apple-darwin16/native/lib/python3/dist-packages:${PYTHONPATH:-}" | ||||
"${DEVTOOLS_DIR}"/build_depends.sh | build_static_dependencies | ||||
CMAKE_FLAGS=( | CMAKE_FLAGS=( | ||||
"-DCMAKE_TOOLCHAIN_FILE=${CMAKE_PLATFORMS_DIR}/OSX.cmake" | "-DCMAKE_TOOLCHAIN_FILE=${CMAKE_PLATFORMS_DIR}/OSX.cmake" | ||||
) | ) | ||||
build_with_cmake | build_with_cmake | ||||
# Build all the targets that are not built as part of the default target | # Build all the targets that are not built as part of the default target | ||||
ninja test_bitcoin test_bitcoin-qt test_bitcoin-seeder | ninja test_bitcoin test_bitcoin-qt test_bitcoin-seeder | ||||
ninja osx-dmg | ninja osx-dmg | ||||
;; | ;; | ||||
build-linux-arm) | build-linux-arm) | ||||
"${DEVTOOLS_DIR}"/build_depends.sh | build_static_dependencies | ||||
CMAKE_FLAGS=( | CMAKE_FLAGS=( | ||||
"-DCMAKE_TOOLCHAIN_FILE=${CMAKE_PLATFORMS_DIR}/LinuxARM.cmake" | "-DCMAKE_TOOLCHAIN_FILE=${CMAKE_PLATFORMS_DIR}/LinuxARM.cmake" | ||||
# This will prepend our executable commands with the given emulator call | # This will prepend our executable commands with the given emulator call | ||||
"-DCMAKE_CROSSCOMPILING_EMULATOR=$(command -v qemu-arm-static)" | "-DCMAKE_CROSSCOMPILING_EMULATOR=$(command -v qemu-arm-static)" | ||||
# The ZMQ functional test will fail with qemu (due to a qemu limitation), | # The ZMQ functional test will fail with qemu (due to a qemu limitation), | ||||
# so disable it to avoid the failure. | # so disable it to avoid the failure. | ||||
# Extracted from stderr: | # Extracted from stderr: | ||||
# Unknown host QEMU_IFLA type: 50 | # Unknown host QEMU_IFLA type: 50 | ||||
Show All 21 Lines | build-linux-arm) | ||||
ninja check | ninja check | ||||
ninja check-secp256k1 | ninja check-secp256k1 | ||||
# Functional tests | # Functional tests | ||||
ninja check-functional | ninja check-functional | ||||
;; | ;; | ||||
build-linux-aarch64) | build-linux-aarch64) | ||||
"${DEVTOOLS_DIR}"/build_depends.sh | build_static_dependencies | ||||
CMAKE_FLAGS=( | CMAKE_FLAGS=( | ||||
"-DCMAKE_TOOLCHAIN_FILE=${CMAKE_PLATFORMS_DIR}/LinuxAArch64.cmake" | "-DCMAKE_TOOLCHAIN_FILE=${CMAKE_PLATFORMS_DIR}/LinuxAArch64.cmake" | ||||
# This will prepend our executable commands with the given emulator call | # This will prepend our executable commands with the given emulator call | ||||
"-DCMAKE_CROSSCOMPILING_EMULATOR=$(command -v qemu-aarch64-static)" | "-DCMAKE_CROSSCOMPILING_EMULATOR=$(command -v qemu-aarch64-static)" | ||||
# The ZMQ functional test will fail with qemu (due to a qemu limitation), | # The ZMQ functional test will fail with qemu (due to a qemu limitation), | ||||
# so disable it to avoid the failure. | # so disable it to avoid the failure. | ||||
# Extracted from stderr: | # Extracted from stderr: | ||||
# Unknown host QEMU_IFLA type: 50 | # Unknown host QEMU_IFLA type: 50 | ||||
Show All 21 Lines | build-linux-aarch64) | ||||
ninja check | ninja check | ||||
ninja check-secp256k1 | ninja check-secp256k1 | ||||
# Functional tests | # Functional tests | ||||
ninja check-functional | ninja check-functional | ||||
;; | ;; | ||||
build-linux64) | build-linux64) | ||||
"${DEVTOOLS_DIR}"/build_depends.sh | build_static_dependencies | ||||
# Build, run unit tests and functional tests. | # Build, run unit tests and functional tests. | ||||
CMAKE_FLAGS=( | CMAKE_FLAGS=( | ||||
"-DCMAKE_TOOLCHAIN_FILE=${CMAKE_PLATFORMS_DIR}/Linux64.cmake" | "-DCMAKE_TOOLCHAIN_FILE=${CMAKE_PLATFORMS_DIR}/Linux64.cmake" | ||||
"-DENABLE_PROPERTY_BASED_TESTS=ON" | "-DENABLE_PROPERTY_BASED_TESTS=ON" | ||||
) | ) | ||||
build_with_cmake | build_with_cmake | ||||
Show All 28 Lines |