Commit Graph

225 Commits

Author SHA1 Message Date
fanquake
a106a86c46
Merge bitcoin/bitcoin#27696: build: Do not define ENABLE_ZMQ when ZMQ is not available
fa5831bd6f build: Do not define `ENABLE_ZMQ` when ZMQ is not available (Hennadii Stepanov)

Pull request description:

  A new behavior is consistent with the other optional dependencies.

  The source code contains `#if ENABLE_ZMQ` lines only:
  ```
  $ git grep ENABLE_ZMQ -- src/*.cpp
  src/init.cpp:#if ENABLE_ZMQ
  src/init.cpp:#if ENABLE_ZMQ
  src/init.cpp:#if ENABLE_ZMQ
  src/init.cpp:#if ENABLE_ZMQ
  src/init.cpp:#if ENABLE_ZMQ
  ```

  Change in description line -- "Define to 1..." -->  "Define this symbol.." -- is motivated by the fact that the actual value of the defined `ENABLE_ZMQ` macro does not matter at all.

  Related to:
  - https://github.com/bitcoin/bitcoin/issues/16419
  - https://github.com/bitcoin/bitcoin/pull/25302

ACKs for top commit:
  TheCharlatan:
    ACK fa5831bd6f
  jarolrod:
    ACK fa5831bd6f

Tree-SHA512: 5e72ff0d34c4b33205338daea0aae8d7aa0e48fd633e21af01af32b7ddb0532ef68dd3dd74deb2c1d2599691929617e8c09676bcbaaf7d669b88816f866f1db2
2023-05-22 10:00:15 +01:00
fanquake
fc4bee3f19
Merge bitcoin/bitcoin#27687: msvc: Provide ObjectFileName explicitly
b8ed95127b msvc: Provide `ObjectFileName` explicitly (Hennadii Stepanov)

