From fafce1a13a65cc3ae0cd5351648bb0290f9bfe8c Mon Sep 17 00:00:00 2001 From: MarcoFalke Date: Sun, 8 Nov 2020 11:54:38 +0100 Subject: ci: Move documentation to correct config file --- ci/test/00_setup_env_mac.sh | 1 + ci/test/00_setup_env_mac_host.sh | 1 - 2 files changed, 1 insertion(+), 1 deletion(-) diff --git a/ci/test/00_setup_env_mac.sh b/ci/test/00_setup_env_mac.sh index b62f1603f4..e4450a65ce 100644 --- a/ci/test/00_setup_env_mac.sh +++ b/ci/test/00_setup_env_mac.sh @@ -7,6 +7,7 @@ export LC_ALL=C.UTF-8 export CONTAINER_NAME=ci_macos_cross +export DOCKER_NAME_TAG=ubuntu:18.04 # Check that bionic can cross-compile to macos (bionic is used in the gitian build as well) export HOST=x86_64-apple-darwin16 export PACKAGES="cmake imagemagick libcap-dev librsvg2-bin libz-dev libbz2-dev libtiff-tools python3-dev python3-setuptools" export XCODE_VERSION=11.3.1 diff --git a/ci/test/00_setup_env_mac_host.sh b/ci/test/00_setup_env_mac_host.sh index 5fb127b762..45bf55ec57 100644 --- a/ci/test/00_setup_env_mac_host.sh +++ b/ci/test/00_setup_env_mac_host.sh @@ -7,7 +7,6 @@ export LC_ALL=C.UTF-8 export HOST=x86_64-apple-darwin16 -export DOCKER_NAME_TAG=ubuntu:18.04 # Check that bionic can cross-compile to macos (bionic is used in the gitian build as well) export PIP_PACKAGES="zmq" export GOAL="install" export BITCOIN_CONFIG="--with-gui --enable-reduce-exports --enable-werror --with-boost-process" -- cgit v1.2.3 From fa0795f54dc5268bacc6acdfdbe23f9952a0e7d8 Mon Sep 17 00:00:00 2001 From: MarcoFalke Date: Sun, 8 Nov 2020 11:28:24 +0100 Subject: ci: Replace TRAVIS_OS_NAME with CI_OS_NAME Also enable free disk space check unconditionally --- ci/test/00_setup_env_mac_host.sh | 1 + ci/test/04_install.sh | 8 ++++---- ci/test/05_before_script.sh | 2 +- 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/ci/test/00_setup_env_mac_host.sh b/ci/test/00_setup_env_mac_host.sh index 45bf55ec57..a2e3af887c 100644 --- a/ci/test/00_setup_env_mac_host.sh +++ b/ci/test/00_setup_env_mac_host.sh @@ -10,6 +10,7 @@ export HOST=x86_64-apple-darwin16 export PIP_PACKAGES="zmq" export GOAL="install" export BITCOIN_CONFIG="--with-gui --enable-reduce-exports --enable-werror --with-boost-process" +export CI_OS_NAME="macos" export NO_DEPENDS=1 export OSX_SDK="" export CCACHE_SIZE=300M diff --git a/ci/test/04_install.sh b/ci/test/04_install.sh index 632bccf574..b0f802186d 100755 --- a/ci/test/04_install.sh +++ b/ci/test/04_install.sh @@ -13,7 +13,7 @@ if [[ $QEMU_USER_CMD == qemu-s390* ]]; then export LC_ALL=C fi -if [ "$TRAVIS_OS_NAME" == "osx" ]; then +if [ "$CI_OS_NAME" == "macos" ]; then ${CI_RETRY_EXE} pip3 install $PIP_PACKAGES fi @@ -69,16 +69,16 @@ elif [ "$CI_USE_APT_INSTALL" != "no" ]; then ${CI_RETRY_EXE} DOCKER_EXEC apt-get install --no-install-recommends --no-upgrade -y $PACKAGES $DOCKER_PACKAGES fi -if [ "$TRAVIS_OS_NAME" == "osx" ]; then +if [ "$CI_OS_NAME" == "macos" ]; then top -l 1 -s 0 | awk ' /PhysMem/ {print}' echo "Number of CPUs: $(sysctl -n hw.logicalcpu)" else DOCKER_EXEC free -m -h DOCKER_EXEC echo "Number of CPUs \(nproc\):" \$\(nproc\) DOCKER_EXEC echo $(lscpu | grep Endian) - DOCKER_EXEC echo "Free disk space:" - DOCKER_EXEC df -h fi +DOCKER_EXEC echo "Free disk space:" +DOCKER_EXEC df -h if [ ! -d ${DIR_QA_ASSETS} ]; then DOCKER_EXEC git clone --depth=1 https://github.com/bitcoin-core/qa-assets ${DIR_QA_ASSETS} diff --git a/ci/test/05_before_script.sh b/ci/test/05_before_script.sh index 8ce839fc04..42c244c2f5 100755 --- a/ci/test/05_before_script.sh +++ b/ci/test/05_before_script.sh @@ -7,7 +7,7 @@ export LC_ALL=C.UTF-8 # Make sure default datadir does not exist and is never read by creating a dummy file -if [ "$TRAVIS_OS_NAME" == "osx" ]; then +if [ "$CI_OS_NAME" == "macos" ]; then echo > $HOME/Library/Application\ Support/Bitcoin else DOCKER_EXEC echo \> \$HOME/.bitcoin -- cgit v1.2.3 From fa8b1114e60100f503673ccc7ef5618851c0c9e3 Mon Sep 17 00:00:00 2001 From: MarcoFalke Date: Sun, 8 Nov 2020 09:20:11 +0100 Subject: ci: Run arm ci config on cirrus --- .cirrus.yml | 8 ++++++++ .travis.yml | 7 ------- 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/.cirrus.yml b/.cirrus.yml index 916f172a6a..1f21c50a62 100644 --- a/.cirrus.yml +++ b/.cirrus.yml @@ -53,6 +53,14 @@ global_task_template: &GLOBAL_TASK_TEMPLATE # install_script: # - choco install python --version=3.7.7 -y +task: + name: 'ARM [GOAL: install] [buster] [unit tests, no functional tests]' + << : *GLOBAL_TASK_TEMPLATE + container: + image: debian:buster + env: + FILE_ENV: "./ci/test/00_setup_env_arm.sh" + task: name: 'x86_64 Linux [GOAL: install] [bionic] [C++17, previous releases, uses qt5 dev package and some depends packages] [unsigned char]' << : *GLOBAL_TASK_TEMPLATE diff --git a/.travis.yml b/.travis.yml index 55b34ae422..a06e9a14ab 100644 --- a/.travis.yml +++ b/.travis.yml @@ -65,13 +65,6 @@ jobs: script: - set -o errexit; source ./ci/lint/06_script.sh - - stage: test - name: 'ARM [GOAL: install] [buster] [unit tests, no functional tests]' - arch: arm64 # Can disable QEMU_USER_CMD and run the tests natively without qemu - env: >- - FILE_ENV="./ci/test/00_setup_env_arm.sh" - QEMU_USER_CMD="" - - stage: test name: 'Win64 [GOAL: deploy] [unit tests, no gui, no boost::process, no functional tests]' env: >- -- cgit v1.2.3 From 3333d6942e8c5d823b97ea51ef88c8a0791742c6 Mon Sep 17 00:00:00 2001 From: MarcoFalke Date: Sun, 8 Nov 2020 09:48:29 +0100 Subject: ci: Run macos ci config on cirrus --- .cirrus.yml | 16 +++++++++++++++- .travis.yml | 21 --------------------- ci/test/00_setup_env_mac_host.sh | 4 ---- ci/test/04_install.sh | 2 +- 4 files changed, 16 insertions(+), 27 deletions(-) diff --git a/.cirrus.yml b/.cirrus.yml index 1f21c50a62..e00c1b7385 100644 --- a/.cirrus.yml +++ b/.cirrus.yml @@ -8,7 +8,7 @@ container: memory: 8G # Set to 8GB to avoid OOM. https://cirrus-ci.org/guide/linux/#linux-containers kvm: true # Use kvm to avoid spurious CI failures in the default virtualization cluster, see https://github.com/bitcoin/bitcoin/issues/20093 env: - PACKAGE_MANAGER_INSTALL : "apt-get update && apt-get install -y" + PACKAGE_MANAGER_INSTALL: "apt-get update && apt-get install -y" MAKEJOBS: "-j4" DANGER_RUN_CI_ON_HOST: "1" # Containers will be discarded after the run, so there is no risk that the ci scripts modify the system TEST_RUNNER_PORT_MIN: "14000" # Must be larger than 12321, which is used for the http cache. See https://cirrus-ci.org/guide/writing-tasks/#http-cache @@ -127,3 +127,17 @@ task: image: ubuntu:bionic env: FILE_ENV: "./ci/test/00_setup_env_mac.sh" + +task: + name: 'macOS 10.14 native [GOAL: install] [GUI] [no depends]' + macos_brew_addon_script: + - brew install boost libevent berkeley-db4 qt miniupnpc ccache zeromq qrencode sqlite libtool automake pkg-config gnu-getopt + << : *GLOBAL_TASK_TEMPLATE + osx_instance: + # Use latest image, but hardcode version to avoid silent upgrades (and breaks) + image: catalina-xcode-12.1 # https://cirrus-ci.org/guide/macOS + env: + DANGER_RUN_CI_ON_HOST: "true" + CI_USE_APT_INSTALL: "no" + PACKAGE_MANAGER_INSTALL: "echo" # Nothing to do + FILE_ENV: "./ci/test/00_setup_env_mac_host.sh" diff --git a/.travis.yml b/.travis.yml index a06e9a14ab..f1f695d2b4 100644 --- a/.travis.yml +++ b/.travis.yml @@ -79,24 +79,3 @@ jobs: name: 'x86_64 Linux [GOAL: install] [xenial] [no wallet]' env: >- FILE_ENV="./ci/test/00_setup_env_native_nowallet.sh" - - - stage: test - name: 'macOS 10.14 native [GOAL: install] [GUI] [no depends]' - os: osx - # Use the most recent version: - # Xcode 11.3.1, macOS 10.14, SDK 10.15 - # https://docs.travis-ci.com/user/reference/osx/#macos-version - osx_image: xcode11.3 - addons: - homebrew: - packages: - - berkeley-db4 - - miniupnpc - - qrencode - - sqlite - - ccache - - zeromq - env: >- - DANGER_RUN_CI_ON_HOST=true - CI_USE_APT_INSTALL=no - FILE_ENV="./ci/test/00_setup_env_mac_host.sh" diff --git a/ci/test/00_setup_env_mac_host.sh b/ci/test/00_setup_env_mac_host.sh index a2e3af887c..7c25a34cfe 100644 --- a/ci/test/00_setup_env_mac_host.sh +++ b/ci/test/00_setup_env_mac_host.sh @@ -16,7 +16,3 @@ export OSX_SDK="" export CCACHE_SIZE=300M export RUN_SECURITY_TESTS="true" -if [ "$TRAVIS_REPO_SLUG" != "bitcoin/bitcoin" ]; then - export RUN_FUNCTIONAL_TESTS="false" - export EXPECTED_TESTS_DURATION_IN_SECONDS=200 -fi diff --git a/ci/test/04_install.sh b/ci/test/04_install.sh index b0f802186d..ea3e7bcd4e 100755 --- a/ci/test/04_install.sh +++ b/ci/test/04_install.sh @@ -14,7 +14,7 @@ if [[ $QEMU_USER_CMD == qemu-s390* ]]; then fi if [ "$CI_OS_NAME" == "macos" ]; then - ${CI_RETRY_EXE} pip3 install $PIP_PACKAGES + IN_GETOPT_BIN="/usr/local/opt/gnu-getopt/bin/getopt" ${CI_RETRY_EXE} pip3 install --user $PIP_PACKAGES fi # Create folders that are mounted into the docker -- cgit v1.2.3 From 77777c8b5e3d0edbe1178d982a778b7cc9964b70 Mon Sep 17 00:00:00 2001 From: MarcoFalke Date: Mon, 9 Nov 2020 10:17:00 +0100 Subject: ci: Run windows ci config on cirrus --- .cirrus.yml | 8 ++++++++ .travis.yml | 5 ----- ci/test/00_setup_env_win64.sh | 2 +- ci/test/04_install.sh | 4 +--- ci/test/06_script_b.sh | 9 +++++++++ ci/test/wrap-wine.sh | 20 ++++++++++++++++++++ 6 files changed, 39 insertions(+), 9 deletions(-) create mode 100755 ci/test/wrap-wine.sh diff --git a/.cirrus.yml b/.cirrus.yml index e00c1b7385..6a496f00a3 100644 --- a/.cirrus.yml +++ b/.cirrus.yml @@ -61,6 +61,14 @@ task: env: FILE_ENV: "./ci/test/00_setup_env_arm.sh" +task: + name: 'Win64 [GOAL: deploy] [unit tests, no gui, no boost::process, no functional tests]' + << : *GLOBAL_TASK_TEMPLATE + container: + image: ubuntu:bionic + env: + FILE_ENV: "./ci/test/00_setup_env_win64.sh" + task: name: 'x86_64 Linux [GOAL: install] [bionic] [C++17, previous releases, uses qt5 dev package and some depends packages] [unsigned char]' << : *GLOBAL_TASK_TEMPLATE diff --git a/.travis.yml b/.travis.yml index f1f695d2b4..656eed9871 100644 --- a/.travis.yml +++ b/.travis.yml @@ -65,11 +65,6 @@ jobs: script: - set -o errexit; source ./ci/lint/06_script.sh - - stage: test - name: 'Win64 [GOAL: deploy] [unit tests, no gui, no boost::process, no functional tests]' - env: >- - FILE_ENV="./ci/test/00_setup_env_win64.sh" - - stage: test name: '32-bit + dash [GOAL: install] [CentOS 7] [gui]' env: >- diff --git a/ci/test/00_setup_env_win64.sh b/ci/test/00_setup_env_win64.sh index 2b351dff6d..72cc3f63c4 100644 --- a/ci/test/00_setup_env_win64.sh +++ b/ci/test/00_setup_env_win64.sh @@ -9,7 +9,7 @@ export LC_ALL=C.UTF-8 export CONTAINER_NAME=ci_win64 export DOCKER_NAME_TAG=ubuntu:18.04 # Check that bionic can cross-compile to win64 (bionic is used in the gitian build as well) export HOST=x86_64-w64-mingw32 -export PACKAGES="python3 nsis g++-mingw-w64-x86-64 wine-binfmt wine64" +export PACKAGES="python3 nsis g++-mingw-w64-x86-64 wine-binfmt wine64 file" export RUN_FUNCTIONAL_TESTS=false export RUN_SECURITY_TESTS="true" export GOAL="deploy" diff --git a/ci/test/04_install.sh b/ci/test/04_install.sh index ea3e7bcd4e..db74fe6569 100755 --- a/ci/test/04_install.sh +++ b/ci/test/04_install.sh @@ -26,9 +26,7 @@ export LSAN_OPTIONS="suppressions=${BASE_ROOT_DIR}/test/sanitizer_suppressions/l export TSAN_OPTIONS="suppressions=${BASE_ROOT_DIR}/test/sanitizer_suppressions/tsan:halt_on_error=1:log_path=${BASE_SCRATCH_DIR}/sanitizer-output/tsan" export UBSAN_OPTIONS="suppressions=${BASE_ROOT_DIR}/test/sanitizer_suppressions/ubsan:print_stacktrace=1:halt_on_error=1:report_error_type=1" env | grep -E '^(BITCOIN_CONFIG|BASE_|QEMU_|CCACHE_|LC_ALL|BOOST_TEST_RANDOM|DEBIAN_FRONTEND|CONFIG_SHELL|(ASAN|LSAN|TSAN|UBSAN)_OPTIONS|PREVIOUS_RELEASES_DIR)' | tee /tmp/env -if [[ $HOST = *-mingw32 ]]; then - DOCKER_ADMIN="--cap-add SYS_ADMIN" -elif [[ $BITCOIN_CONFIG = *--with-sanitizers=*address* ]]; then # If ran with (ASan + LSan), Docker needs access to ptrace (https://github.com/google/sanitizers/issues/764) +if [[ $BITCOIN_CONFIG = *--with-sanitizers=*address* ]]; then # If ran with (ASan + LSan), Docker needs access to ptrace (https://github.com/google/sanitizers/issues/764) DOCKER_ADMIN="--cap-add SYS_PTRACE" fi diff --git a/ci/test/06_script_b.sh b/ci/test/06_script_b.sh index 87e9f31d0f..7aea21f257 100755 --- a/ci/test/06_script_b.sh +++ b/ci/test/06_script_b.sh @@ -6,6 +6,15 @@ export LC_ALL=C.UTF-8 +if [[ $HOST = *-mingw32 ]]; then + BEGIN_FOLD wrap-wine + # Generate all binaries, so that they can be wrapped + DOCKER_EXEC make $MAKEJOBS -C src/secp256k1 VERBOSE=1 + DOCKER_EXEC make $MAKEJOBS -C src/univalue VERBOSE=1 + DOCKER_EXEC "${BASE_ROOT_DIR}/ci/test/wrap-wine.sh" + END_FOLD +fi + if [ -n "$QEMU_USER_CMD" ]; then BEGIN_FOLD wrap-qemu # Generate all binaries, so that they can be wrapped diff --git a/ci/test/wrap-wine.sh b/ci/test/wrap-wine.sh new file mode 100755 index 0000000000..58a8983e6e --- /dev/null +++ b/ci/test/wrap-wine.sh @@ -0,0 +1,20 @@ +#!/usr/bin/env bash +# +# Copyright (c) 2020 The Bitcoin Core developers +# Distributed under the MIT software license, see the accompanying +# file COPYING or http://www.opensource.org/licenses/mit-license.php. + +export LC_ALL=C.UTF-8 + +for b_name in {"${BASE_OUTDIR}/bin"/*,src/secp256k1/*tests,src/univalue/{no_nul,test_json,unitester,object}}.exe; do + # shellcheck disable=SC2044 + for b in $(find "${BASE_ROOT_DIR}" -executable -type f -name "$(basename $b_name)"); do + if (file "$b" | grep "Windows"); then + echo "Wrap $b ..." + mv "$b" "${b}_orig" + echo '#!/usr/bin/env bash' > "$b" + echo "wine64 \"${b}_orig\" \"\$@\"" >> "$b" + chmod +x "$b" + fi + done +done -- cgit v1.2.3