From 156bc89788034c509051e0635ed40694b8d717c6 Mon Sep 17 00:00:00 2001 From: Hennadii Stepanov <32963518+hebasto@users.noreply.github.com> Date: Thu, 23 Jun 2022 20:55:06 +0200 Subject: [PATCH 1/6] ci: Update Windows task image up to visualstudio2022 --- .cirrus.yml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/.cirrus.yml b/.cirrus.yml index 89438354418..60b5b33d37d 100644 --- a/.cirrus.yml +++ b/.cirrus.yml @@ -94,15 +94,15 @@ task: FILE_ENV: "./ci/test/00_setup_env_native_tidy.sh" task: - name: "Win64 native [msvc]" + name: "Win64 native [vs2022]" << : *FILTER_TEMPLATE windows_container: cpu: 4 memory: 8G - image: cirrusci/windowsservercore:visualstudio2019 + image: cirrusci/windowsservercore:visualstudio2022 timeout_in: 120m env: - PATH: 'C:\jom;C:\Python39;C:\Python39\Scripts;C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\MSBuild\Current\Bin;%PATH%' + PATH: 'C:\jom;C:\Python39;C:\Python39\Scripts;C:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\MSBuild\Current\Bin;%PATH%' PYTHONUTF8: 1 CI_VCPKG_TAG: '2022.04.12' VCPKG_DOWNLOADS: 'C:\Users\ContainerAdministrator\AppData\Local\vcpkg\downloads' @@ -113,7 +113,7 @@ task: QT_LOCAL_PATH: 'C:\qt-everywhere-opensource-src-5.15.3.zip' QT_SOURCE_DIR: 'C:\qt-everywhere-src-5.15.3' QTBASEDIR: 'C:\Qt_static' - x64_NATIVE_TOOLS: '"C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\VC\Auxiliary\Build\vcvars64.bat"' + x64_NATIVE_TOOLS: '"C:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\VC\Auxiliary\Build\vcvars64.bat"' QT_CONFIGURE_COMMAND: '..\configure -release -silent -opensource -confirm-license -opengl desktop -static -static-runtime -mp -qt-zlib -qt-pcre -qt-libpng -nomake examples -nomake tests -nomake tools -no-angle -no-dbus -no-gif -no-gtk -no-ico -no-icu -no-libjpeg -no-libudev -no-sql-sqlite -no-sql-odbc -no-sqlite -no-vulkan -skip qt3d -skip qtactiveqt -skip qtandroidextras -skip qtcharts -skip qtconnectivity -skip qtdatavis3d -skip qtdeclarative -skip doc -skip qtdoc -skip qtgamepad -skip qtgraphicaleffects -skip qtimageformats -skip qtlocation -skip qtlottie -skip qtmacextras -skip qtmultimedia -skip qtnetworkauth -skip qtpurchasing -skip qtquick3d -skip qtquickcontrols -skip qtquickcontrols2 -skip qtquicktimeline -skip qtremoteobjects -skip qtscript -skip qtscxml -skip qtsensors -skip qtserialbus -skip qtserialport -skip qtspeech -skip qtsvg -skip qtvirtualkeyboard -skip qtwayland -skip qtwebchannel -skip qtwebengine -skip qtwebglplugin -skip qtwebsockets -skip qtwebview -skip qtx11extras -skip qtxmlpatterns -no-openssl -no-feature-bearermanagement -no-feature-printdialog -no-feature-printer -no-feature-printpreviewdialog -no-feature-printpreviewwidget -no-feature-sql -no-feature-sqlmodel -no-feature-textbrowser -no-feature-textmarkdownwriter -no-feature-textodfwriter -no-feature-xml' IgnoreWarnIntDirInTempDetected: 'true' merge_script: @@ -180,7 +180,7 @@ task: - '%x64_NATIVE_TOOLS%' - cd %CIRRUS_WORKING_DIR% - ccache --zero-stats - - python build_msvc\msvc-autogen.py + - python build_msvc\msvc-autogen.py -toolset v143 - msbuild build_msvc\bitcoin.sln -property:CLToolExe=%WRAPPED_CL% -property:Configuration=Release -maxCpuCount -verbosity:minimal -noLogo - ccache --show-stats unit_tests_script: From b9a5a9b68c1be9cb3b38c79c6633d8c558f56b7b Mon Sep 17 00:00:00 2001 From: Hennadii Stepanov <32963518+hebasto@users.noreply.github.com> Date: Sat, 25 Jun 2022 12:36:04 +0200 Subject: [PATCH 2/6] ci: Limit ccache cache size properly on "Win64 native" task --- .cirrus.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.cirrus.yml b/.cirrus.yml index 60b5b33d37d..1b831d7fc47 100644 --- a/.cirrus.yml +++ b/.cirrus.yml @@ -179,7 +179,7 @@ task: build_script: - '%x64_NATIVE_TOOLS%' - cd %CIRRUS_WORKING_DIR% - - ccache --zero-stats + - ccache --zero-stats --max-size=%CCACHE_SIZE% - python build_msvc\msvc-autogen.py -toolset v143 - msbuild build_msvc\bitcoin.sln -property:CLToolExe=%WRAPPED_CL% -property:Configuration=Release -maxCpuCount -verbosity:minimal -noLogo - ccache --show-stats From a18c4c18714b8918c20242b8c674386bc3436cf8 Mon Sep 17 00:00:00 2001 From: Hennadii Stepanov <32963518+hebasto@users.noreply.github.com> Date: Sat, 25 Jun 2022 12:50:08 +0200 Subject: [PATCH 3/6] ci: Bump vcpkg to the latest version Dependency changes: - boost-* 1.78.0#0 -> 1.79.0#0 --- .cirrus.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.cirrus.yml b/.cirrus.yml index 1b831d7fc47..6d497a944dd 100644 --- a/.cirrus.yml +++ b/.cirrus.yml @@ -104,7 +104,7 @@ task: env: PATH: 'C:\jom;C:\Python39;C:\Python39\Scripts;C:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\MSBuild\Current\Bin;%PATH%' PYTHONUTF8: 1 - CI_VCPKG_TAG: '2022.04.12' + CI_VCPKG_TAG: '2022.06.16.1' VCPKG_DOWNLOADS: 'C:\Users\ContainerAdministrator\AppData\Local\vcpkg\downloads' VCPKG_DEFAULT_BINARY_CACHE: 'C:\Users\ContainerAdministrator\AppData\Local\vcpkg\archives' CCACHE_DIR: 'C:\Users\ContainerAdministrator\AppData\Local\ccache' From 849cf967a3bb69db9431e993e03b6dbb04a99d8b Mon Sep 17 00:00:00 2001 From: Hennadii Stepanov <32963518+hebasto@users.noreply.github.com> Date: Sat, 25 Jun 2022 13:19:27 +0200 Subject: [PATCH 4/6] ci: Increase CPU number for "Win64 native" task Currently, the time it takes to get the "Win64 native" task done with all of the caches been invalidated is very close to the 2 hours limit. This task is the only one which runs on Windows Community Cluster, therefore this change should not affect other CI tasks. --- .cirrus.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.cirrus.yml b/.cirrus.yml index 6d497a944dd..1b1e29ef17b 100644 --- a/.cirrus.yml +++ b/.cirrus.yml @@ -97,7 +97,7 @@ task: name: "Win64 native [vs2022]" << : *FILTER_TEMPLATE windows_container: - cpu: 4 + cpu: 6 memory: 8G image: cirrusci/windowsservercore:visualstudio2022 timeout_in: 120m From 460c6c724850f6bf1153000b060189332ebbdb35 Mon Sep 17 00:00:00 2001 From: Hennadii Stepanov <32963518+hebasto@users.noreply.github.com> Date: Sat, 25 Jun 2022 13:47:17 +0200 Subject: [PATCH 5/6] doc: Make Windows build docs match the CI task Added Visual Studio 2022. --- build_msvc/README.md | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/build_msvc/README.md b/build_msvc/README.md index 7feee6b7661..3a27fa2f5d2 100644 --- a/build_msvc/README.md +++ b/build_msvc/README.md @@ -3,7 +3,7 @@ Building Bitcoin Core with Visual Studio Introduction --------------------- -Solution and project files to build Bitcoin Core with `msbuild` or Visual Studio can be found in the `build_msvc` directory. The build has been tested with Visual Studio 2019 (building with earlier versions of Visual Studio should not be expected to work). +Solution and project files to build Bitcoin Core with `msbuild` or Visual Studio can be found in the `build_msvc` directory. The build has been tested with Visual Studio 2022 and Visual Studio 2019 (building with earlier versions of Visual Studio should not be expected to work). To build Bitcoin Core from the command-line, it is sufficient to only install the Visual Studio Build Tools component. @@ -30,7 +30,7 @@ To build Bitcoin Core with the GUI, a static build of Qt is required. 1. Download a single ZIP archive of Qt source code from https://download.qt.io/official_releases/qt/ (e.g., [`qt-everywhere-opensource-src-5.15.3.zip`](https://download.qt.io/official_releases/qt/5.15/5.15.3/single/qt-everywhere-opensource-src-5.15.3.zip)), and expand it into a dedicated folder. The following instructions assume that this folder is `C:\dev\qt-source`. -2. Open "x64 Native Tools Command Prompt for VS 2019", and input the following commands: +2. Open "x64 Native Tools Command Prompt for VS 2022", and input the following commands: ```cmd cd C:\dev\qt-source mkdir build @@ -47,21 +47,21 @@ To build Bitcoin Core without Qt, unload or disable the `bitcoin-qt`, `libbitcoi Building --------------------- -1. Use Python to generate `*.vcxproj` from Makefile: +1. Use Python to generate `*.vcxproj` for the Visual Studio 2022 toolchain from Makefile: -``` -PS >py -3 msvc-autogen.py +```cmd +python build_msvc\msvc-autogen.py -toolset v143 ``` 2. An optional step is to adjust the settings in the `build_msvc` directory and the `common.init.vcxproj` file. This project file contains settings that are common to all projects such as the runtime library version and target Windows SDK version. The Qt directories can also be set. To specify a non-default path to a static Qt package directory, use the `QTBASEDIR` environment variable. -3. To build from the command-line with the Visual Studio 2019 toolchain use: +3. To build from the command-line with the Visual Studio toolchain use: ```cmd -msbuild -property:Configuration=Release -maxCpuCount -verbosity:minimal bitcoin.sln +msbuild build_msvc\bitcoin.sln -property:Configuration=Release -maxCpuCount -verbosity:minimal ``` -Alternatively, open the `build_msvc/bitcoin.sln` file in Visual Studio 2019. +Alternatively, open the `build_msvc/bitcoin.sln` file in Visual Studio. Security --------------------- From 05b2d9fe076233961ebf24e74d47c57cc0618bbb Mon Sep 17 00:00:00 2001 From: Hennadii Stepanov <32963518+hebasto@users.noreply.github.com> Date: Sun, 26 Jun 2022 11:27:16 +0200 Subject: [PATCH 6/6] build: Bump default `PlatformToolset` for Visual Studio 2022 --- .cirrus.yml | 2 +- build_msvc/README.md | 2 +- build_msvc/msvc-autogen.py | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.cirrus.yml b/.cirrus.yml index 1b1e29ef17b..ed10ef54552 100644 --- a/.cirrus.yml +++ b/.cirrus.yml @@ -180,7 +180,7 @@ task: - '%x64_NATIVE_TOOLS%' - cd %CIRRUS_WORKING_DIR% - ccache --zero-stats --max-size=%CCACHE_SIZE% - - python build_msvc\msvc-autogen.py -toolset v143 + - python build_msvc\msvc-autogen.py - msbuild build_msvc\bitcoin.sln -property:CLToolExe=%WRAPPED_CL% -property:Configuration=Release -maxCpuCount -verbosity:minimal -noLogo - ccache --show-stats unit_tests_script: diff --git a/build_msvc/README.md b/build_msvc/README.md index 3a27fa2f5d2..d59942cb178 100644 --- a/build_msvc/README.md +++ b/build_msvc/README.md @@ -50,7 +50,7 @@ Building 1. Use Python to generate `*.vcxproj` for the Visual Studio 2022 toolchain from Makefile: ```cmd -python build_msvc\msvc-autogen.py -toolset v143 +python build_msvc\msvc-autogen.py ``` 2. An optional step is to adjust the settings in the `build_msvc` directory and the `common.init.vcxproj` file. This project file contains settings that are common to all projects such as the runtime library version and target Windows SDK version. The Qt directories can also be set. To specify a non-default path to a static Qt package directory, use the `QTBASEDIR` environment variable. diff --git a/build_msvc/msvc-autogen.py b/build_msvc/msvc-autogen.py index 819fe1b7aef..c4ea598aa0f 100755 --- a/build_msvc/msvc-autogen.py +++ b/build_msvc/msvc-autogen.py @@ -9,7 +9,7 @@ import argparse from shutil import copyfile SOURCE_DIR = os.path.abspath(os.path.join(os.path.dirname(__file__), '..', 'src')) -DEFAULT_PLATFORM_TOOLSET = R'v142' +DEFAULT_PLATFORM_TOOLSET = R'v143' libs = [ 'libbitcoin_cli', @@ -93,7 +93,7 @@ def set_properties(vcxproj_filename, placeholder, content): def main(): parser = argparse.ArgumentParser(description='Bitcoin-core msbuild configuration initialiser.') parser.add_argument('-toolset', nargs='?', default=DEFAULT_PLATFORM_TOOLSET, - help='Optionally sets the msbuild platform toolset, e.g. v142 for Visual Studio 2019.' + help='Optionally sets the msbuild platform toolset, e.g. v142 for Visual Studio 2019, or v143 for Visual Studio 2022.' ' default is %s.'%DEFAULT_PLATFORM_TOOLSET) args = parser.parse_args() set_properties(os.path.join(SOURCE_DIR, '../build_msvc/common.init.vcxproj'), '@TOOLSET@', args.toolset)