#36106 bitcoin wrapper: respect CMAKE_INSTALL_BINDIR/LIBEXECDIR

ReviewabilityReviewsAgreementSize
#36106 ryanofsky bitcoin wrapper: respect CMAKE_INSTALL_BINDIR/LIBEXECDIRReady1Strong42 + 71 tests
  • Allow the bitcoin wrapper tool to locate internal executables when installed with custom directory layouts
  • Fix immediate failure on distributions like Arch Linux where CMAKE_INSTALL_LIBEXECDIR is set to lib
  • Ready to review
  • Substantive support with all raised issues addressed
  • Verified fix for custom layouts and approved the approach (hebasto)
  • Verified the fix for the distribution issue and confirmed valgrind fix (cyb3ralbert)
  • 42 lines added or modified outside tests
  • 71 lines added or modified in tests
  • 6 lines removed in total
  • 6 files, 2 commits
Build and CI#18 of 56
P3 · platform fix
  • P3 because it fixes install path handling for distros customizing libexec paths
  • Resolves missing binary lookup failures on platforms setting CMAKE_INSTALL_LIBEXECDIR to lib
IPC / multiprocess#12 of 18
P2 · bug fix
  • P2 after comparing with the other PRs here (assessed alone as P3): Raised to P2 for consistency with #36105: both are wrapper breakages on real install targets, and this one makes the wrapper fail outright on common distro layouts.
  • P3 because it fixes runtime discovery of bitcoind and bitcoin-node by the multiprocess wrapper
  • Prevents the wrapper from immediately failing with execvp on non-standard install paths
