diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 73ead66f217..fa4b04b5e63 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 a5f2ce79191..018906c66b6 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 1daca1f93e2..c894c26d839 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 6fbd695fc5e..5ec24faede6 100644 --- a/src/wallet/test/fuzz/wallet_bdb_parser.cpp +++ b/src/wallet/test/fuzz/wallet_bdb_parser.cpp @@ -18,6 +18,13 @@ #include #include +// 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