6acec6b9ff02b91de132bb1575d75908a8a2d27b multiprocess: Add type conversion code for UniValue types (Ryan Ofsky) 0cc74fce72e0c79849109ee5d7afe707991b3512 multiprocess: Add type conversion code for serializable types (Ryan Ofsky) 4aaee239211a5287fbc361c0eb158b105ae8c8db test: add ipc test to test multiprocess type conversion code (Ryan Ofsky) Pull request description: Add type conversion hooks to allow `UniValue` objects, and objects that have `CDataStream` `Serialize` and `Unserialize` methods to be used as arguments and return values in Cap'nProto interface methods. Also add unit test to verify the hooks are working and data can be round-tripped correctly. The non-test code in this PR was previously part of #10102 and has been split off for easier review, but the test code is new. --- This PR is part of the [process separation project](https://github.com/bitcoin/bitcoin/issues/28722). ACKs for top commit: achow101: ACK 6acec6b9ff02b91de132bb1575d75908a8a2d27b dergoegge: reACK 6acec6b9ff02b91de132bb1575d75908a8a2d27b Tree-SHA512: 5d2cbc5215d488b876d34420adf91205dabf09b736183dcc85aa86255e3804c2bac5bab6792dacd585ef99a1d92cf29c8afb3eb65e4d953abc7ffe41994340c6
Building Bitcoin Core with Visual Studio
Introduction
Visual Studio 2022 is minimum required to build Bitcoin Core.
Solution and project files to build with msbuild
or Visual Studio can be found in the build_msvc
directory.
To build Bitcoin Core from the command-line, it is sufficient to only install the Visual Studio Build Tools component.
The "Desktop development with C++" workload must be installed as well.
Building with Visual Studio is an alternative to the Linux based cross-compiler build.
Prerequisites
To build dependencies (except for Qt), the default approach is to use the vcpkg package manager from Microsoft:
-
Install vcpkg.
-
By default, vcpkg makes both
release
anddebug
builds for each package. To save build time and disk space, one could skipdebug
builds (example uses PowerShell):
Add-Content -Path "vcpkg\triplets\x64-windows-static.cmake" -Value "set(VCPKG_BUILD_TYPE release)"
Qt
To build Bitcoin Core with the GUI, a static build of Qt is required.
- 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.11.zip
), and expand it into a dedicated folder. The following instructions assume that this folder isC:\dev\qt-source
.
💡 Tip: If you use the default path with "Extract All" for the Qt source code zip file, and end up with something like
C:\dev\qt-everywhere-opensource-src-5.15.11\qt-everywhere-src-5.15.11
, you are likely to encounter a "path too long" error when building. To fix the problem move the source files to a shorter path such as the recommendedC:\dev\qt-source
.
- Open "x64 Native Tools Command Prompt for VS 2022", and input the following commands:
cd C:\dev\qt-source
mkdir build
cd build
..\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 -prefix C:\Qt_static
nmake
nmake install
One could speed up building with jom
, a replacement for nmake
which makes use of all CPU cores.
To build Bitcoin Core without Qt, unload or disable the bitcoin-qt
, libbitcoin_qt
and test_bitcoin-qt
projects.
Building
- Use Python to generate
*.vcxproj
for the Visual Studio 2022 toolchain from Makefile:
python build_msvc\msvc-autogen.py
-
An optional step is to adjust the settings in the
build_msvc
directory and thecommon.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 theQTBASEDIR
environment variable. -
To build from the command-line with the Visual Studio toolchain use:
msbuild build_msvc\bitcoin.sln -property:Configuration=Release -maxCpuCount -verbosity:minimal
Alternatively, open the build_msvc/bitcoin.sln
file in Visual Studio.
Security
Base address randomization is used to make Bitcoin Core more secure. When building Bitcoin using the build_msvc
process base address randomization can be disabled by editing common.init.vcproj
to change RandomizedBaseAddress
from true
to false
and then rebuilding the project.
To check if bitcoind
has RandomizedBaseAddress
enabled or disabled run
.\dumpbin.exe /headers src/bitcoind.exe
If is it enabled then in the output Dynamic base
will be listed in the DLL characteristics
under OPTIONAL HEADER VALUES
as shown below
8160 DLL characteristics
High Entropy Virtual Addresses
Dynamic base
NX compatible
Terminal Server Aware
This may not disable all stack randomization as versions of windows employ additional stack randomization protections. These protections must be turned off in the OS configuration.