diff --git a/contrib/teamcity/build-configurations.yml b/contrib/teamcity/build-configurations.yml index 5dbc8bf79..0564edbb5 100644 --- a/contrib/teamcity/build-configurations.yml +++ b/contrib/teamcity/build-configurations.yml @@ -1,388 +1,387 @@ --- # Templates can be referenced in builds to avoid duplication templates: common_unix_artifacts: artifacts: CMakeCache.txt: CMakeCache.txt src/bitcoind: bin/bitcoind src/bitcoin-*: bin src/qt/bitcoin-qt: bin/bitcoin-qt src/bench/bitcoin-bench: bin/bitcoin-bench src/seeder/bitcoin-seeder: bin/bitcoin-seeder src/libbitcoinconsensus.*: lib src/test/test_bitcoin: bin/test_bitcoin src/qt/test/test_bitcoin-qt: bin/test_bitcoin-qt src/seeder/test/test-seeder: bin/test-seeder test/tmp/test_runner_*: functional gitian_builds: script: gitian.sh timeout: 7200 artifacts: gitian-results: '' check+secp256k1: targets: - - all - install - install-secp256k1 - - check - check-secp256k1 - check-functional secp256k1: Werror: true targets: - - secp256k1 - install-secp256k1 - - check-secp256k1 # The build descriptions. # If a script is defined, then this will be the only step to run. # Otherwise a list of targets can be specified, grouped by parallel runs. # Example: # targets: # - - build11 # - build12 # - - build21 # - build22 # Will run: # ninja build11 build12 # ninja build21 build22 builds: build-asan: Werror: true clang: true cmake_flags: - '-DCMAKE_CXX_FLAGS=-DARENA_DEBUG' - '-DCMAKE_BUILD_TYPE=Debug' - '-DCRYPTO_USE_ASM=OFF' - '-DENABLE_SANITIZERS=address' templates: - check+secp256k1 timeout: 1800 env: ASAN_OPTIONS: log_path=stdout LSAN_OPTIONS: log_path=stdout build-bench: Werror: true cmake_flags: - '-DSECP256K1_ENABLE_MODULE_ECDH=ON' - '-DSECP256K1_ENABLE_MODULE_MULTISET=ON' targets: - - all - install-bitcoin-bench - install-secp256k1-bench - - bench-bitcoin - - bench-secp256k1 timeout: 1200 build-clang-10: runOnDiff: true Werror: true cmake_flags: - '-DCMAKE_C_COMPILER=clang-10' - '-DCMAKE_CXX_COMPILER=clang++-10' targets: - - all - install - install-secp256k1 - - check - check-secp256k1 timeout: 1200 build-clang-tidy: runOnDiff: true script: builds/build-clang-tidy.sh templates: - common_unix_artifacts timeout: 600 artifacts: clang-tidy-warnings.txt: clang-tidy-warnings.txt build-coverage: script: builds/build-coverage.sh templates: - common_unix_artifacts timeout: 4800 artifacts: coverage.tar.gz: coverage.tar.gz build-diff: runOnDiff: true Werror: true targets: - - all - install - install-secp256k1 - - check-all - check-upgrade-activated timeout: 1200 build-docs: - script: builds/build-docs.sh - templates: - - common_unix_artifacts + targets: + - - doc-rpc timeout: 600 artifacts: doc/*: doc build-ibd: script: builds/build-ibd.sh templates: - common_unix_artifacts timeout: 14400 artifacts: ibd/debug.log: log/debug.log build-ibd-no-assumevalid-checkpoint: script: builds/build-ibd-no-assumevalid-checkpoint.sh template: - common_unix_artifacts timeout: 21600 artifacts: ibd/debug.log: log/debug.log build-linux32: cross_build: static_depends: linux32 toolchain: Linux32 templates: - check+secp256k1 timeout: 3600 build-linux64: cross_build: static_depends: linux64 toolchain: Linux64 templates: - check+secp256k1 timeout: 3600 build-linux-aarch64: cross_build: static_depends: linux-aarch64 toolchain: LinuxAArch64 emulator: qemu-aarch64-static cmake_flags: # The ZMQ functional test will fail with qemu (due to a qemu limitation), # so disable it to avoid the failure. # Extracted from stderr: # Unknown host QEMU_IFLA type: 50 # Unknown host QEMU_IFLA type: 51 # Unknown QEMU_IFLA_BRPORT type 33 - "-DBUILD_BITCOIN_ZMQ=OFF" # This is an horrible hack to workaround a qemu bug: # https://bugs.launchpad.net/qemu/+bug/1748612 # Qemu emits a message for unsupported features called by the guest. # Because the output filtering is not working at all, it causes the # qemu stderr to end up in the node stderr and fail the functional # tests. # Disabling the unsupported feature (here bypassing the config # detection) fixes the issue. # FIXME: get rid of the hack, either by using a better qemu version # or by filtering stderr at the framework level. - "-DHAVE_DECL_GETIFADDRS=OFF" templates: - check+secp256k1 timeout: 3600 env: QEMU_LD_PREFIX: /usr/aarch64-linux-gnu build-linux-arm: cross_build: static_depends: linux-arm toolchain: LinuxARM emulator: qemu-arm-static cmake_flags: # The ZMQ functional test will fail with qemu (due to a qemu limitation), # so disable it to avoid the failure. # Extracted from stderr: # Unknown host QEMU_IFLA type: 50 # Unknown host QEMU_IFLA type: 51 # Unknown QEMU_IFLA_BRPORT type 33 - "-DBUILD_BITCOIN_ZMQ=OFF" # This is an horrible hack to workaround a qemu bug: # https://bugs.launchpad.net/qemu/+bug/1748612 # Qemu emits a message for unsupported features called by the guest. # Because the output filtering is not working at all, it causes the # qemu stderr to end up in the node stderr and fail the functional # tests. # Disabling the unsupported feature (here bypassing the config # detection) fixes the issue. # FIXME: get rid of the hack, either by using a better qemu version # or by filtering stderr at the framework level. - "-DHAVE_DECL_GETIFADDRS=OFF" templates: - check+secp256k1 timeout: 3600 env: QEMU_LD_PREFIX: /usr/arm-linux-gnueabihf build-make-generator: generator: name: 'Unix Makefiles' command: make flags: - '-k' templates: - check+secp256k1 timeout: 1200 build-master: Werror: true targets: - - all - install - install-secp256k1 - - check-extended - check-upgrade-activated-extended timeout: 4800 build-osx: cross_build: static_depends: osx toolchain: OSX targets: - - all - install - install-secp256k1 - install-tests - - osx-dmg timeout: 3600 artifacts: Bitcoin-ABC.dmg: Bitcoin-ABC.dmg build-secp256k1: cmake_flags: - '-DSECP256K1_ENABLE_MODULE_ECDH=ON' - '-DSECP256K1_ENABLE_MODULE_MULTISET=ON' templates: - secp256k1 timeout: 600 build-secp256k1-endomorphism: cmake_flags: - "-DSECP256K1_ENABLE_ENDOMORPHISM=ON" templates: - secp256k1 timeout: 600 build-secp256k1-java: cmake_flags: - '-DSECP256K1_ENABLE_MODULE_ECDH=ON' - '-DSECP256K1_ENABLE_JNI=ON' - '-DUSE_JEMALLOC=OFF' templates: - secp256k1 timeout: 600 build-tsan: Werror: true clang: true cmake_flags: - '-DENABLE_SANITIZERS=thread' targets: - - all - install - - check - check-functional timeout: 1800 env: TSAN_OPTIONS: log_path=stdout build-ubsan: Werror: true clang: true cmake_flags: - '-DCMAKE_BUILD_TYPE=Debug' - '-DENABLE_SANITIZERS=undefined' templates: - check+secp256k1 timeout: 1800 env: UBSAN_OPTIONS: log_path=stdout build-win64: script: builds/build-win64.sh timeout: 3600 artifacts: CMakeCache.txt: CMakeCache.txt src/bitcoind.exe: bin/bitcoind.exe src/bitcoin-*.exe: bin src/qt/bitcoin-qt.exe: bin/bitcoin-qt.exe src/bench/bitcoin-bench.exe: bin/bitcoin-bench.exe src/libbitcoinconsensus*: lib src/test/test_bitcoin.exe: bin/test_bitcoin.exe src/qt/test/test_bitcoin-qt.exe: bin/test_bitcoin-qt.exe src/qt/test/test_bitcoin-qt.log: log/qt/test_bitcoin-qt.log bitcoin-abc-*-x86_64-w64-mingw32.exe: bitcoin-abc-x86_64-w64-mingw32.exe build-without-cli: Werror: true cmake_flags: - '-DBUILD_BITCOIN_CLI=OFF' targets: - - all - install - - check-functional timeout: 1200 build-without-wallet: runOnDiff: true Werror: true cmake_flags: - '-DBUILD_BITCOIN_WALLET=OFF' targets: - - all - install - - check - check-functional timeout: 1200 build-without-zmq: Werror: true cmake_flags: - '-DBUILD_BITCOIN_ZMQ=OFF' targets: - - all - install - - check - check-functional timeout: 1800 check-buildbot: script: builds/check-buildbot.sh timeout: 600 check-seeds: script: builds/check-seeds.sh templates: - common_unix_artifacts timeout: 600 check-source-control-tools: cmake_flags: - '-DENABLE_SOURCE_CONTROL_TOOLS_TESTS=ON' targets: - - check-source-control-tools timeout: 600 gitian-linux: templates: - gitian_builds env: OS_NAME: linux gitian-osx: templates: - gitian_builds env: OS_NAME: osx gitian-win: templates: - gitian_builds env: OS_NAME: win diff --git a/contrib/teamcity/builds/build-docs.sh b/contrib/teamcity/builds/build-docs.sh deleted file mode 100755 index 4bcdae71a..000000000 --- a/contrib/teamcity/builds/build-docs.sh +++ /dev/null @@ -1,37 +0,0 @@ -#!/usr/bin/env bash - -export LC_ALL=C.UTF-8 - -set -euxo pipefail - -# shellcheck source=../ci-fixture.sh -source "${TOPLEVEL}/contrib/teamcity/ci-fixture.sh" - -# Build. This also generates doc/Doxyfile -build_with_cmake bitcoind bitcoin-cli - -./src/bitcoind -regtest & -BITCOIND_PID=$! -cleanup() { - kill "${BITCOIND_PID}" -} -trap "cleanup" EXIT - -echo "Waiting for bitcoind to spin up..." -READY="no" -for _ in {1..5}; do - if ./src/bitcoin-cli -regtest help > /dev/null ; then - READY="yes" - break - fi - sleep 1 - echo "." -done - -if [ "${READY}" != "yes" ]; then - echo "Error: bitcoind is not ready or was not started" - exit 1 -fi - -# Generate RPC documentation -ninja doc-rpc diff --git a/doc/rpc/CMakeLists.txt b/doc/rpc/CMakeLists.txt index 5d8cafccb..072dc3df4 100644 --- a/doc/rpc/CMakeLists.txt +++ b/doc/rpc/CMakeLists.txt @@ -1,13 +1,19 @@ # Copyright (c) 2020 The Bitcoin developers if(BUILD_BITCOIN_CLI) add_custom_target(doc-rpc COMMENT "Generating RPC documentation" - COMMAND go run "${CMAKE_CURRENT_SOURCE_DIR}/generate.go" -regtest + COMMAND + "${CMAKE_CURRENT_SOURCE_DIR}/gen-rpc-docs.sh" + "${CMAKE_CURRENT_SOURCE_DIR}/generate.go" + "$" + "$" WORKING_DIRECTORY "${CMAKE_BINARY_DIR}" - DEPENDS bitcoin-cli + DEPENDS + bitcoind + bitcoin-cli ) endif() # Add the doc/rpc directory to the list of file to cleanup. set_property(DIRECTORY "${CMAKE_SOURCE_DIR}" APPEND PROPERTY ADDITIONAL_CLEAN_FILES "${CMAKE_BINARY_DIR}/doc/rpc") diff --git a/doc/rpc/gen-rpc-docs.sh b/doc/rpc/gen-rpc-docs.sh new file mode 100755 index 000000000..b1f49417f --- /dev/null +++ b/doc/rpc/gen-rpc-docs.sh @@ -0,0 +1,51 @@ +#!/bin/sh + +export LC_ALL=C.UTF-8 + +set -eu + +if ! command -v go > /dev/null +then + echo "Generating the RPC documentation requires 'go' to be installed" + exit 1 +fi + +GENERATOR_SCRIPT="$1" +BITCOIND_COMMAND="$2" +BITCOIN_CLI_COMMAND="$3" + +BITCOIND_PID_FILE="_bitcoind.pid" +"${BITCOIND_COMMAND}" -regtest -daemon -pid="${BITCOIND_PID_FILE}" + +shutdown_bitcoind() { + "${BITCOIN_CLI_COMMAND}" -regtest stop > /dev/null 2>&1 + + # Waiting for bitcoind shut down + PID_WAIT_COUNT=0 + while [ -e "${BITCOIND_PID_FILE}" ] + do + : $((PID_WAIT_COUNT+=1)) + if [ "${PID_WAIT_COUNT}" -gt 20 ] + then + echo "Timed out waiting for bitcoind to stop" + exit 3 + fi + sleep 0.5 + done +} +trap "shutdown_bitcoind" EXIT + +# Waiting for bitcoind to spin up +RPC_HELP_WAIT_COUNT=0 +while ! "${BITCOIN_CLI_COMMAND}" -regtest help > /dev/null 2>&1 +do + : $((RPC_HELP_WAIT_COUNT+=1)) + if [ "${RPC_HELP_WAIT_COUNT}" -gt 10 ] + then + echo "Timed out waiting for bitcoind to start" + exit 2 + fi + sleep 0.5 +done + +go run "${GENERATOR_SCRIPT}" -regtest