Merge bitcoin/bitcoin#30755: ci: Add missed configuration options to "Win64 native" job

ee22bf55e3 doc: Update and amend MSVC build guide (Hennadii Stepanov)
c07fdd6546 fuzz: Don't compile BDB-specific code on MSVC in `wallet_bdb_parser.cpp` (Hennadii Stepanov)
e07a3ede52 ci: Add missed configuration options to "Win64 native" job (Hennadii Stepanov)

Pull request description:

  Some build options were overlooked when the CMake staging branch dropped package autodetection.

  This PR restores them. Similar to https://github.com/bitcoin/bitcoin/pull/30740.

ACKs for top commit:
  maflcko:
    review-only ACK ee22bf55e3
  fanquake:
    ACK ee22bf55e3

Tree-SHA512: dbbfdf4347fbcda6ee24f7bd6041c383cfd9853fa717cfe0fbf2474cdd28435eba96da51c01684967c007b5346532c14fd923fcc3428efd607690a42175e39ad
This commit is contained in:
merge-script 2024-09-06 14:08:10 +01:00
commit bbf95c0cc5
No known key found for this signature in database
GPG key ID: 2EEB9F5CC09526C1
4 changed files with 27 additions and 18 deletions

View file

@ -182,7 +182,7 @@ jobs:
- name: Generate build system - name: Generate build system
run: | run: |
cmake -B build --preset vs2022-static -DCMAKE_TOOLCHAIN_FILE="$env:VCPKG_INSTALLATION_ROOT\scripts\buildsystems\vcpkg.cmake" -DBUILD_BENCH=ON -DBUILD_FUZZ_BINARY=ON -DWERROR=ON cmake -B build --preset vs2022-static -DCMAKE_TOOLCHAIN_FILE="$env:VCPKG_INSTALLATION_ROOT\scripts\buildsystems\vcpkg.cmake" -DBUILD_GUI=ON -DWITH_BDB=ON -DWITH_MINIUPNPC=ON -DWITH_ZMQ=ON -DBUILD_BENCH=ON -DBUILD_FUZZ_BINARY=ON -DWERROR=ON
- name: Save vcpkg binary cache - name: Save vcpkg binary cache
uses: actions/cache/save@v4 uses: actions/cache/save@v4

View file

@ -16,8 +16,7 @@
"cacheVariables": { "cacheVariables": {
"VCPKG_TARGET_TRIPLET": "x64-windows", "VCPKG_TARGET_TRIPLET": "x64-windows",
"BUILD_GUI": "ON", "BUILD_GUI": "ON",
"WITH_QRENCODE": "OFF", "WITH_QRENCODE": "OFF"
"WITH_NATPMP": "OFF"
} }
}, },
{ {
@ -34,8 +33,7 @@
"cacheVariables": { "cacheVariables": {
"VCPKG_TARGET_TRIPLET": "x64-windows-static", "VCPKG_TARGET_TRIPLET": "x64-windows-static",
"BUILD_GUI": "ON", "BUILD_GUI": "ON",
"WITH_QRENCODE": "OFF", "WITH_QRENCODE": "OFF"
"WITH_NATPMP": "OFF"
} }
} }
] ]

View file

@ -42,21 +42,17 @@ Available presets can be listed as follows:
cmake --list-presets cmake --list-presets
``` ```
By default, all presets:
- Set `BUILD_GUI` to `ON`.
- Set `WITH_QRENCODE` to `OFF`, due to known build issues when using vcpkg's `libqrencode` package.
## Building ## Building
CMake will put the resulting object files, libraries, and executables into a dedicated build directory. CMake will put the resulting object files, libraries, and executables into a dedicated build directory.
In the following instructions, the "Debug" configuration can be specified instead of the "Release" one. In the following instructions, the "Debug" configuration can be specified instead of the "Release" one.
### 4. Building with Dynamic Linking with GUI ### 4. Building with Static Linking with GUI
```
cmake -B build --preset vs2022 -DBUILD_GUI=ON # It might take a while if the vcpkg binary cache is unpopulated or invalidated.
cmake --build build --config Release # Use "-j N" for N parallel jobs.
ctest --test-dir build --build-config Release # Use "-j N" for N parallel tests. Some tests are disabled if Python 3 is not available.
```
### 5. Building with Static Linking without GUI
``` ```
cmake -B build --preset vs2022-static # It might take a while if the vcpkg binary cache is unpopulated or invalidated. cmake -B build --preset vs2022-static # It might take a while if the vcpkg binary cache is unpopulated or invalidated.
@ -65,6 +61,14 @@ ctest --test-dir build --build-config Release # Use "-j N" for N parallel tests
cmake --install build --config Release # Optional. cmake --install build --config Release # Optional.
``` ```
### 5. Building with Dynamic Linking without GUI
```
cmake -B build --preset vs2022 -DBUILD_GUI=OFF # It might take a while if the vcpkg binary cache is unpopulated or invalidated.
cmake --build build --config Release # Use "-j N" for N parallel jobs.
ctest --test-dir build --build-config Release # Use "-j N" for N parallel tests. Some tests are disabled if Python 3 is not available.
```
## Performance Notes ## Performance Notes
### 6. vcpkg Manifest Default Features ### 6. vcpkg Manifest Default Features

