Commit Graph

57 Commits

Author SHA1 Message Date
merge-script
dc97e7f6db
Merge bitcoin/bitcoin#30903: cmake: Add FindZeroMQ module
915640e191 depends: zeromq: don't install .pc files and remove patches for them (Cory Fields)
6b8a74463b cmake: Add `FindZeroMQ` module (Hennadii Stepanov)

Pull request description:

  This PR introduces the `FindZeroMQ` module, which first attempts to find the `libzmq` library using CMake's `find_package()` and falls back to `pkg_check_modules()` if unsuccessful.

  Addresses https://github.com/bitcoin/bitcoin/issues/30876 for the ZeroMQ package.

ACKs for top commit:
  fanquake:
    ACK 915640e191

Tree-SHA512: 2f17bae21be5d3f280a13425d22f5d1b2e23837a8aaf5ec89c433767509de030a42d598b261e102bdb5b860d8ede98013c124c3d25e081e956d4ee3a81b2584f
2024-10-29 16:21:07 +00:00
Hennadii Stepanov
70713303b6
scripted-diff: Rename PACKAGE_* variables to CLIENT_*
This change ensures consistent use of the `CLIENT_` namespace everywhere
in the repository.

-BEGIN VERIFY SCRIPT-

ren() { sed -i "s/\<$1\>/$2/g" $( git grep -l "$1" ./cmake ./src :\(exclude\)./src/secp256k1 ./test ) ; }

ren PACKAGE_NAME      CLIENT_NAME
ren PACKAGE_VERSION   CLIENT_VERSION_STRING
ren PACKAGE_URL       CLIENT_URL
ren PACKAGE_BUGREPORT CLIENT_BUGREPORT

-END VERIFY SCRIPT-
2024-10-28 12:36:19 +00:00
Hennadii Stepanov
332655cb52
build: Rename PACKAGE_* variables to CLIENT_*
The use of `PACKAGE_NAME` for the project's variable name is
problematic, as this name is commonly used in CMake's interface
variables. If third-party CMake code handles with scopes improperly,
our `PACKAGE_NAME` variable could end up with an unexpected value.

This change avoids such conflicts by renaming all `PACKAGE_*` variables
to `CLIENT_*`.
2024-10-28 12:35:55 +00:00
Hennadii Stepanov
6b8a74463b
cmake: Add FindZeroMQ module 2024-10-25 18:09:36 +01:00
Antoine Poinsot
a9598e5eaa
build: drop miniupnpc dependency 2024-10-24 18:23:31 +02:00
Sebastian Falbesoner
1786be7b4a scripted-diff: drop config/ subdir for bitcoin-config.h, rename to bitcoin-build-config.h
Follow-up for PR #30856, commit 0dd66251.

-BEGIN VERIFY SCRIPT-
sed -i "s|config/bitcoin-config\.h|bitcoin-build-config.h|g" $(git grep -l config/bitcoin-config\.h)
sed -i "s|bitcoin-config\.h|bitcoin-build-config.h|g" $(git grep -l "bitcoin-config\.h" ./src ./test ./cmake)
git mv ./cmake/bitcoin-config.h.in ./cmake/bitcoin-build-config.h.in
-END VERIFY SCRIPT-
2024-10-10 12:22:12 +02:00
Hennadii Stepanov
deacf3c7cd
cmake: Avoid hardcoding Qt's major version in Find module
This change facilitates future migration to Qt 6.
2024-10-01 13:43:30 +01:00
laanwj
20a18bf6aa build: Drop libnatpmp from build system 2024-09-30 11:37:55 +02:00
Lőrinc
2a581144f2 build: Minimize I/O operations in GenerateHeaderFromJson.cmake
Tested the performance with:
>  time cmake -DJSON_SOURCE_PATH=src/secp256k1/src/wycheproof/ecdsa_secp256k1_sha256_bitcoin_test.json -DHEADER_PATH=build/after/ecdsa_secp256k1_sha256_bitcoin_test.json -P cmake/script/GenerateHeaderFromJson.cmake

Before:
> 3.57s user 6.01s system 94% cpu 10.136 total