Pull request description:

  This PR is a follow-up to https://github.com/bitcoin/bitcoin/pull/26715.

  Fixes intermittent MSVC link [errors](https://cirrus-ci.com/task/6646912535756800).

ACKs for top commit:
  sipsorcery:
    ACK b8ed95127b.

Tree-SHA512: 4319ecf61b578ce66d240998d089b9bb0a42f89dcfcb1a73f648cd3915f566c773721dcff1feba27d393a743d121334ccb890b1a519173e35a156d6135821ef4
2023-05-19 12:32:22 +01:00
fanquake
87d6f6c29d
Merge bitcoin/bitcoin#27615: msvc: Rename libbitcoinconsensus to libbitcoin_consensus and other adjustments
a94d75fa81 msvc: Do not define `HAVE_CONSENSUS_LIB` (Hennadii Stepanov)
cf6ff1031b msvc: Clean up `libbitcoin_consensus` source files (Hennadii Stepanov)
30aee016f1 scripted-diff: Rename `libbitcoinconsensus` to `libbitcoin_consensus` (Hennadii Stepanov)

Pull request description:

  The current Autotools-based build system operates with two build artifacts:
  - [`LIBBITCOIN_CONSENSUS`](3777c75d14/src/Makefile.am (L31)) which is [defined as](https://github.com/bitcoin/bitcoin/blob/master/doc/design/libraries.md) "Stable, backwards-compatible consensus functionality used by _libbitcoin_node_ and _libbitcoin_wallet_"
  - [`LIBBITCOINCONSENSUS`](3777c75d14/src/Makefile.am (L42)) which is [defined as](https://github.com/bitcoin/bitcoin/blob/master/doc/design/libraries.md) "Shared library build of static _libbitcoin_consensus_ library"

  The way how the `libbitcoinconsensus.vcxproj` project is used in the MSVC build system obviously shows that it is the former use case.

  This PR makes the related adjustments to the MSVC build system.

ACKs for top commit:
  sipsorcery:
    ACK a94d75fa81.

Tree-SHA512: 1144e13ee2b428ce14be8f76729744830c502a07814eb03e2aa6b8e009d8936fd13743e3f36ef3f31fac0e3979eb9af23e6a1364f151df49b3ae18dbd14cbf99
2023-05-18 11:34:34 +01:00
Hennadii Stepanov
fa5831bd6f
build: Do not define ENABLE_ZMQ when ZMQ is not available
A new behavior is consistent with the other optional dependencies.

The source code contains `#if ENABLE_ZMQ` lines only.
2023-05-18 10:48:48 +01:00
Hennadii Stepanov
b8ed95127b
msvc: Provide ObjectFileName explicitly
Should fix intermittent MSVC link errors.
2023-05-17 15:13:11 +01:00
fanquake
d02df7db6b
Merge bitcoin/bitcoin#26715: Introduce MockableDatabase for wallet unit tests
33e2b82a4f wallet, bench: Remove unused database options from WalletBenchLoading (Andrew Chow)
80ace042d8 tests: Modify records directly in wallet ckey loading test (Andrew Chow)
b3bb17d5d0 tests: Update DuplicateMockDatabase for MockableDatabase (Andrew Chow)
f0eecf5e40 scripted-diff: Replace CreateMockWalletDB with CreateMockableWalletDB (Andrew Chow)
075962bc25 wallet, tests: Include wallet/test/util.h (Andrew Chow)
14aa4cb1e4 wallet: Move DummyDatabase to salvage (Andrew Chow)
f67a385556 wallet, tests: Replace usage of dummy db with mockable db (Andrew Chow)
33c6245ac1 Introduce MockableDatabase for wallet unit tests (Andrew Chow)

Pull request description:

  For the wallet's unit tests, we currently use either `DummyDatabase` or memory-only versions of either BDB or SQLite. The tests that use `DummyDatabase` just need a `WalletDatabase` so that the `CWallet` can be constructed, while the tests using the memory-only databases just need a backing data store. There is also a `FailDatabase` that is similar to `DummyDatabase` except it fails be default or can have a configured return value. Having all of these different database types can make it difficult to write tests, particularly tests that work when either BDB or SQLite is disabled.

  This PR unifies all of these different unit test database classes into a single `MockableDatabase`. Like `DummyDatabase`, most functions do nothing and just return true. Like `FailDatabase`, the return value of some functions can be configured on the fly to test various failure cases. Like the memory-only databases, records can actually be written to the `MockableDatabase` and be retrieved later, but all of this is still held in memory. Using `MockableDatabase` completely removes the need for having BDB or SQLite backed wallets in the unit tests for the tests that are not actually testing specific database behaviors.

  Because `MockableDatabase`s can be created by each unit test, we can also control what records are stored in the database. Records can be added and removed externally from the typical database modification functions. This will give us greater ability to test failure conditions, particularly those involving corrupted records.

  Possible alternative to #26644

ACKs for top commit:
  furszy:
    ACK 33e2b82
  TheCharlatan:
    ACK 33e2b82a4f

Tree-SHA512: c2b09eff9728d063d2d4aea28a0f0e64e40b76483e75dc53f08667df23bd25834d52656cd4eafb02e552db0b9e619cfdb1b1c65b26b5436ee2c971d804768bcc
2023-05-15 11:39:43 +01:00
Hennadii Stepanov
a94d75fa81
msvc: Do not define HAVE_CONSENSUS_LIB
The `HAVE_CONSENSUS_LIB` symbol is supposed to be defined when a
user-exposed shared library (DLL) is built which is not the case here.
2023-05-10 11:26:51 +01:00
Hennadii Stepanov
cf6ff1031b
msvc: Clean up libbitcoin_consensus source files
See `libbitcoin_consensus_a_SOURCES` in the `src/Makefile.am`.
2023-05-10 11:26:44 +01:00
Hennadii Stepanov
30aee016f1
scripted-diff: Rename libbitcoinconsensus to libbitcoin_consensus
This build artifact is not a user-exposed shared library (DLL) but a
convenience static library.
See: https://github.com/bitcoin/bitcoin/blob/master/doc/design/libraries.md

-BEGIN VERIFY SCRIPT-
sed -i 's/libbitcoinconsensus/libbitcoin_consensus/g' $(git grep -l "libbitcoinconsensus" -- build_msvc)
git mv build_msvc/libbitcoinconsensus build_msvc/libbitcoin_consensus
git mv build_msvc/libbitcoin_consensus/libbitcoinconsensus.vcxproj build_msvc/libbitcoin_consensus/libbitcoin_consensus.vcxproj
-END VERIFY SCRIPT-
2023-05-10 11:26:35 +01:00
Hennadii Stepanov
d9b54c46cc
msvc: Cleanup after upgrading libsecp256k1 up to 0.3.0 2023-05-05 10:58:15 +01:00
Andrew Chow
075962bc25 wallet, tests: Include wallet/test/util.h
This will be needed for the following scripted-diff to work.
2023-05-03 10:45:10 -04:00
Andrew Chow
33c6245ac1 Introduce MockableDatabase for wallet unit tests
MockableDatabase is a WalletDatabase that allows us to interact with the
records to change them independently from the wallet, as well as
changing the return values from within the tests. This will give us
greater flexibility in testing the wallet.
2023-05-03 10:45:10 -04:00
Ethan Heilman
6a9a4d13b2 Fixes compile errors in MSVC build #27332
+ Pins the compatible version of libevent in vcpkg
2023-04-05 16:49:53 -04:00
fanquake
07c54de550
Merge bitcoin/bitcoin#26691: Update secp256k1 subtree to libsecp256k1 version 0.2.0
2022917223 Add secp256k1_selftest call (Pieter Wuille)
3bfca788b0 Remove explicit enabling of default modules (Pieter Wuille)
4462cb0498 Adapt to libsecp256k1 API changes (Pieter Wuille)
9d47e7b71b Squashed 'src/secp256k1/' changes from 44c2452fd3..21ffe4b22a (Pieter Wuille)

Pull request description:

  Now that libsecp256k1 has a release (https://lists.linuxfoundation.org/pipermail/bitcoin-dev/2022-December/021271.html), update the subtree to match it.

  The changes themselves are not very impactful for Bitcoin Core, but include:
  * It's no longer needed to specify whether contexts are for signing or verification or both (all contexts support everything), so make use of that in this PR.
  * Verification operations can use the static context now, removing the need for some infrastructure in pubkey.cpp to make sure a context exists.
  * Most modules are now enabled by default, so we can drop explicit enabling for them.
  * CI improvements (in particular, MSVC and more recent MacOS)
  * Introduction of an internal int128 type, which has no effect for GCC/Clang builds, but enables 128-bit multiplication in MSVC, giving a ~20% speedup there (but still slower than GCC/Clang).
  * Release process changes (process documentation, changelog, ...).

ACKs for top commit:
  Sjors:
    ACK 2022917223, but 4462cb0498 could use more eyes on it.
  achow101:
    ACK 2022917223
  jonasnick:
    utACK 2022917223

Tree-SHA512: 8a9fe28852abe74abd6f96fef16a94d5a427b1d99bff4caab1699014d24698aab9b966a5364a46ed1001c07a7c1d825154ed4e6557c7decce952b77330a8616b
2023-01-13 09:40:57 +00:00
Suriyaa Sundararuban
f84e445dee
doc: Correct linked Microsoft URLs 2022-12-31 16:54:13 +01:00
Hennadii Stepanov
306ccd4927
scripted-diff: Bump copyright headers
-BEGIN VERIFY SCRIPT-
./contrib/devtools/copyright_header.py update ./
-END VERIFY SCRIPT-

Commits of previous years:
- 2021: f47dda2c58
- 2020: fa0074e2d8
- 2019: aaaaad6ac9
2022-12-24 23:49:50 +00:00
Pieter Wuille
3bfca788b0 Remove explicit enabling of default modules 2022-12-13 15:08:26 -05:00
Hennadii Stepanov
f97892d21a
doc: Mention required workload when building with MSVC 2022-11-14 14:46:02 +00:00
fanquake
3a0b352c63
refactor: move url.h/cpp from lib util to lib common 2022-10-31 10:17:04 +00:00
Hennadii Stepanov
393be86724
build, msvc: Drop no longer required macro definitions for leveldb
Since levedb v1.21:
- the `__STDC_LIMIT_MACROS` macro definition is unneeded;
  commit: 50fbc87e8c62a816d6afd4740e0652a13ac6dc3e

- the `LEVELDB_ATOMIC_PRESENT` macro is unused;
  commit: 04f39105c5a418905da8b7657ca244d672c99d3b
2022-10-23 08:05:43 +01:00
MacroFake
fad7f2239c
test: Remove unused txmempool include from tests 2022-10-18 14:02:09 +02:00
Hennadii Stepanov
5c5b85d0e7
refactor: Make 64-bit shift explicit
Also this change enables MSVC warning C4334 for all codebase.

https://docs.microsoft.com/en-us/cpp/error-messages/compiler-warnings/compiler-warning-level-3-c4334
2022-10-04 21:49:07 +01:00
Hennadii Stepanov
f3e40c481a
build, msvc: Enable C4834 warning
https://docs.microsoft.com/en-us/cpp/error-messages/compiler-warnings/c4834
2022-10-04 12:03:26 +01:00
fanquake
73ae72e603
build: remove unused MSVC defines
Most of these aren't unused in the codebase at all, let alone for MSVC.
2022-09-23 16:30:24 +01:00
fanquake
55aad5f3a9
build: remove stdio.h from header checks
We already use a mix of <cstdio> and stdio.h unconditionally throughout
the codebase.

Us checking this header also duplicates work already done by autotools.
Currently stdio.h is checked for 3 times during a ./configure run, after
this change, at least it's only twice.
2022-09-21 16:53:18 +01:00
fanquake
eb6026b90f
build: remove strings.h from header checks
We don't include strings.h anywhere.

This is also already checked for by autoconf, so us checking for it just
means a 3rd existence check during ./configure.
2022-09-20 12:06:36 +01:00
fanquake
ced00f5a2e
fs: work around u8path deprecated-declaration warnings with libc++
When building in c++20 mode using libc++, the following warning is
emitted:
```bash
./fs.h:72:29: warning: 'u8path<std::string>' is deprecated [-Wdeprecated-declarations]
    return std::filesystem::u8path(utf8_str);
                            ^
/usr/lib/llvm-14/bin/../include/c++/v1/__filesystem/u8path.h:72:27: note: 'u8path<std::string>' has been explicitly marked deprecated here
_LIBCPP_INLINE_VISIBILITY _LIBCPP_DEPRECATED_WITH_CHAR8_T
                          ^
/usr/lib/llvm-14/bin/../include/c++/v1/__config:1042:43: note: expanded from macro '_LIBCPP_DEPRECATED_WITH_CHAR8_T'
                                          ^
/usr/lib/llvm-14/bin/../include/c++/v1/__config:1007:48: note: expanded from macro '_LIBCPP_DEPRECATED'
                                               ^
1 warning generated.
```

as u8path<std::string> is deprecated starting with c++20.

Fixes: #24682.

Co-authored-by: MacroFake <falke.marco@gmail.com>
Co-authored-by: Hennadii Stepanov <32963518+hebasto@users.noreply.github.com>
2022-08-19 08:58:56 +01:00
Hennadii Stepanov
9f9339c692
msvc: Drop _SILENCE_CXX17_OLD_ALLOCATOR_MEMBERS_DEPRECATION_WARNING
It is no longer needed.
2022-08-10 15:48:10 +01:00
Hennadii Stepanov
ecb617fefe
build: Bump Qt to 5.15.5 in depends 2022-07-30 15:44:20 +01:00
Hennadii Stepanov
88ec5d40dc
build: Increase MS Visual Studio minimum version
Visual Studio 2022 with `/std:c++20` supports designated initializers.
2022-07-07 19:59:48 +01:00
Hennadii Stepanov
1d1546e4c2
build: Clean up build_msvc/libsecp256k1_config.h
Unused since bitcoin/bitcoin#19944:
- `USE_FIELD_10X26`
- `USE_FIELD_5X52`
- `USE_SCALAR_4X64`
- `USE_SCALAR_8X32`

Unused since bitcoin/bitcoin#20147:
- `USE_ENDOMORPHISM`

Unused since bitcoin/bitcoin#21573:
- `USE_FIELD_INV_BUILTIN`
- `USE_FIELD_INV_NUM`
- `USE_NUM_GMP`
- `USE_NUM_NONE`
- `USE_SCALAR_INV_BUILTIN`
- `USE_SCALAR_INV_NUM`
2022-06-28 23:48:49 +02:00
Hennadii Stepanov
05b2d9fe07
build: Bump default PlatformToolset for Visual Studio 2022 2022-06-26 11:29:36 +02:00
Hennadii Stepanov
460c6c7248
doc: Make Windows build docs match the CI task
Added Visual Studio 2022.
2022-06-26 11:24:00 +02:00
Hennadii Stepanov
a50e0b1bcb
qt, refactor: Add transactionoverviewwidget.cpp source file
Required for better/simpler interaction with CMake AUTOMOC.
2022-06-14 16:55:22 +02:00
MarcoFalke
fa72e0ba15
Use designated initializers 2022-06-01 20:06:01 +02:00
Hennadii Stepanov
b2c3d1086b
Revert "build: Specify zeromq port explicitly for MSVC builds"
This reverts commit 20b6c87117.
2022-04-13 23:26:23 +02:00
dhruv
d960d4fd3a
build: fix MSVC build after subtree update
Co-authored-by: Hennadii Stepanov <32963518+hebasto@users.noreply.github.com>
Co-authored-by: Aaron Clauson <aaron@sipsorcery.com>
2022-04-07 22:24:43 +01:00
Hennadii Stepanov
ba0bf79a22
build: Do not modify common.init.vcxproj directly 2022-04-05 19:06:03 +02:00
Hennadii Stepanov
2391fb7850
build, refactor: Add set_properties() to msvc-autogen.py 2022-04-05 18:38:22 +02:00
Pavol Rusnak
ef20add4c9
build, qt: bump Qt5 version to 5.15.3
Qt 5.15.3 release is a patch release made on the top of Qt 5.15.2. As a patch
release, Qt 5.15.3 does not add any new functionality but provides bug fixes
and other improvements.

https://code.qt.io/cgit/qt/qtreleasenotes.git/about/qt/5.15.3/release-note.md

* dropped patches:
  - patches/qt/dont_use_avx_android_x86_64.patch
  - patches/qt/fix_bigsur_style.patch
* adjusted patches:
  - patches/qt/fix_android_jni_static.patch
  - patches/qt/fix_limits_header.patch
  - patches/qt/use_android_ndk23.patch

Co-authored-by: Hennadii Stepanov <32963518+hebasto@users.noreply.github.com>
2022-04-01 16:54:38 +02:00
fanquake
d4ba2b2cbc
compat: remove strnlen back-compat code
This was needed for mingw (not mingw-w64), and some older versions of
macOS, which we no-longer support.
2022-03-29 10:15:33 +01:00
Hennadii Stepanov
c3296b21e4
build: Drop double-conversion from MSVC dependencies
Qt uses its own `double-conversion`.
2022-03-10 08:36:13 +01:00
Hennadii Stepanov
20b6c87117
build: Specify zeromq port explicitly for MSVC builds
Current port 4 is broken:
- https://github.com/microsoft/vcpkg/pull/22681#issuecomment-1061312320
2022-03-10 08:36:05 +01:00
Ryan Ofsky
84b0973e35 test: Add tests for GetArg methods / settings.json type coercion
Just add tests. No changes to application behavior. Tests will be
updated in the next commit changing & improving current behavior.

Include a Qt test for GUI startup crash reported by Rspigler in
https://github.com/bitcoin/bitcoin/issues/24457 caused by GetArg
behavior that happens if settings.json contains an integer value for any
of the configuration options which GUI settings can currently clash with
(-dbcache, -par, -spendzeroconfchange, -signer, -upnp, -natpmp, -listen,
-server, -proxy, -proxy, -onion, -onion, -lang, and -prune).
2022-03-07 13:29:46 -05:00
fanquake
39e66e938f
build: use header-only Boost unit test 2022-02-13 20:59:02 +00:00
Hennadii Stepanov
d570f26e17
Add bitcoin_config.h to build_msvc/.gitignore
bitcoin_config.h is auto-generated by the msvc-autogen.py script.
2022-02-05 12:48:21 +02:00
fanquake
07269321f3
build: remove Boost::system usage 2022-02-03 18:35:52 +08:00
Kiminuo
b87f9c5edf
build: remove boost::filesystem usage 2022-02-03 18:35:52 +08:00
MarcoFalke
ddcc518cbd
Merge bitcoin/bitcoin#23828: scripted-diff: Rename libbitcoin_server.a to libbitcoin_node.a
172096e9dd scripted-diff: Rename libbitcoin_server.a to libbitcoin_node.a (Russell Yanofsky)

Pull request description:

  Goal along with namespacing PR #23497 is to make code organization more obvious and have `src/node/` code in `node::` namespace in `libbitcoin_node.a` library

ACKs for top commit:
  MarcoFalke:
    cr ACK 172096e9dd

Tree-SHA512: a2e787eeaa3ab769b0f5376473072cae584d237aa8b67b677bea833bb36b0134a0eca17eb01722389639473b8463f4953bc3a5e4801a6b2c8965ac1075cba005
2022-01-06 14:59:17 +01:00
Hennadii Stepanov
f47dda2c58
scripted-diff: Bump copyright headers
-BEGIN VERIFY SCRIPT-
./contrib/devtools/copyright_header.py update ./
-END VERIFY SCRIPT-

Commits of previous years:
* 2020: fa0074e2d8
* 2019: aaaaad6ac9
2021-12-30 19:36:57 +02:00