aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormerge-script <fanquake@gmail.com>2024-09-06 14:08:10 +0100
committermerge-script <fanquake@gmail.com>2024-09-06 14:08:10 +0100
commitbbf95c0cc57147827b9f4577c641b12dd4170e78 (patch)
tree4dc25642cd240efe802c4f54fd769d6581346d8d
parent0e5cd608da5d8c3d9c758dbfa3fc36df4af4a100 (diff)
parentee22bf55e39e4a40c31465e8ef2663eb7fefc783 (diff)
Merge bitcoin/bitcoin#30755: ci: Add missed configuration options to "Win64 native" job
ee22bf55e39e4a40c31465e8ef2663eb7fefc783 doc: Update and amend MSVC build guide (Hennadii Stepanov) c07fdd654616e384ad4e686d75b3a979c1921d27 fuzz: Don't compile BDB-specific code on MSVC in `wallet_bdb_parser.cpp` (Hennadii Stepanov) e07a3ede52dfefe1a5977d51f2454f59616b1409 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 ee22bf55e39e4a40c31465e8ef2663eb7fefc783 fanquake: ACK ee22bf55e39e4a40c31465e8ef2663eb7fefc783 Tree-SHA512: dbbfdf4347fbcda6ee24f7bd6041c383cfd9853fa717cfe0fbf2474cdd28435eba96da51c01684967c007b5346532c14fd923fcc3428efd607690a42175e39ad
-rw-r--r--.github/workflows/ci.yml2
-rw-r--r--CMakePresets.json6
-rw-r--r--doc/build-windows-msvc.md14
-rw-r--r--src/wallet/test/fuzz/wallet_bdb_parser.cpp15
4 files changed, 23 insertions, 14 deletions
diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
index 73ead66f21..fa4b04b5e6 100644
--- a/.github/workflows/ci.yml
+++ b/.github/workflows/ci.yml
@@ -182,7 +182,7 @@ jobs:
- name: Generate build system
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
uses: actions/cache/save@v4
diff --git a/CMakePresets.json b/CMakePresets.json
index a5f2ce7919..018906c66b 100644
--- a/CMakePresets.json
+++ b/CMakePresets.json
@@ -16,8 +16,7 @@
"cacheVariables": {
"VCPKG_TARGET_TRIPLET": "x64-windows",
"BUILD_GUI": "ON",
- "WITH_QRENCODE": "OFF",
- "WITH_NATPMP": "OFF"
+ "WITH_QRENCODE": "OFF"
}
},
{
@@ -34,8 +33,7 @@
"cacheVariables": {
"VCPKG_TARGET_TRIPLET": "x64-windows-static",
"BUILD_GUI": "ON",
- "WITH_QRENCODE": "OFF",
- "WITH_NATPMP": "OFF"
+ "WITH_QRENCODE": "OFF"
}
}
]
diff --git a/doc/build-windows-msvc.md b/doc/build-windows-msvc.md
index 1daca1f93e..c894c26d83 100644
--- a/doc/build-windows-msvc.md
+++ b/doc/build-windows-msvc.md
@@ -42,27 +42,31 @@ Available presets can be listed as follows:
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
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.
-### 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 -B build --preset vs2022-static # 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.
+cmake --install build --config Release # Optional.
```
-### 5. Building with Static Linking without GUI
+### 5. Building with Dynamic 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 -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.
-cmake --install build --config Release # Optional.
```
## Performance Notes
diff --git a/src/wallet/test/fuzz/wallet_bdb_parser.cpp b/src/wallet/test/fuzz/wallet_bdb_parser.cpp
index 6fbd695fc5..5ec24faede 100644
--- a/src/wallet/test/fuzz/wallet_bdb_parser.cpp
+++ b/src/wallet/test/fuzz/wallet_bdb_parser.cpp
@@ -18,6 +18,13 @@
#include <fstream>
#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::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));
-#ifdef USE_BDB
+#ifdef USE_BDB_NON_MSVC
bool bdb_ro_err = false;
bool bdb_ro_strict_err = false;
#endif
@@ -58,7 +65,7 @@ FUZZ_TARGET(wallet_bdb_parser, .init = initialize_wallet_bdb_parser)
if (db) {
assert(DumpWallet(g_setup->m_args, *db, error));
} else {
-#ifdef USE_BDB
+#ifdef USE_BDB_NON_MSVC
bdb_ro_err = true;
#endif
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 == "Unsupported BDB data file version number" ||
error.original == "BDB builtin encryption is not supported") {
-#ifdef USE_BDB
+#ifdef USE_BDB_NON_MSVC
bdb_ro_strict_err = true;
#endif
} 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
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