After:
> 0.17s user 0.01s system 98% cpu 0.187 total
2024-09-12 22:08:15 +02:00
Lőrinc
aa003d1568 build: Minimize I/O operations in GenerateHeaderFromRaw.cmake
Replaced multiple file writes with a single string template write.
The raw content is first grouped into 8 byte chunks, followed by another regex replace which wraps them in `std::byte`.

Tested the output with `diff -w` and they're the same - only whitespace differences because slightly different source formatting.

Tested the performance with:
> time cmake -DRAW_SOURCE_PATH=src/bench/data/block413567.raw -DHEADER_PATH=build/after/block413567.raw.h -DRAW_NAMESPACE=benchmark::data -P cmake/script/GenerateHeaderFromRaw.cmake

Before:
> 15.41s user 23.06s system 97% cpu 39.593 total
After:
> 0.77s user 0.06s system 97% cpu 0.849 total
2024-09-12 22:08:15 +02:00
Hennadii Stepanov
fdeb717e78
Revert "build: Minimize I/O operations in GenerateHeaderFrom{Json,Raw}.cmake"
This reverts commit b07fe666f2.
2024-09-12 16:34:57 +01:00
merge-script
db8350b0e3
Merge bitcoin/bitcoin#30803: build: Minor build system fixes and amendments
1cc93fe7b4 build: Delete dead code that implements `IF_CHECK_FAILED` option (Hennadii Stepanov)
341ad23809 build: Delete MSVC special case for `BUILD_FOR_FUZZING` option (Hennadii Stepanov)
fdad128b52 build: Stop enabling CMake's CMP0141 policy (Hennadii Stepanov)
b2a6f545b4 doc: Drop `ctest` command from Windows cross-compiling instructions (Hennadii Stepanov)
73b618582d build: Print `CMAKE_CXX_COMPILER_ARG1` in summary (Hennadii Stepanov)
f03c942095 build, test: Add missed log options (Hennadii Stepanov)
6f2cb0eafd doc: Amend comment about ZeroMQ config files (Hennadii Stepanov)

Pull request description:

  This PR addresses the following comments:
  - https://github.com/bitcoin/bitcoin/pull/30454#discussion_r1742342524
  - https://github.com/bitcoin/bitcoin/pull/30454#discussion_r1728692369
  - https://github.com/bitcoin/bitcoin/pull/30454#discussion_r1736110362
  - https://github.com/bitcoin/bitcoin/pull/30454#discussion_r1742931121
  - https://github.com/bitcoin/bitcoin/pull/30454#discussion_r1747723657
  - https://github.com/bitcoin/bitcoin/pull/30454#discussion_r1742328675
  - https://github.com/bitcoin/bitcoin/pull/30454#discussion_r1723106474

ACKs for top commit:
  sipsorcery:
    tACK 1cc93fe7b4 (win11 msvc).
  maflcko:
    re-ACK 1cc93fe7b4

Tree-SHA512: a390797bb4d3b7eb9163653b6c9c324e7a01090f6cdda74df7349a24a5c4a2084e5912878747f56561315afc70cae9adb1c363f47ceb0af96004ea591d25171b
2024-09-12 10:30:06 +01:00
merge-script
a86e7a476d
Merge bitcoin/bitcoin#30838: build: Use CMake's default permissions in macOS deploy target
5ba03e7d35 build: Use CMake's default permissions in macOS `deploy` target (Hennadii Stepanov)

Pull request description:

  This PR ensures that the file permissions in macOS `zip` archives are independent of the user's `umask` value.

  Fixes https://github.com/bitcoin/bitcoin/issues/30815.

ACKs for top commit:
  fanquake:
    ACK 5ba03e7d35 - I'm going to merge this now so we return to usable (comparable) guix builds.

Tree-SHA512: 78f724cd3ffd5c1fd5fc1b4832f1e8154c62723f3de5ac9599f44715cbd08a3dfbb806801411c55069773d2e34c9f8cab25585dbad2f032c36b68dd83cb51847
2024-09-12 10:17:08 +01:00
merge-script
155963768a
Merge bitcoin/bitcoin#30842: build: Minimize I/O operations in GenerateHeaderFrom{Json,Raw}.cmake
b07fe666f2 build: Minimize I/O operations in `GenerateHeaderFrom{Json,Raw}.cmake` (Hennadii Stepanov)