Tools and scripts#3 of 16
P2 · bug fix
  • P2 after comparing with the other PRs here (assessed alone as P3): Raised to P2 and moved up: the wrapper is simply unusable on distros with non-default libexec layout (issue #35785), the same class of supported-platform breakage as #36105, so the two must share a band.
  • P3 because it enables the bitcoin wrapper command to work on distributions with non-default layouts
Reviewability: ReadyStalePaused
Agreement: StrongPositivePositive w/ caveatsNeutralMildDisputedBlockedCrickets
Reviews: current code-review ACKs, then (+stale ACKs) and -NACKs; greener = more ACKs.
Size: lines added or modified outside tests, then in tests; greener = smaller.

Goal

Threads CMAKE_INSTALL_BINDIR and CMAKE_INSTALL_LIBEXECDIR through bitcoin-build-config.h into the bitcoin wrapper (src/bitcoin.cpp). Replaces hardcoded 'bin' and 'libexec' directory lookups with configured build-time paths and adds configure-time validation checks and functional tests for installed directory layouts.

Problem: On distributions such as Arch Linux that set CMAKE_INSTALL_LIBEXECDIR to 'lib', the installed bitcoin wrapper command cannot find internal executables like bitcoind or bitcoin-node, failing immediately with execvp 'No such file or directory'.

Reviewability

Ready

Nothing known that would invalidate a review now.

Waiting on (from the thread read):

  • nothing: all objections and suggestions are settled and latest push has been tested

Agreement

Strong

substantive support, no open objection (hebasto, cyb3ralbert, cyb3ralbert)

Thread notes: cyb3ralbert verified the valgrind fix across multiple configurations and provided a Tested ACK; the objection is now accepted.

Objections, suggestions, and questions:

ReviewerTypeHarm, request, or questionStatusMust beAuthor repliedQuote
hebasto (member)objection, correctnessFunctional test fails when CMAKE_INSTALL_BINDIR is customizedfixed · fix pushed · Author passed CMAKE_INSTALL_BINDIR to the functional test in 50450a06changedyes2026-09-01: 'The new test fails when the user specifies `CMAKE_INSTALL_BINDIR`'
Status from: 2026-09-09: ryanofsky: 'Good catch, fixed by passing CMAKE_INSTALL_BINDIR to the test now.'
hebasto (member)suggestion, maintenanceDocument the limitation on CMAKE_INSTALL_BINDIR and CMAKE_INSTALL_LIBEXECDIR values if strictly necessaryfixed · fix pushed · Author expanded comment on static assert to note bindir limitation in 50450a06answeredyes2026-09-01: 'If this is strictly necessary, it should be probably documented.'
Status from: 2026-09-09: ryanofsky: 'expanded the comment on the static assert to note the bindir limitation'
hebasto (member)suggestion, approachPerform check for unset or empty CMake variables earlier at configure stagefixed · fix pushed · Author added CMake checks for empty values in 50450a06answeredyes2026-09-01: 'Shouldn't the check for unset or empty CMake variables be performed earlier, at the configuration stage?'
Status from: 2026-09-09: ryanofsky: 'added some cmake checks for empty values'
hebasto (member)suggestion, maintenanceRemove redundant re-inclusions of GNUInstallDirs to keep code cleanfixed · fix pushed · Author removed re-inclusion from cmake/module/InstallBinaryComponent.cmake in 50450a06answeredyes2026-09-01: 'maybe consider removing the now-redundant ones to keep the code clean.'
Status from: 2026-09-09: ryanofsky: 'removed from cmake/module/InstallBinaryComponent.cmake in the latest push'
hebasto (member)suggestion, approachPlace test installation prefix directly under self.options.tmpdir rather than using the node's datadirfixed · fix pushed · Author moved test installation prefix directly under tmpdir in 50450a06answeredyes2026-09-01: 'Maybe place it directly under `self.options.tmpdir`?'
Status from: 2026-09-09: ryanofsky: 'Good idea, that does seem better and done in latest push'
cyb3ralbert (contributor)suggestion, approachSet CMAKE_INSTALL_LIBEXECDIR=lib in BITCOIN_CONFIG in a CI job to cover the wrapper changeanswered · Author agreed with the idea but prefers to leave CI configuration changes to a follow-upansweredyes2026-09-02: 'adding it to `BITCOIN_CONFIG` in one of the existing `ci/test/00_setup_env_*.sh` jobs would make the test you already wrote cover the change. That part could go in a follow-up.'
Status from: 2026-09-09: ryanofsky: 'I would definitely leave it for a followup because CI configuration changes need a different kind of review'
cyb3ralbert (contributor)suggestion, approachPrefix wrapper invocation with binaries.valgrind_cmd in run_wrapper so the new checks run under --valgrindfixed · fix pushed · Author added valgrind_cmd in 50450a06answeredyes2026-09-02: 'run_wrapper calls subprocess.run([wrapper, ...]) directly, bypassing binaries.valgrind_cmd, so the new checks are skipped under --valgrind'
Status from: 2026-09-09: ryanofsky: 'Thanks! Added that here as well'
cyb3ralbert (contributor)objection, correctnesstool_bitcoin.py fails under --valgrind because PATH is blanked before the valgrind binary is locatedaccepted · fix pushed · cyb3ralbert confirmed the fix with tACK after testingchangedyes2026-09-10: 'The last push did introduce one regression, though: `tool_bitcoin.py` fails under `--valgrind`.'
Status from: 2026-10-01: cyb3ralbert: 'The valgrind issue from my comment (10.09.2026) is fixed'

Support:

  • purpleKarrot (member) (2026-08-29): Looks good. But it also has AI co-authors. [not substantive]
  • hebasto (member) (Concept ACK, 2026-09-01): Concept ACK. [not substantive]
  • hebasto (member) (Approach ACK, 2026-09-01) [both]: Approach ACK dfc786c75ec3cdb18b824547bf586642c8bda6b5. Tested also with the `cmake --install` command's `--prefix` option.
  • cyb3ralbert (contributor) (2026-09-02) [tested]: The fix works — I built the branch and ran the #35785 scenario to verify it.
  • cyb3ralbert (contributor) (Tested ACK, 2026-10-01) [tested: test/functional/tool_bitcoin.py]: The valgrind issue from my comment (10.09.2026) is fixed: https://github.com/bitcoin/bitcoin/pull/36106#issuecomment-5617007631

Participants:

  • purpleKarrot (member, support, 1 statements 2026-08-29 to 2026-08-29): commented looks good while noting AI co-authors
  • hebasto (member, objection, 5 statements 2026-09-01 to 2026-09-01): Concept and Approach ACK, but reported test failure with custom CMAKE_INSTALL_BINDIR and raised CMake suggestions
  • cyb3ralbert (contributor, objection, 3 statements 2026-09-02 to 2026-10-01): tested against Arch Linux layout, reported valgrind regression, and confirmed fix with tACK

Files

71 lines under test/bench/ci.

  • test/functional/tool_bitcoin.py +69/-0
  • src/bitcoin.cpp +18/-5
  • CMakeLists.txt +14/-0
  • cmake/bitcoin-build-config.h.in +10/-0
  • test/config.ini.in +2/-0
  • cmake/module/InstallBinaryComponent.cmake +0/-1

Card

The short text the ranking pass compares across PRs.

PR 36106 fixes an issue where the bitcoin wrapper cannot execute underlying binaries like bitcoind or bitcoin-node on distributions with non-default install directories such as Arch Linux (issue #35785). It replaces hardcoded 'bin' and 'libexec' directory paths in src/bitcoin.cpp with build-time values from CMAKE_INSTALL_BINDIR and CMAKE_INSTALL_LIBEXECDIR, accompanied by configure-time sanity checks and functional test coverage. Review has been constructive, with an Approach ACK from hebasto and extensive testing from cyb3ralbert, and all requested test and build adjustments have been incorporated.

Data

dossier JSON · extract JSON · model ledger, generated 2026-10-02T01:25, confidence high, input hash 40a02c8076bd88a8
thread read through 2026-10-01 (15 statements), head bd3d5cf57e
labels: none

Categories

Build and CI

P3 · platform fix

Fixes CMake installation path handling for distributions that customize libexec paths. On systems like Arch Linux that set CMAKE_INSTALL_LIBEXECDIR to 'lib', installed wrapper builds currently cannot locate internal binaries and fail at runtime.

Membership: Modifies CMakeLists.txt and cmake/bitcoin-build-config.h.in to properly handle and validate CMAKE_INSTALL_BINDIR and CMAKE_INSTALL_LIBEXECDIR installation paths.

Factors: security/stability 0, bug 1, performance 0, user value 1, leverage 0

IPC / multiprocess

P2 · bug fix (assessed alone as P3; Raised to P2 for consistency with #36105: both are wrapper breakages on real install targets, and this one makes the wrapper fail outright on common distro layouts.)

Resolves a runtime binary discovery failure in the bitcoin wrapper on platforms with non-standard install paths. According to the PR description, on distributions like Arch Linux, the wrapper 'cannot find internal executables like bitcoind or bitcoin-node, failing immediately with execvp'.

Membership: Touches src/bitcoin.cpp, the multiprocess wrapper executable, and its build integration.

Factors: security/stability 0, bug 1, performance 0, user value 1, leverage 0

Tools and scripts

P2 · bug fix (assessed alone as P3; Raised to P2 and moved up: the wrapper is simply unusable on distros with non-default libexec layout (issue #35785), the same class of supported-platform breakage as #36105, so the two must share a band.)

Fixes execution failure of the bitcoin wrapper command when installed with custom directory layouts. Without this fix, the wrapper cannot invoke underlying executables on distributions using non-default install directories.

Membership: Changes src/bitcoin.cpp and adds test/functional/tool_bitcoin.py to test the bitcoin wrapper tool.

Factors: security/stability 0, bug 1, performance 0, user value 1, leverage 0