From 29592e600770b538ad9cbd134c6da5cddbb0a10b Mon Sep 17 00:00:00 2001 From: barton26 Date: Wed, 6 Apr 2022 16:21:59 -0400 Subject: [PATCH 1/2] ci: modify wrap_wine to use wine64 for 64bit binaries, change windows CI to Focal Co-Authored-By: div72 <60045611+div72@users.noreply.github.com> --- ci/test/00_setup_env_win32.sh | 2 +- ci/test/00_setup_env_win64.sh | 2 +- ci/test/wrap-wine.sh | 8 +++++++- 3 files changed, 9 insertions(+), 3 deletions(-) diff --git a/ci/test/00_setup_env_win32.sh b/ci/test/00_setup_env_win32.sh index 016b07d074..cd498100a8 100755 --- a/ci/test/00_setup_env_win32.sh +++ b/ci/test/00_setup_env_win32.sh @@ -7,7 +7,7 @@ export LC_ALL=C.UTF-8 export CONTAINER_NAME=ci_win32 -export DOCKER_NAME_TAG=ubuntu:18.04 # Check that bionic can cross-compile to win32 +export DOCKER_NAME_TAG=ubuntu:20.04 # Check that focal can cross-compile to win32 export HOST=i686-w64-mingw32 export PACKAGES="python3 nsis g++-mingw-w64-i686 wine-binfmt wine32" export RUN_UNIT_TESTS=true diff --git a/ci/test/00_setup_env_win64.sh b/ci/test/00_setup_env_win64.sh index a8db572aa8..b8f9f01f06 100755 --- a/ci/test/00_setup_env_win64.sh +++ b/ci/test/00_setup_env_win64.sh @@ -7,7 +7,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 +export DOCKER_NAME_TAG=ubuntu:20.04 # Check that focal can cross-compile to win64 export HOST=x86_64-w64-mingw32 export PACKAGES="python3 nsis g++-mingw-w64-x86-64 wine-binfmt wine64" export GOAL="" diff --git a/ci/test/wrap-wine.sh b/ci/test/wrap-wine.sh index e15147ca7d..6dfee98e13 100755 --- a/ci/test/wrap-wine.sh +++ b/ci/test/wrap-wine.sh @@ -6,14 +6,20 @@ export LC_ALL=C.UTF-8 +wine --version + 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 + SUFFIX= + if (file "$b" | grep "x86-64"); then + SUFFIX=64 + fi echo "Wrap $b ..." mv "$b" "${b}_orig" echo '#!/usr/bin/env bash' > "$b" - echo "wine \"${b}_orig\" \"\$@\"" >> "$b" + echo "wine${SUFFIX} \"${b}_orig\" \"\$@\"" >> "$b" chmod +x "$b" fi done From 162ed881a01c369ccfe4a80911bf173ddf5b3a4a Mon Sep 17 00:00:00 2001 From: barton26 Date: Thu, 7 Apr 2022 14:54:33 -0400 Subject: [PATCH 2/2] ci: use latest stable wine from WineHQ Co-Authored-By: div72 <60045611+div72@users.noreply.github.com> --- ci/test/00_setup_env_win32.sh | 2 +- ci/test/00_setup_env_win64.sh | 3 ++- ci/test/04_install.sh | 8 ++++++++ 3 files changed, 11 insertions(+), 2 deletions(-) diff --git a/ci/test/00_setup_env_win32.sh b/ci/test/00_setup_env_win32.sh index cd498100a8..449340fc58 100755 --- a/ci/test/00_setup_env_win32.sh +++ b/ci/test/00_setup_env_win32.sh @@ -9,7 +9,7 @@ export LC_ALL=C.UTF-8 export CONTAINER_NAME=ci_win32 export DOCKER_NAME_TAG=ubuntu:20.04 # Check that focal can cross-compile to win32 export HOST=i686-w64-mingw32 -export PACKAGES="python3 nsis g++-mingw-w64-i686 wine-binfmt wine32" +export PACKAGES="python3 nsis g++-mingw-w64-i686 wine-binfmt winehq-stable" export RUN_UNIT_TESTS=true export RUN_FUNCTIONAL_TESTS=false # export RUN_SECURITY_TESTS="true" diff --git a/ci/test/00_setup_env_win64.sh b/ci/test/00_setup_env_win64.sh index b8f9f01f06..ababe46e35 100755 --- a/ci/test/00_setup_env_win64.sh +++ b/ci/test/00_setup_env_win64.sh @@ -9,7 +9,8 @@ export LC_ALL=C.UTF-8 export CONTAINER_NAME=ci_win64 export DOCKER_NAME_TAG=ubuntu:20.04 # Check that focal can cross-compile to win64 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 wine-stable winehq-stable" +export DPKG_ADD_ARCH="i386" export GOAL="" export GRIDCOIN_CONFIG="--enable-reduce-exports --with-gui=qt5" export NEED_XVFB="true" diff --git a/ci/test/04_install.sh b/ci/test/04_install.sh index 5502ca545a..288f60a7d5 100755 --- a/ci/test/04_install.sh +++ b/ci/test/04_install.sh @@ -60,6 +60,14 @@ if [[ $DOCKER_NAME_TAG == centos* ]]; then END_FOLD elif [ "$CI_USE_APT_INSTALL" != "no" ]; then BEGIN_FOLD apt + if [[ $HOST = *-mingw32 ]]; then + # Ubuntu 20.04's wine has a weird issue where wine and wineserver disagrees on the + # temporary directory. This block fetches the latest wine from WineHQ instead. + ${CI_RETRY_EXE} DOCKER_EXEC apt-get update + ${CI_RETRY_EXE} DOCKER_EXEC apt-get install --no-install-recommends --no-upgrade -y ca-certificates gnupg curl + DOCKER_EXEC "curl -sS https://dl.winehq.org/wine-builds/winehq.key | apt-key add -" + DOCKER_EXEC "echo 'deb https://dl.winehq.org/wine-builds/ubuntu/ focal main' >> /etc/apt/sources.list" + fi ${CI_RETRY_EXE} DOCKER_EXEC apt-get update ${CI_RETRY_EXE} DOCKER_EXEC apt-get install --no-install-recommends --no-upgrade -y $PACKAGES $DOCKER_PACKAGES if [ "$NEED_XVFB" == "true" ]; then