From 77777c8b5e3d0edbe1178d982a778b7cc9964b70 Mon Sep 17 00:00:00 2001 From: MarcoFalke Date: Mon, 9 Nov 2020 10:17:00 +0100 Subject: [PATCH] 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 e00c1b7385d..6a496f00a34 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 f1f695d2b42..656eed9871a 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 2b351dff6d9..72cc3f63c44 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 ea3e7bcd4e9..db74fe6569f 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 87e9f31d0f4..7aea21f2576 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 00000000000..58a8983e6ec --- /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