Skip to content

Commit bbf95c0

Browse files
committed
Merge bitcoin/bitcoin#30755: ci: Add missed configuration options to "Win64 native" job
ee22bf5 doc: Update and amend MSVC build guide (Hennadii Stepanov) c07fdd6 fuzz: Don't compile BDB-specific code on MSVC in `wallet_bdb_parser.cpp` (Hennadii Stepanov) e07a3ed 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 bitcoin/bitcoin#30740. ACKs for top commit: maflcko: review-only ACK ee22bf5 fanquake: ACK ee22bf5 Tree-SHA512: dbbfdf4347fbcda6ee24f7bd6041c383cfd9853fa717cfe0fbf2474cdd28435eba96da51c01684967c007b5346532c14fd923fcc3428efd607690a42175e39ad
2 parents 0e5cd60 + ee22bf5 commit bbf95c0

File tree

4 files changed

+23
-14
lines changed

4 files changed

+23
-14
lines changed

.github/workflows/ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -182,7 +182,7 @@ jobs:
182182

183183
- name: Generate build system
184184
run: |
185-
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
185+
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
186186
187187
- name: Save vcpkg binary cache
188188
uses: actions/cache/save@v4

CMakePresets.json

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,7 @@
1616
"cacheVariables": {
1717
"VCPKG_TARGET_TRIPLET": "x64-windows",
1818
"BUILD_GUI": "ON",
19-
"WITH_QRENCODE": "OFF",
20-
"WITH_NATPMP": "OFF"
19+
"WITH_QRENCODE": "OFF"
2120
}
2221
},
2322
{
@@ -34,8 +33,7 @@
3433
"cacheVariables": {
3534
"VCPKG_TARGET_TRIPLET": "x64-windows-static",
3635
"BUILD_GUI": "ON",
37-
"WITH_QRENCODE": "OFF",
38-
"WITH_NATPMP": "OFF"
36+
"WITH_QRENCODE": "OFF"
3937
}
4038
}
4139
]

doc/build-windows-msvc.md

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -42,27 +42,31 @@ Available presets can be listed as follows:
4242
cmake --list-presets
4343
```
4444

45+
By default, all presets:
46+
- Set `BUILD_GUI` to `ON`.
47+
- Set `WITH_QRENCODE` to `OFF`, due to known build issues when using vcpkg's `libqrencode` package.
48+
4549
## Building
4650

4751
CMake will put the resulting object files, libraries, and executables into a dedicated build directory.
4852

4953
In the following instructions, the "Debug" configuration can be specified instead of the "Release" one.
5054

51-
### 4. Building with Dynamic Linking with GUI
55+
### 4. Building with Static Linking with GUI
5256

5357
```
54-
cmake -B build --preset vs2022 -DBUILD_GUI=ON # It might take a while if the vcpkg binary cache is unpopulated or invalidated.
58+
cmake -B build --preset vs2022-static # It might take a while if the vcpkg binary cache is unpopulated or invalidated.
5559
cmake --build build --config Release # Use "-j N" for N parallel jobs.
5660
ctest --test-dir build --build-config Release # Use "-j N" for N parallel tests. Some tests are disabled if Python 3 is not available.
61+
cmake --install build --config Release # Optional.
5762
```
5863

59-
### 5. Building with Static Linking without GUI
64+
### 5. Building with Dynamic Linking without GUI
6065

6166
```
62-
cmake -B build --preset vs2022-static # It might take a while if the vcpkg binary cache is unpopulated or invalidated.
67+
cmake -B build --preset vs2022 -DBUILD_GUI=OFF # It might take a while if the vcpkg binary cache is unpopulated or invalidated.
6368
cmake --build build --config Release # Use "-j N" for N parallel jobs.
6469
ctest --test-dir build --build-config Release # Use "-j N" for N parallel tests. Some tests are disabled if Python 3 is not available.
65-
cmake --install build --config Release # Optional.
6670
```
6771

6872
## Performance Notes

src/wallet/test/fuzz/wallet_bdb_parser.cpp

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,13 @@
1818
#include <fstream>
1919
#include <iostream>
2020

21+
// There is an inconsistency in BDB on Windows.
22+
// See: https://github.com/bitcoin/bitcoin/pull/26606#issuecomment-2322763212
23+
#undef USE_BDB_NON_MSVC
24+
#if defined(USE_BDB) && !defined(_MSC_VER)
25+
#define USE_BDB_NON_MSVC
26+
#endif
27+
2128
using wallet::DatabaseOptions;
2229
using wallet::DatabaseStatus;
2330

@@ -50,15 +57,15 @@ FUZZ_TARGET(wallet_bdb_parser, .init = initialize_wallet_bdb_parser)
5057
}
5158
g_setup->m_args.ForceSetArg("-dumpfile", fs::PathToString(bdb_ro_dumpfile));
5259

53-
#ifdef USE_BDB
60+
#ifdef USE_BDB_NON_MSVC
5461
bool bdb_ro_err = false;
5562
bool bdb_ro_strict_err = false;
5663
#endif
5764
auto db{MakeBerkeleyRODatabase(wallet_path, options, status, error)};
5865
if (db) {
5966
assert(DumpWallet(g_setup->m_args, *db, error));
6067
} else {
61-
#ifdef USE_BDB
68+
#ifdef USE_BDB_NON_MSVC
6269
bdb_ro_err = true;
6370
#endif
6471
if (error.original.starts_with("AutoFile::ignore: end of file") ||
@@ -90,15 +97,15 @@ FUZZ_TARGET(wallet_bdb_parser, .init = initialize_wallet_bdb_parser)
9097
error.original == "Subdatabase has an unexpected name" ||
9198
error.original == "Unsupported BDB data file version number" ||
9299
error.original == "BDB builtin encryption is not supported") {
93-
#ifdef USE_BDB
100+
#ifdef USE_BDB_NON_MSVC
94101
bdb_ro_strict_err = true;
95102
#endif
96103
} else {
97104
throw std::runtime_error(error.original);
98105
}
99106
}
100107

101-
#ifdef USE_BDB
108+
#ifdef USE_BDB_NON_MSVC
102109
// Try opening with BDB
103110
fs::path bdb_dumpfile{g_setup->m_args.GetDataDirNet() / "fuzzed_dumpfile_bdb.dump"};
104111
if (fs::exists(bdb_dumpfile)) { // Writing into an existing dump file will throw an exception

0 commit comments

Comments
 (0)