182 Commits

Author SHA1 Message Date
fanquake
a9ac680af3 build: remove FALLTHROUGH_INTENDED from leveldb.cmake
No-longer needed after
https://github.com/bitcoin-core/leveldb-subtree/pull/60.
2026-05-28 09:35:12 +01:00
fanquake
4d58c3271c build: remove -Wno-conditional-uninitialized from leveldb build 2026-05-28 09:34:49 +01:00
merge-script
211e1053bf Merge bitcoin/bitcoin#32220: cmake: Get rid of undocumented BITCOIN_GENBUILD_NO_GIT environment variable
3142e5f8cf doc: Add release notes for #32220 (Hennadii Stepanov)
b71cd5c162 cmake: Skip using git when building from source tarball or as subproject (Hennadii Stepanov)
fe941938e8 cmake: Remove unnecessary `BITCOIN_GENBUILD_NO_GIT` environment variable (Hennadii Stepanov)
9a2cced23a cmake, refactor: Move `find_package(Git)` to `src/CMakeLists.txt` (Hennadii Stepanov)

Pull request description:

  In general, the Bitcoin Core build system attempts to fetch commit or tag details from git. This is handled by the [`cmake/script/GenerateBuildInfo.cmake`](https://github.com/bitcoin/bitcoin/blob/master/cmake/script/GenerateBuildInfo.cmake) script, which generates the [`src/bitcoin-build-info.h`](65dcbec756/src/clientversion.cpp (L26-L31)) header within the build tree.

  However, there are cases where the retrieved details may be incorrect—for example, when building from a source tarball or as a subproject within a git-aware project.

  In the Autotools-based build system, the `BITCOIN_GENBUILD_NO_GIT` environment variable was [introduced](https://github.com/bitcoin/bitcoin/pull/7522) in [v0.20.0](https://github.com/bitcoin/bitcoin/blob/master/doc/release-notes/release-notes-0.20.0.md) to address such scenarios:
  > The process for generating the source code release ("tarball") has changed in an effort to make it more complete, however, there are a few regressions in this release:
  > - Instead of running `make` simply, you should instead run `BITCOIN_GENBUILD_NO_GIT=1 make`.

  This PR automagically handles both of the aforementioned cases and removes the need for `BITCOIN_GENBUILD_NO_GIT`.

  The user is still able to configure the build with [`-DCMAKE_DISABLE_FIND_PACKAGE_Git=ON`](https://cmake.org/cmake/help/latest/variable/CMAKE_DISABLE_FIND_PACKAGE_PackageName.html) to disable git execution manually, for [reasons](https://github.com/bitcoin/bitcoin/pull/32220#issuecomment-2780115034) we don't know in advance.

  Closes https://github.com/bitcoin/bitcoin/issues/31999.

ACKs for top commit:
  maflcko:
    review ACK 3142e5f8cf 🥄
  fanquake:
    ACK 3142e5f8cf - tested a few different build scenarios (from Guix the tarball), they all seem to work as intended.

Tree-SHA512: 14995dc76fc680cff2bbc983d525125b39f49397e8ed94fffab29de505723a8e2f7f261c1a7ca88d98776755ccf63e59a32c476e112683f5cc1c016a7cfede94
2026-05-21 12:18:27 +01:00
Hennadii Stepanov
fe941938e8 cmake: Remove unnecessary BITCOIN_GENBUILD_NO_GIT environment variable
This functionality is now covered by the `CMAKE_DISABLE_FIND_PACKAGE_Git`
variable.

Note for reviewers: consider reviewing with `git diff -w`.
2026-05-14 13:29:04 +01:00
Hennadii Stepanov
9a2cced23a cmake, refactor: Move find_package(Git) to src/CMakeLists.txt
This change allows the use of the `CMAKE_DISABLE_FIND_PACKAGE_Git`
variable to explicitly disable git usage.
2026-05-14 13:27:13 +01:00
MarcoFalke
fa3d7ce11c doc: Document minimum versions for Xcode CLT and MSVC 2026-05-13 19:51:56 +02:00
Ava Chow
10ca73c02c Merge bitcoin/bitcoin#34580: build: Add a compiler minimum feature check
ac1ccc5bd9 build: Add CTAD feature check (Pol Espinasa)
9f273f1c1c build: Add path to doc recommended versions for CLANG, GCC and MSVC (Pol Espinasa)

Pull request description:

  Adds a compiler features check. If failed, it returns a fatal error.
  This early stop at configure time will avoid contributors losing time trying to fix compilation errors because of not fitting the requirements.

  Example of the output for GCC:
  Version requirement satisfied:
  ```
  $ cmake -B build
  -- The CXX compiler identification is GNU 13.3.0
  -- Detecting CXX compiler ABI info
  -- Detecting CXX compiler ABI info - done
  -- Check for working CXX compiler: /usr/bin/c++ - skipped
  -- Detecting CXX compile features
  -- Detecting CXX compile features - done
  ...
  -- Checking for required C++ features
  -- Checking for required C++ features - done
  ....
  ```
  Compiler feature requirement not satisfied:
  ```
  $ cmake -B build -DCMAKE_C_COMPILER=/usr/bin/gcc-10 -DCMAKE_CXX_COMPILER=/usr/bin/g++-10
  -- The CXX compiler identification is GNU 10.5.0
  -- Detecting CXX compiler ABI info
  -- Detecting CXX compiler ABI info - done
  -- Check for working CXX compiler: /usr/bin/g++-10 - skipped
  -- Detecting CXX compile features
  -- Detecting CXX compile features - done
  -- Setting build type to "RelWithDebInfo" as none was specified
  -- Performing Test CXX_SUPPORTS__WERROR
  -- Performing Test CXX_SUPPORTS__WERROR - Success
  -- Found SQLite3: /usr/include (found suitable version "3.45.1", minimum required is "3.7.17")
  -- Checking for required C++ features
  CMake Error at cmake/module/CheckCXXFeatures.cmake:32 (message):
    Compiler lacks Class Template Argument Deduction (CTAD) for aggregates.

    This C++ feature is required for src/util/overloaded.h.

    You are probably using an old compiler version

    The recommended compiler versions can be checked in:

      - GCC -> doc/dependencies.md#compiler
      - Clang -> doc/dependencies.md#compiler
      - MSVC -> doc/build-windows-msvc.md

  Call Stack (most recent call first):
    CMakeLists.txt:198 (check_cxx_features)

  -- Configuring incomplete, errors occurred!

  ```

  Example of the output for Clang:
  Compiler feature requirement satisfied:
  ```
  $ cmake -B build -DCMAKE_C_COMPILER=clang-20 -DCMAKE_CXX_COMPILER=clang++-20
  -- The CXX compiler identification is Clang 20.1.2
  -- Detecting CXX compiler ABI info
  -- Detecting CXX compiler ABI info - done
  -- Check for working CXX compiler: /usr/bin/clang++-20 - skipped
  -- Detecting CXX compile features
  -- Detecting CXX compile features - done
  ...
  -- Checking for required C++ features
  -- Checking for required C++ features - done
  ...
  ```

  Compiler feature requirement not satisfied:
  ```
  $ cmake -B build -DCMAKE_C_COMPILER=clang-16 -DCMAKE_CXX_COMPILER=clang++-16
  -- The CXX compiler identification is Clang 16.0.6
  -- Detecting CXX compiler ABI info
  -- Detecting CXX compiler ABI info - done
  -- Check for working CXX compiler: /usr/bin/clang++-16 - skipped
  -- Detecting CXX compile features
  -- Detecting CXX compile features - done
  -- Setting build type to "RelWithDebInfo" as none was specified
  -- Performing Test CXX_SUPPORTS__WERROR
  -- Performing Test CXX_SUPPORTS__WERROR - Success
  -- Performing Test CXX_SUPPORTS__G3
  -- Performing Test CXX_SUPPORTS__G3 - Success
  -- Performing Test LINKER_SUPPORTS__G3
  -- Performing Test LINKER_SUPPORTS__G3 - Success
  -- Performing Test CXX_SUPPORTS__FTRAPV
  -- Performing Test CXX_SUPPORTS__FTRAPV - Success
  -- Performing Test LINKER_SUPPORTS__FTRAPV
  -- Performing Test LINKER_SUPPORTS__FTRAPV - Success
  -- Found SQLite3: /usr/include (found suitable version "3.45.1", minimum required is "3.7.17")
  -- Checking for required C++ features
  CMake Error at cmake/module/CheckCXXFeatures.cmake:32 (message):
    Compiler lacks Class Template Argument Deduction (CTAD) for aggregates.

    This C++ feature is required for src/util/overloaded.h.

    You are probably using an old compiler version

    The recommended compiler versions can be checked in:

      - GCC -> doc/dependencies.md#compiler
      - Clang -> doc/dependencies.md#compiler
      - MSVC -> doc/build-windows-msvc.md

  Call Stack (most recent call first):
    CMakeLists.txt:198 (check_cxx_features)

  -- Configuring incomplete, errors occurred!
  ```

  Edit: The first version of the PR was to check hardcoded compiler versions. See previous PR description for context here.
  <details>

  Adds a compiler minimum version check. If failed, it returns a fatal error.
  This early stop at configure time will avoid contributors losing time trying to fix compilation errors because of not fitting the requirements.

  Example of the output for GCC:
  Version requirement satisfied:
  ```
  sliv3r@sliv3r-tuxedo:~/Documentos/Projectes/BitcoinCore/bitcoin$ cmake -B BUILD
  -- The CXX compiler identification is GNU 13.3.0
  -- Detecting CXX compiler ABI info
  -- Detecting CXX compiler ABI info - done
  ....
  ```
  Version requirement not satisfied:
  ```
  $ cmake -B build -S .   -DCMAKE_C_COMPILER=/usr/bin/gcc-11   -DCMAKE_CXX_COMPILER=/usr/bin/g++-11
  -- The CXX compiler identification is GNU 11.5.0
  -- Detecting CXX compiler ABI info
  -- Detecting CXX compiler ABI info - done
  -- Check for working CXX compiler: /usr/bin/g++-11 - skipped
  -- Detecting CXX compile features
  -- Detecting CXX compile features - done
  CMake Error at CMakeLists.txt:91 (message):
    GCC >= 12.1 required.

  -- Configuring incomplete, errors occurred!

  ```

  Example of the output for Clang:
  Version requirement satisfied:
  ```
  sliv3r@sliv3r-tuxedo:~/Documentos/Projectes/BitcoinCore/bitcoin$ cmake -B build
  -- The CXX compiler identification is Clang 18.1.3
  -- Detecting CXX compiler ABI info
  -- Detecting CXX compiler ABI info - done
  ...
  ```

  Version requirement not satisfied:
  ```
  $ cmake -B build -DCMAKE_C_COMPILER=clang-16       -DCMAKE_CXX_COMPILER=clang++-16
  -- The CXX compiler identification is Clang 16.0.6
  -- Detecting CXX compiler ABI info
  -- Detecting CXX compiler ABI info - done
  -- Check for working CXX compiler: /usr/bin/clang++-16 - skipped
  -- Detecting CXX compile features
  -- Detecting CXX compile features - done
  CMake Error at CMakeLists.txt:86 (message):
    Clang >= 17.0 required.

  -- Configuring incomplete, errors occurred!
  ```
  <\detail>

ACKs for top commit:
  davidgumberg:
    crACK ac1ccc5bd9
  achow101:
    ACK ac1ccc5bd9
  vasild:
    ACK ac1ccc5bd9
  w0xlt:
    ACK ac1ccc5bd9
  ryanofsky:
    Code review ACK ac1ccc5bd9. Very much agree with all the previous comments to not check specific compiler versions, and glad this PR is in better shape now.

Tree-SHA512: 15a12f56016846427ed8273406c3e9a52a6435bf7033c8fef82bb0e6c9fd75d40a62c79d33f9dd6da8717500f21a629da07620f160b3d43368dd7579f773b4bc
2026-05-11 15:29:35 -07:00
Hennadii Stepanov
e2ef54b8ba cmake: Remove NetBSD-specific workaround from add_boost_if_needed
The patched package is available as of the `pkgsrc-2026Q1` release.
2026-04-27 10:50:59 +01:00
Pol Espinasa
ac1ccc5bd9 build: Add CTAD feature check 2026-03-13 15:10:37 +01:00
MarcoFalke
fa4ec13b44 build: Enable -Wcovered-switch-default
The leveldb exclusion is required to avoid this warning in the subtree:

```
src/leveldb/util/status.cc:63:7: warning: default label in switch which covers all enumeration values [-Wcovered-switch-default]
   63 |       default:
      |       ^
1 warning generated.
```
2026-03-13 09:02:21 +01:00
merge-script
b5737b755d Merge bitcoin/bitcoin#34650: depends: Update Qt to version 6.8.3
0a6724aaae doc: Update Windows build notes (Hennadii Stepanov)
473e5f8efc qt: Add patch to fix SFINAE warnings in QAnyStringView with gcc16 (Hennadii Stepanov)
3cb4d6066b qt: add patches to fix SFINAE errors/warnings with gcc16 (Cory Fields)
d7e972a90d qt: add patch to fix build with gcc16 (Cory Fields)
19693a8c91 depends: Update Qt to 6.8.3 (Hennadii Stepanov)
c55584575a cmake: Fix `FindQt` module (Hennadii Stepanov)

Pull request description:

  This PR updates the `qt` package in depends to the latest open-source [6.8.3](https://www.qt.io/blog/qt-6.8.3-released) LTS release.

  The update includes numerous bugfixes, which allows us to drop `qtbase_plugins_windows11style.patch`.

  Additionally, it includes [patches](https://github.com/bitcoin/bitcoin/issues/34569#issuecomment-3892793262) for compatibility with GCC 16 (along with one extra patch), and incorporates a [commit](8f1b55d1d5) from https://github.com/bitcoin/bitcoin/pull/32709.

  Closes https://github.com/bitcoin/bitcoin/issues/34569.

ACKs for top commit:
  achow101:
    ACK 0a6724aaae
  sedited:
    ACK 0a6724aaae

Tree-SHA512: b66fe6f75bae00fb5c525c5fad56d39273f53f6bfd58206da8a55c6e41d14533137c72fb03e9537ba3a3d0b3463b6dcbef6a88ac2f4559fa6e9abf045fe1beaa
2026-03-06 11:55:46 +00:00
Hennadii Stepanov
c55584575a cmake: Fix FindQt module
The `find_package(Qt .. MODULE REQUIRED COMPONENTS ...)` call must treat
any missing component as a fatal error.
2026-03-04 11:31:12 +00:00
fanquake
3feabb203a leveldb: remove unused files 2026-02-20 13:08:44 +00:00
merge-script
a2fd558760 Merge bitcoin/bitcoin#34572: cmake: Fix NetBSD-specific workaround for Boost
79c934b51c cmake: Fix NetBSD-specific workaround for Boost (Hennadii Stepanov)

Pull request description:

  The recently merged https://github.com/bitcoin/bitcoin/pull/34143 broke builds with depends on NetBSD due to a workaround introduced in 5a5ddbd789.

  The upstream [bug](https://gnats.netbsd.org/59856) has been fixed, and the entire workaround can be removed once the fixed Boost package becomes generally available.

  However, it seems prudent to amend the workaround now to have it workable in the 31.0 release.

  Here are CI runs:
  - broken: https://github.com/hebasto/bitcoin-core-nightly/actions/runs/21933683654
  - fixed: https://github.com/hebasto/bitcoin-core-nightly/actions/runs/21933683654

ACKs for top commit:
  fanquake:
    ACK 79c934b51c

Tree-SHA512: 360e4943fbedc7692fa2eba48f3375fc927d3aaef178dec6c0fafd3addfad0c89db9d1fe88e214313ebd285584bf8dc7d7b0a3a41d905c7f3d28293aa743405a
2026-02-20 11:13:04 +00:00
Ava Chow
4933d1fbba Merge bitcoin/bitcoin#28792: build: Embedded ASMap [3/3]: Build binary dump header file
24699fec84 doc: Add initial asmap data documentation (Fabian Jahr)
bab085d282 ci: Use without embedded asmap build option in one ci job (Fabian Jahr)
e53934422a doc: Expand documentation on asmap feature and tooling (Fabian Jahr)
6244212a55 init, net: Implement usage of binary-embedded asmap data (Fabian Jahr)
6202b50fb9 build: Generate ip_asn.dat.h during build process (Fabian Jahr)
634cd60dc8 build: Add embedded asmap data (Fabian Jahr)

Pull request description:

  This is the final in a series of PRs that implement the necessary changes for embedding of asmap data into the binary. This last part add the initial asmap data, implements the build changes and adds further documentation.

  Currently an asmap file needs to be acquired by there user from some location or the user needs to generate one themselves. Then they need to move the file to the right place in datadir or pass the path to the file as `-asmap=PATH` in order to use the asmap feature. The change here allows for builds to embed asmap data into the bitcoind binary which makes it possible to use the feature without handling of the asmap file by the user. If the user starts bitcoind with `-asmap` the embedded data will be used for bucketing of nodes.

  The data lives in the repository at `src/node/data/ip_asn.dat` and can be replaced with a new version at any time. The idea is that the data should be updated with every release. By default the data at that location is embedded into the binary but there is also a build option to prevent this (`-DWITH_EMBEDDED_ASMAP=OFF`). In this case the original behavior of the `-asmap` option is maintained.

ACKs for top commit:
  achow101:
    ACK 24699fec84
  sipa:
    ACK 24699fec84
  hodlinator:
    ACK 24699fec84

Tree-SHA512: c2e33dbeea387efdfd3d415432bf8fa64de80f272c1207015ea53b85bb77f5c29f1dae5644513a23c844a98fb0a4bb257bf765f38b15bfc4c41984f0315b4c6a
2026-02-18 16:43:34 -08:00
Hennadii Stepanov
79c934b51c cmake: Fix NetBSD-specific workaround for Boost 2026-02-12 10:49:45 +00:00
Cory Fields
2ccfdb582b build: avoid exporting secp256k1 symbols
Take advantage of the new secp256k1 option to avoid visibility attributes on
API functions.

While most users of a shared libsecp always want API functions exported so that
they can actually be linked against, we always build it statically. When that
static lib is linked into a (static or shared) libbitcoinkernel, by default its
symbols end up exported there as well.

As libsecp is an implementation detail of the kernel (and any future Core lib),
its symbols should never be exported.
2026-02-10 21:18:25 +00:00
Fabian Jahr
6202b50fb9 build: Generate ip_asn.dat.h during build process
This can be disabled with -DWITH_EMBEDDED_ASMAP=OFF.
2026-02-03 18:03:37 +01:00
Hennadii Stepanov
5bbc7c8cc1 Merge bitcoin/bitcoin#33810: ci: Add IWYU job
56750c4f87 iwyu, clang-format: Sort includes (Hennadii Stepanov)
2c78814e0e ci: Add IWYU job (Hennadii Stepanov)
94e4f04d7c cmake: Fix target name (Hennadii Stepanov)
0f81e00519 cmake: Make `codegen` target dependent on `generate_build_info` (Hennadii Stepanov)
73f7844cdb iwyu: Add patch to prefer C++ headers over C counterparts (Hennadii Stepanov)
7a65437e23 iwyu: Add patch to prefer angled brackets over quotes for includes (Hennadii Stepanov)

Pull request description:

  This PR separates the IWYU checks into its own CI job to provide faster feedback to developers. No other changes are made to the treatment of IWYU warnings. The existing “tidy” CI job will no longer run IWYU.

  See also the discussion of https://github.com/bitcoin/bitcoin/pull/33779, specifically this [comment](https://github.com/bitcoin/bitcoin/pull/33779#issuecomment-3491515263):
  > Maybe a better approach would be to run the enforced sections in a separate, faster job? Some of the linters are already a bit annoying to invoke locally, so I usually just run the lint job. Doing the same for the includes seems fine to me.

  Based on ideas from https://github.com/bitcoin/bitcoin/pull/32953.

ACKs for top commit:
  maflcko:
    review ACK 56750c4f87 🌄
  sedited:
    ACK 56750c4f87

Tree-SHA512: af15326b6d0c5d1e11346ac64939644936c65eb9466cd1a17ab5da347d39aef10f7ab33b39fbca31ad291b0b4b54639b147b24410f4f86197e4a776049882694
2025-12-22 17:38:50 +00:00
merge-script
7f295e1d9b Merge bitcoin/bitcoin#34084: scripted-diff: [doc] Unify stale copyright headers
fa4cb13b52 test: [doc] Manually unify stale headers (MarcoFalke)
fa5f297748 scripted-diff: [doc] Unify stale copyright headers (MarcoFalke)

Pull request description:

  Historically, the upper year range in file headers was bumped manually
  or with a script.

  This has many issues:

  * The script is causing churn. See for example commit 306ccd4, or
    drive-by first-time contributions bumping them one-by-one. (A few from
    this year: https://github.com/bitcoin/bitcoin/pull/32008,
    https://github.com/bitcoin/bitcoin/pull/31642,
    https://github.com/bitcoin/bitcoin/pull/32963, ...)
  * Some, or likely most, upper year values were wrong. Reasons for
    incorrect dates could be code moves, cherry-picks, or simply bugs in
    the script.
  * The upper range is not needed for anything.
  * Anyone who wants to find the initial file creation date, or file
    history, can use `git log` or `git blame` to get more accurate
    results.
  * Many places are already using the `-present` suffix, with the meaning
    that the upper range is omitted.

  To fix all issues, this bumps the upper range of the copyright headers
  to `-present`.

  Further notes:

  * Obviously, the yearly 4-line bump commit for the build system (c.f.
    b537a2c02a) is fine and will remain.
  * For new code, the date range can be fully omitted, as it is done
    already by some developers. Obviously, developers are free to pick
    whatever style they want. One can list the commits for each style.
  * For example, to list all commits that use `-present`:
    `git log --format='%an (%ae) [%h: %s]' -S 'present The Bitcoin'`.
  * Alternatively, to list all commits that use no range at all:
    `git log --format='%an (%ae) [%h: %s]' -S '(c) The Bitcoin'`.

  <!--
  * The lower range can be wrong as well, so it could be omitted as well,
    but this is left for a follow-up. A previous attempt was in
    https://github.com/bitcoin/bitcoin/pull/26817.

ACKs for top commit:
  l0rinc:
    ACK fa4cb13b52
  rkrux:
    re-ACK fa4cb13b52
  janb84:
    ACK fa4cb13b52

Tree-SHA512: e5132781bdc4417d1e2922809b27ef4cf0abb37ffb68c65aab8a5391d3c917b61a18928ec2ec2c75ef5184cb79a5b8c8290d63e949220dbeab3bd2c0dfbdc4c5
2025-12-19 16:56:02 +00:00
Hennadii Stepanov
f480c1e717 build: Update minimum required Boost version
Building with Boost 1.73.0 is broken.
2025-12-18 20:43:27 +00:00
Hennadii Stepanov
94e4f04d7c cmake: Fix target name
The executable target run by ctest is `mptest`.

This change removes unnecessary steps when building the `codegen`
target.
2025-12-17 20:29:16 +00:00
MarcoFalke
fa5f297748 scripted-diff: [doc] Unify stale copyright headers
-BEGIN VERIFY SCRIPT-

 sed --in-place --regexp-extended \
   's;( 20[0-2][0-9])(-20[0-2][0-9])? The Bitcoin Core developers;\1-present The Bitcoin Core developers;g' \
   $( git grep -l 'The Bitcoin Core developers' -- ':(exclude)COPYING' ':(exclude)src/ipc/libmultiprocess' ':(exclude)src/minisketch' )

-END VERIFY SCRIPT-
2025-12-16 22:21:15 +01:00
Henry Romp
2594d5a189 build: Remove CMAKE_SKIP_BUILD_RPATH and SKIP_BUILD_RPATH settings
Remove CMake settings that are no longer needed after reordering Guix build script to perform binary checks after installation.

Also removes unused CMake maintenance targets (check-security and check-symbols) and updates security checks to include libexec/ directory binaries (see PR #31679).
2025-11-12 19:50:11 -05:00
Hennadii Stepanov
f366408492 cmake: Set process code page to UTF-8 on Windows
Additionally, this change adds app manifests to targets that were
previously missing them.
2025-10-06 19:41:35 +01:00
merge-script
5ae8edbc30 Merge bitcoin/bitcoin#33158: macdeploy: avoid use of Bitcoin Core in Linux cross build
8e434a8499 macdeploy: rename macOS output to bitcoin-macos-app.zip (fanquake)
05353d9cf0 macdeploy: combine appname & -zip arguments (fanquake)

Pull request description:

  Output `bitcoin-macos-app.zip`, similar to what we do for Windows: `bitcoin-win64-setup.exe`.

ACKs for top commit:
  hodlinator:
    re-ACK 8e434a8499
  willcl-ark:
    ACK 8e434a8499

Tree-SHA512: e762c9866630c4f8c577027ee9492d74a5c7f4b194df73876d702703b9100c356a30986c2f209ba3f3e2d483017f5e61596a2a7cdfae0a684f8dc244420cd108
2025-09-24 09:59:45 -04:00
Hennadii Stepanov
9193c3e434 cmake: Fix regression in secp256k1.cmake
The `enable_language` command must be called in file scope, not in a
function call.

See: https://cmake.org/cmake/help/latest/command/enable_language.html
2025-09-12 17:56:12 +01:00
merge-script
9a5ba154be Merge bitcoin/bitcoin#33310: trace: Workaround GCC bug compiling with old systemtap
93a29ff283 trace: Workaround GCC bug compiling with old systemtap (Luke Dashjr)

Pull request description:

ACKs for top commit:
  0xB10C:
    lgtm ACK 93a29ff283 - I did not test this.

Tree-SHA512: 9ce9ed8b7733af721134462073a3417e52d67e9e9853eebbddfa795842b381de98e28756ebfa6652536cbfdd08181142eccd198f4dc00a57d8748801b362b4b7
2025-09-12 11:49:38 +01:00
Luke Dashjr
93a29ff283 trace: Workaround GCC bug compiling with old systemtap 2025-09-04 19:25:42 +00:00
fanquake
8e434a8499 macdeploy: rename macOS output to bitcoin-macos-app.zip
We were naming this "Bitcoin-Core.zip", just to immediately rename it.
Similar to what we do with Windows, i.e `bitcoin-win64-setup.exe`.
2025-09-03 13:00:38 +01:00
fanquake
05353d9cf0 macdeploy: combine appname & -zip arguments
appname is only used by -zip.
2025-09-03 13:00:35 +01:00
Sjors Provoost
16bce9ac4c build: depends makes libmultiprocess by default
This causes IPC binaries (bitcoin-node, bitcoin-gui) to be included
in releases.

The effect on CI is that this causes more depends builds to build IPC
binaries, but still the only build running functional tests with them
is the i686_multiprocess one.

Except for Windows.
2025-08-14 20:57:38 +02:00
merge-script
2bb06bcaf2 Merge bitcoin/bitcoin#31679: cmake: Install internal binaries to <prefix>/libexec/
f49840dd90 doc: Fix typo in files.md (Ryan Ofsky)
f5cf0b1ccc bitcoin wrapper: improve help output (Ryan Ofsky)
c810b168b8 doc: Add description of installed files to files.md (Ryan Ofsky)
94ffd01a02 doc: Add release notes describing libexec/ binaries (Ryan Ofsky)
cd97905ebc cmake: Move internal binaries from bin/ to libexec/ (Ryan Ofsky)

Pull request description:

  This change moves binaries that are not typically invoked directly by users from the `bin/` directory to the `libexec/` directory in CMake installs and binary releases. The goal of the PR is to introduce a distinction between internal and external binaries so starting with #31802, we can use IPC to implement features in new binaries without adding those binaries to the CLI. The change also helps reduce clutter in `bin/`, making it easier for users to identify useful tools to run. Summary of changes:

  - For **source builds** (i.e. developer builds) — There are no changes.
  - For **source installs** (i.e. `cmake --install` result) — `test_bitcoin`, `test_bitcoin-qt`, and `bench_bitcoin` are installed in `${CMAKE_PREFIX_PATH}/libexec` instead of `${CMAKE_PREFIX_PATH}/bin`, so they are no longer on the system `PATH`. However, they can still be invoked from the `libexec/` directory, or from the CLI as `bitcoin test`, `bitcoin test-gui`, and `bitcoin bench`, respectively.
  - For **binary releases** — Since `test_bitcoin` is the only test binary enabled in releases, the only change is moving `test_bitcoin` from `bin/` to `libexec/`.

  <details><summary>Details</summary>
  <p>

   The table below shows the install location of each binary after this change, and the availability of each binary.

  | Binary               | Location     | Availability         | Change                        |
  |----------------------|--------------|----------------------|-------------------------------|
  | `bitcoin`            | `bin/`       | 📦 Binary release (since #31375) | Unchanged                     |
  | `bitcoin-cli`        | `bin/`       | 📦 Binary release     | Unchanged                     |
  | `bitcoind`           | `bin/`       | 📦 Binary release     | Unchanged                     |
  | `bitcoin-qt`         | `bin/`       | 📦 Binary release     | Unchanged                     |
  | `bitcoin-tx`         | `bin/`       | 📦 Binary release     | Unchanged                     |
  | `bitcoin-util`       | `bin/`       | 📦 Binary release     | Unchanged                     |
  | `bitcoin-wallet`     | `bin/`       | 📦 Binary release     | Unchanged                     |
  | `bench_bitcoin`      | `libexec/`   | 🛠 Source build only  | Moved from `bin/`             |
  | `bitcoin-chainstate` | `libexec/`   | 🛠 Source build only  | Newly installed (was built)   |
  | `bitcoin-gui`        | `libexec/`   | 🛠 Source build only (until #31802) | Moved from `bin/`             |
  | `bitcoin-node`       | `libexec/`   | 🛠 Source build only (until #31802) | Moved from `bin/`             |
  | `test_bitcoin`       | `libexec/`    | 📦 Binary release     | Moved from `bin/`             |
  | `test_bitcoin-qt`    | `libexec/`   | 🛠 Source build only  | Moved from `bin/`             |

  </p>
  </details>

  ---

  This PR is part of the [process separation project](https://github.com/bitcoin/bitcoin/issues/28722).

ACKs for top commit:
  l0rinc:
    re-ACK f49840dd90
  Sjors:
    re-ACK f49840dd90
  achow101:
    ACK f49840dd90
  janb84:
    re ACK f49840dd90
  BrandonOdiwuor:
    Tested ACK f49840dd90
  hodlinator:
    re-ACK f49840dd90
  willcl-ark:
    utACK f49840dd90

Tree-SHA512: 858a2e1a53db11ee3c5c759bfdeea566f242b9ce5e8a898fa435222e41662b8184577c0dc2c4c058294b4de41d8cb3ba3e5d24c748c280efa4a3f84e3ec4344d
2025-08-07 14:53:26 +01:00
Hennadii Stepanov
b093a19ae2 cmake: Proactively avoid use of SECP256K1_DISABLE_SHARED
The `SECP256K1_DISABLE_SHARED` CMake variable has been removed upstream.

This change removes its usage ahead of the next `secp256k1` subtree
update to prevent breakage and simplify integration.
2025-08-01 10:32:50 +01:00
Hennadii Stepanov
eb59a192d9 cmake, refactor: Encapsulate adding secp256k1 subtree in function 2025-08-01 10:32:44 +01:00
MarcoFalke
fa4d68cf97 Turn rpcauth.py test into functional test 2025-07-08 16:51:17 +02:00
merge-script
c7fe8abb5f Merge bitcoin/bitcoin#31233: cmake: Improve Python robustness and test usability
67dc7523f3 cmake, test: Disable tests instead of ignoring them (Hennadii Stepanov)
bb9157db5d cmake, refactor: Switch to `Python3::Interpreter` imported target (Hennadii Stepanov)

Pull request description:

  This PR:

  1. Switches to a modern CMake approach by using the `Python3::Interpreter` imported target, which is more robust than using variables.

  2. Disables the `util_rpcauth_test` test explicitly instead of silently ignoring it.

  A build and test log for the case when Python is unavailable is provided below:
  ```
  $ cmake -B build
  $ cmake --build build -j 16
  $ ctest --test-dir build -j $(nproc) -R "^util"
  Internal ctest changing into directory: /bitcoin/build
  Test project /bitcoin/build
      Start 115: util_tests
      Start 117: util_trace_tests
      Start 114: util_string_tests
      Start 116: util_threadnames_tests
      Start   1: util_rpcauth_test
  1/5 Test   #1: util_rpcauth_test ................***Not Run (Disabled)   0.00 sec
  2/5 Test #114: util_string_tests ................   Passed    0.11 sec
  3/5 Test #117: util_trace_tests .................   Passed    0.11 sec
  4/5 Test #116: util_threadnames_tests ...........   Passed    0.11 sec
  5/5 Test #115: util_tests .......................   Passed    0.13 sec

  100% tests passed, 0 tests failed out of 4

  Total Test time (real) =   0.13 sec

  The following tests did not run:
    1 - util_rpcauth_test (Disabled)
  ```

ACKs for top commit:
  purpleKarrot:
    ACK 67dc7523f3
  janb84:
    tACK 67dc7523f3

Tree-SHA512: 5fc7ebe31ac03f4b8a53ecfcfc1cace0f647a1d2c989651988edae96bdfbbe2dee171714e57cb028e65ead1bb40806a82d9821746451dbf005538601fd33ea88
2025-07-03 10:47:25 +01:00
merge-script
bf75c9964f Merge bitcoin/bitcoin#32828: build, docs: Fix Boost-related issues on NetBSD
5a5ddbd789 build: Add workaround for NetBSD bug in `Boost::headers` target (Hennadii Stepanov)
4eb3cee919 doc: Update NetBSD Build Guide (Hennadii Stepanov)

Pull request description:

  The recently merged https://github.com/bitcoin/bitcoin/pull/32667 broke builds on NetBSD due to the following issues:

  1. The `boost-headers` package does not provide CMake configuration files now required since https://github.com/bitcoin/bitcoin/pull/32667.

     The first commit updates the Build Guide to recommend using the `boost` package instead.

  2. The CMake configuration file provided by the `boost` package is [broken](https://github.com/NetBSD/pkgsrc/issues/167).

     The second commit adds a workaround for this issue.

  Upstream issues:
  - https://github.com/NetBSD/pkgsrc/issues/167
  - https://github.com/NetBSD/pkgsrc/issues/168

  Successful CI job: https://github.com/hebasto/bitcoin-core-nightly/actions/runs/15958818914/job/45008576879.

ACKs for top commit:
  purpleKarrot:
    ACK 5a5ddbd789

Tree-SHA512: 617543edf2216c3673195cc562541d7637d7ea199320916c3660a91f6ee1ff01c014f519c5eeb3fc224f7a7304fdb75965ee3f4554d7fb277dd05ba3a6583b45
2025-07-02 13:29:49 +01:00
Hennadii Stepanov
67dc7523f3 cmake, test: Disable tests instead of ignoring them 2025-07-01 10:50:55 +01:00
Hennadii Stepanov
bb9157db5d cmake, refactor: Switch to Python3::Interpreter imported target
Imported targets are more robust than using variables.
2025-07-01 10:48:22 +01:00
merge-script
6e5b67a370 Merge bitcoin/bitcoin#32697: test: Turn util/test_runner into functional test
fa21631595 test: Use self.log (MarcoFalke)
fa346f7797 test: Move error string into exception (MarcoFalke)
fa1986181f test: Remove useless catch-throw (MarcoFalke)
fa2f1c55b7 move-only util data to test/functional/data/util (MarcoFalke)
faa18bf287 test: Turn util/test_runner into functional test (MarcoFalke)
fa955154c7 test: Add missing skip_if_no_bitcoin_tx (MarcoFalke)
fac9db6eb0 test: Add missing tx util to Binaries (MarcoFalke)
fa91835ec6 test: Use lowercase env var as attribute name (MarcoFalke)
fac49094cd test: Remove duplicate ConfigParser (MarcoFalke)

Pull request description:

  The `test/util/test_runner.py` has many issues:

  * The boilerplate for the test runner is duplicate or inconsistent with the other (functional) tests. For example, logging options, `ConfigParser` handling, `Binaries` handling ...
  * The cmake/ci behavior is brittle and can silently fail, as explained in https://github.com/bitcoin/bitcoin/issues/31476
  * corecheck (and likely other places that manually run the tests) completely forget to run it
  * If the test is manually called, it runs single threaded, when it could just run in parallel with the other functional tests

  Fix all issues by removing the util test_runner and moving the test logic into a new functional test file.

ACKs for top commit:
  janb84:
    re ACK fa21631595
  brunoerg:
    re-ACK fa21631595
  hebasto:
    re-ACK fa21631595, additional feedback has been addressed since my previous [review](https://github.com/bitcoin/bitcoin/pull/32697#pullrequestreview-2940350432).

Tree-SHA512: 694e647887801f002843a74011035d5ed3dfed091d3f0ae18e812a16a4680e04e60e50de0a92af7e047e8ddd6ff5a7834c690f16fd42b74ebc1674bf9989406f
2025-06-30 13:45:14 -04:00
Hennadii Stepanov
5a5ddbd789 build: Add workaround for NetBSD bug in Boost::headers target
Due to a bug in `boost_headers-config.cmake`, the `Boost::headers`
target's `INTERFACE_INCLUDE_DIRECTORIES` property is set to "/usr",
which is incorrect.
2025-06-30 11:34:29 +01:00
Hennadii Stepanov
14653b869b build: Find Boost in config mode
The `FindBoost` module has been removed by policy CMP0167.
2025-06-26 16:49:24 +01:00
merge-script
67ea4b9994 Merge bitcoin/bitcoin#32814: cmake: Explicitly specify Boost_ROOT for Homebrew's package
8800b5acc1 cmake: Explicitly specify `Boost_ROOT` for Homebrew's package (Hennadii Stepanov)

Pull request description:

  On macOS, this PR ensures that the Boost package is located at its real path rather than via the symlink in the default prefix.

  A backport to 29.x is required for https://github.com/bitcoin/bitcoin/pull/32804, as this change prevents contamination of include directories by broad locations such as `/usr/local/include` or `/opt/homebrew/include`, which take precedence over Qt’s `-iframework` flags.

  Below is the relevant change in the configuration logs on my macOS 15.5 `x64`:
  - master branch @ ead4468748:
  ```
  % cmake -B build
  <snip>
  -- Found Boost: /usr/local/include (found suitable version "1.88.0", minimum required is "1.73.0")
  <snip>
  ```
  - this PR:
  ```
  % cmake -B build
  <snip>
  -- Found Boost: /usr/local/opt/boost/include (found suitable version "1.88.0", minimum required is "1.73.0")
  <snip>
  ```

  This PR is forward-compatible with the changes proposed in https://github.com/bitcoin/bitcoin/pull/32667.

ACKs for top commit:
  fanquake:
    ACK 8800b5acc1 Checked that this plus #32805 fixes #31009

Tree-SHA512: 114bd945ec0c06a8d15b565e5b9aafc3bcfdf2a4ba4400e072b8e31053dff0f9ef423b941ee1dff2113f83e08f7fada728383ae88b3ec380b5c3e40553205f7d
2025-06-26 15:00:48 +01:00
Hennadii Stepanov
8800b5acc1 cmake: Explicitly specify Boost_ROOT for Homebrew's package
On macOS, this change ensures that the Boost package is located at its
real path rather than via the symlink in the default prefix.
2025-06-25 18:45:43 +01:00
Hennadii Stepanov
ead4468748 cmake: Use HINTS instead of PATHS in find_* commands
According to the CMake documentation, `HINTS` "should be paths computed
by system introspection, such as a hint provided by the location of
another item already found", which is precisely the case in the
`FindQRencode` module.

Entries in `HINTS` are searched before those in `PATHS`. On macOS,
Homebrew’s `libqrencode` will therefore be located at its real path
rather than via the symlink in the default prefix.
2025-06-24 20:49:27 +01:00
MarcoFalke
faa18bf287 test: Turn util/test_runner into functional test
The moved portion can be reviewed via:

--color-moved=dimmed-zebra  --color-moved-ws=ignore-all-space
2025-06-13 13:06:59 +02:00
merge-script
053bda5d9f Merge bitcoin/bitcoin#32460: fs: remove _POSIX_C_SOURCE defining
24e5fd3bed fs: remove _POSIX_C_SOURCE defining (fanquake)

Pull request description:

  On Linux systems, `_POSIX_C_SOURCE` will default to `200809L` (since glibc 2.10). There's currently no reason for us to undefine it, and then set it to an earlier value. Also tested with musl libc.

  I think if anything, the project should be settings macros like `_POSIX_C_SOURCE`, globally.

ACKs for top commit:
  hebasto:
    re-ACK 24e5fd3bed, only rebased since my recent [review](https://github.com/bitcoin/bitcoin/pull/32460#pullrequestreview-2854183748).

Tree-SHA512: 920d60058821992193616e0c73c2f7e4230a9e3ccb9d71d16493ae69696c868f4325d3dd2d4e8388749080c187aa7b205493b3e2c6986ad37440e591ebe107e1
2025-05-30 10:21:01 +01:00
Ryan Ofsky
cd97905ebc cmake: Move internal binaries from bin/ to libexec/
This change moves binaries that are not typically invoked directly by users
from the `bin/` directory to the `libexec/` directory in CMake installs and
binary releases. The goal is to simplify the contents of `bin/` for end users
while still making all binaries available when needed. After this change, the
binaries remaining in `bin/` are:

- bitcoin
- bitcoin-cli
- bitcoind
- bitcoin-qt
- bitcoin-tx
- bitcoin-util
- bitcoin-wallet

And the binaries that are moved to `libexec/` are:

- bench_bitcoin
- bitcoin-chainstate(*)
- bitcoin-gui(***)
- bitcoin-node(***)
- test_bitcoin(**)
- test_bitcoin-qt

(*) bitcoin-chainstate was previously missing an install rule and was actually
not installed even when it was enabled.

(**) test_bitcoin is the only libexec/ binary that is currently included in
bitcoin binary releases. The others are only installed when building from
source with relevant cmake options enabled.

(***) bitcoin-node and bitcoin-gui are not currently built by default or
included in binary releases but both of these changes are planned and
implemented in #31802
2025-05-29 07:51:08 -05:00
Hennadii Stepanov
55f1c2ac8b windows: Use predefined RC_INVOKED macro instead of custom one 2025-05-29 11:18:36 +01:00