View file

@ -18,6 +18,13 @@
#include <fstream> #include <fstream>
#include <iostream> #include <iostream>
// There is an inconsistency in BDB on Windows.
// See: https://github.com/bitcoin/bitcoin/pull/26606#issuecomment-2322763212
#undef USE_BDB_NON_MSVC
#if defined(USE_BDB) && !defined(_MSC_VER)
#define USE_BDB_NON_MSVC
#endif
using wallet::DatabaseOptions; using wallet::DatabaseOptions;
using wallet::DatabaseStatus; using wallet::DatabaseStatus;
@ -50,7 +57,7 @@ FUZZ_TARGET(wallet_bdb_parser, .init = initialize_wallet_bdb_parser)
} }
g_setup->m_args.ForceSetArg("-dumpfile", fs::PathToString(bdb_ro_dumpfile)); g_setup->m_args.ForceSetArg("-dumpfile", fs::PathToString(bdb_ro_dumpfile));
#ifdef USE_BDB #ifdef USE_BDB_NON_MSVC
bool bdb_ro_err = false; bool bdb_ro_err = false;
bool bdb_ro_strict_err = false; bool bdb_ro_strict_err = false;
#endif #endif
@ -58,7 +65,7 @@ FUZZ_TARGET(wallet_bdb_parser, .init = initialize_wallet_bdb_parser)
if (db) { if (db) {
assert(DumpWallet(g_setup->m_args, *db, error)); assert(DumpWallet(g_setup->m_args, *db, error));
} else { } else {
#ifdef USE_BDB #ifdef USE_BDB_NON_MSVC
bdb_ro_err = true; bdb_ro_err = true;
#endif #endif
if (error.original.starts_with("AutoFile::ignore: end of file") || if (error.original.starts_with("AutoFile::ignore: end of file") ||
@ -90,7 +97,7 @@ FUZZ_TARGET(wallet_bdb_parser, .init = initialize_wallet_bdb_parser)
error.original == "Subdatabase has an unexpected name" || error.original == "Subdatabase has an unexpected name" ||
error.original == "Unsupported BDB data file version number" || error.original == "Unsupported BDB data file version number" ||
error.original == "BDB builtin encryption is not supported") { error.original == "BDB builtin encryption is not supported") {
#ifdef USE_BDB #ifdef USE_BDB_NON_MSVC
bdb_ro_strict_err = true; bdb_ro_strict_err = true;
#endif #endif
} else { } else {
@ -98,7 +105,7 @@ FUZZ_TARGET(wallet_bdb_parser, .init = initialize_wallet_bdb_parser)
} }
} }
#ifdef USE_BDB #ifdef USE_BDB_NON_MSVC
// Try opening with BDB // Try opening with BDB
fs::path bdb_dumpfile{g_setup->m_args.GetDataDirNet() / "fuzzed_dumpfile_bdb.dump"}; fs::path bdb_dumpfile{g_setup->m_args.GetDataDirNet() / "fuzzed_dumpfile_bdb.dump"};
if (fs::exists(bdb_dumpfile)) { // Writing into an existing dump file will throw an exception if (fs::exists(bdb_dumpfile)) { // Writing into an existing dump file will throw an exception