Pull request description:

  This PR aims to reduce build time by replacing multiple `file(WRITE|APPEND ...)` commands with a single `file(WRITE ...)` command.

  Due to differences in implementation (e.g., filesystem design, system calls, caching), a noticeable improvement in build time is observed only on Windows.

  Additionally, the code has been refactored to remove the `remainder` local variables.

ACKs for top commit:
  sipsorcery:
    tACK b07fe666f2
  maflcko:
    review ACK b07fe666f2
  TheCharlatan:
    ACK b07fe666f2

Tree-SHA512: 6ed3ae8fe7d8859af38d83918eddf7cb318607787863b95589f4a7a45a36f8c4bd1c01e366078d0515115c121bc857dc63471e52ff26fc49edbc8bb69875e947
2024-09-12 09:37:42 +01:00
Hennadii Stepanov
5ba03e7d35
build: Use CMake's default permissions in macOS deploy target
This change fixes reproducibility issue with macOS Guix builds.
2024-09-10 15:44:17 +01:00
Hennadii Stepanov
1cc93fe7b4
build: Delete dead code that implements IF_CHECK_FAILED option 2024-09-08 16:34:04 +01:00
Hennadii Stepanov
b07fe666f2
build: Minimize I/O operations in GenerateHeaderFrom{Json,Raw}.cmake 2024-09-07 15:37:53 +01:00
Hennadii Stepanov
73b618582d
build: Print CMAKE_CXX_COMPILER_ARG1 in summary
When `-DCMAKE_CXX_COMPILER='clang++;-stdlib=libc++;-m32'` is provided,
`-stdlib=libc++ -m32` flags are printed in the summary now.
2024-09-06 21:59:52 +01:00
fanquake
1f054eca4e
cmake: add USE_SOURCE_PERMISSIONS to all configure_file usage
`USE_SOURCE_PERMISSIONS` is the default, so this should not change
behaviour. However, being explicit makes it clear what we are doing.

Related to #30815.

See
https://cmake.org/cmake/help/latest/command/configure_file.html#options.
2024-09-06 10:52:19 +01:00
fanquake
a7a4e11db8
cmake: scope Boost Test check to vcpkg
This check was added for vcpkg, given how it packages Boost. However, we
don't need to run the check for other platforms, and it's quite slow.
So, scope it to VCPKG. On my machine, this reduces the time to run
`cmake -B build` from ~12 seconds, to ~6 seconds.

Fixes: #30787
2024-09-05 16:15:27 +01:00
merge-script
6852d1d487
Merge bitcoin/bitcoin#30796: test: Use std::span and std::string_view for raw data
faecca9a85 test: Use span for raw data (MarcoFalke)
fac973647d test: Use string_view for json_tests (MarcoFalke)

Pull request description:

  The build system converts raw data into a C++ header file for tests.

  This change modernizes the code to use the convenience wrappers `std::span` and `std::string_view`, so that redundant copies can be avoided.

ACKs for top commit:
  fjahr:
    re-ACK faecca9a85
  TheCharlatan:
    ACK faecca9a85
  stickies-v:
    ACK faecca9a85
  hebasto:
    ACK faecca9a85, I have reviewed the code and the generated headers.

Tree-SHA512: 1f4951c54aff11ba27c41fb70f2821bdb79e06ca0abae734b970bd0d64dda9d8cced824a891fd51b3e9d4e5715ee9eb49ed5d369010a45eca7c3bec9f8641235
2024-09-05 13:46:22 +01:00
MarcoFalke
faecca9a85
test: Use span for raw data
This change allows to drop brittle sizeof calls in favor of the
std::span::size method.

Other improvements include:

* Use of a namespace to mark test and bench data
* Use of the modern std::byte
* Drop of a no longer used std::vector copy and the bench/data module
2024-09-05 10:57:19 +02:00
Hennadii Stepanov
d9fcbfc372
build: Add JOBS variable support to CoverageFuzz.cmake script 2024-09-04 16:03:06 +01:00
Hennadii Stepanov
e7cf4a6f27
build: Add missed -g for "Coverage" build configuration 2024-09-04 16:02:19 +01:00
Hennadii Stepanov
fe2003ab12
build: Add COMMAND_ERROR_IS_FATAL to every process in coverage scrips 2024-09-04 16:02:14 +01:00
MarcoFalke
8888beea8d
scripted-diff: fuzz: Rename fuzz_seed_corpus to fuzz_corpora
-BEGIN VERIFY SCRIPT-
 ren() { sed -i "s:\<$1\>:$2:g" $( git grep -l "$1" ) ; }
 ren fuzz_seed_corpus     fuzz_corpora
 ren FUZZ_SEED_CORPUS_DIR FUZZ_CORPORA_DIR
-END VERIFY SCRIPT-
2024-09-03 20:40:35 +02:00
MarcoFalke
fac973647d
test: Use string_view for json_tests
This avoids a static constructor of the global std::string, and rules
out possibly expensive and implicit copies of the string completely.
2024-09-03 16:06:20 +02:00
Hennadii Stepanov
d209e4f156
doc: Drop mentions of share/genbuild.sh 2024-08-29 12:38:37 +01:00
Hennadii Stepanov
8b6f1c4353
cmake: Add Coverage and CoverageFuzz scripts 2024-08-16 21:19:12 +01:00
Hennadii Stepanov
747adb6ffe
cmake: Add Maintenance module 2024-08-16 21:19:11 +01:00
Hennadii Stepanov
1f60b30df0
cmake: Add APPEND_{CPP,C,CXX,LD}FLAGS cache variables
The content of those variables is appended to the each target after the
flags added by the build system.
2024-08-16 21:19:11 +01:00
Hennadii Stepanov
2b43c45b13
cmake: Add AddWindowsResources module 2024-08-16 21:19:11 +01:00
Hennadii Stepanov
10fcc668a3
cmake: Add WITH_DBUS option 2024-08-16 19:27:42 +01:00
Hennadii Stepanov
5bb5a4bc75
cmake: Add libqrencode optional package support 2024-08-16 19:27:42 +01:00
Hennadii Stepanov
57a6e2ef4a
cmake: Build bitcoin-qt executable 2024-08-16 19:27:42 +01:00
Hennadii Stepanov
a8a2e364ac
cmake: Add Python-based tests 2024-08-16 19:27:41 +01:00
Hennadii Stepanov
801735163a
cmake: Add external signer support 2024-08-16 19:27:41 +01:00
Hennadii Stepanov
353e0c9e96
cmake: Add systemtap-sdt optional package support 2024-08-16 19:27:41 +01:00
Hennadii Stepanov
ae7b39a0e1
cmake: Add libminiupnpc optional package support 2024-08-16 19:27:40 +01:00
Hennadii Stepanov
6480e1dcdb
cmake: Add libnatpmp optional package support 2024-08-16 19:27:40 +01:00
Hennadii Stepanov
d10c5c34c3
cmake: Add wallet functionality 2024-08-16 19:27:40 +01:00
Hennadii Stepanov
959370bd76
cmake: Build test_bitcoin executable 2024-08-16 19:27:39 +01:00
Hennadii Stepanov
a9813df826
cmake: Build bitcoind executable 2024-08-16 19:27:39 +01:00
Hennadii Stepanov
97829ce2d5
cmake: Add FindLibevent module 2024-08-16 19:27:39 +01:00
Hennadii Stepanov
0a9a521a70
cmake: Build bitcoin_crypto library 2024-08-16 19:27:38 +01:00
Hennadii Stepanov
752747fda8
cmake: Generate obj/build.h header 2024-08-16 19:27:38 +01:00
Hennadii Stepanov
1f0a78edf3
cmake: Build minisketch static library 2024-08-16 19:27:38 +01:00
Hennadii Stepanov
12bfbc8154
cmake: Build leveldb static library
Co-authored-by: Cory Fields <cory-nospam-@coryfields.com>
2024-08-16 19:27:38 +01:00
Hennadii Stepanov
51985c5304
cmake: Build crc32c static library 2024-08-16 19:27:37 +01:00
Hennadii Stepanov
dbb7ed14e8
cmake: Add ccache support 2024-08-16 19:27:37 +01:00