bitcoin wrapper: respect CMAKE_INSTALL_BINDIR/LIBEXECDIR #36106

pull ryanofsky wants to merge 2 commits into bitcoin:master from ryanofsky:pr/wrapexec changing 6 files +129 −6
  1. ryanofsky commented at 6:28 PM on August 27, 2026: contributor

    Problem: On Arch Linux the installed bitcoin command doesn't work: bitcoin -m node, bitcoin chainstate, and similar commands all fail with execvp failed to execute ... No such file or directory (#35785). Arch installs the programs the wrapper runs into a different directory than the wrapper looks in.

    Solution: Make the wrapper look for those programs in the directory they were actually installed to, rather than a hardcoded one. Small change to the wrapper (src/bitcoin.cpp), plus build-system changes to pass it the configured install directories, and a functional test for the installed layout. Details are in the commit messages.

    Fixes #35785. Built from earlier PRs #36037, #35789, and #36085.

  2. DrahtBot commented at 6:28 PM on August 27, 2026: contributor

    <!--e57a25ab6845829454e8d69fc972939a-->

    The following sections might be updated with supplementary metadata relevant to reviewers and maintainers.

    <!--006a51241073e994b41acfe9ec718e94-->

    External sites

    <!--021abf342d371248e50ceaed478a90ca-->

    Reviews

    See the guideline and AI policy for information on the review process.

    Type Reviewers
    Approach ACK hebasto
    Stale ACK cyb3ralbert, sedited

    If your review is incorrectly listed, please copy-paste <code>&lt;!--meta-tag:bot-skip--&gt;</code> into the comment that the bot should ignore.

    <!--174a7506f384e20aa4161008e828411d-->

    Conflicts

    Reviewers, this pull request conflicts with the following ones:

    • #36190 <sub><img src="https://drahtbot.space/ack_count/bitcoin/bitcoin/36190.svg"></sub> (test: Check bitcoin wrapper child exit status on windows by Bortlesboat)
    • #36022 <sub><img src="https://drahtbot.space/ack_count/bitcoin/bitcoin/36022.svg"></sub> (test: add coverage for bitcoin wrapper argument handling by cyb3ralbert)

    If you consider this pull request important, please also help to review the conflicting pull requests. Ideally, start with the one that should be merged first.

    <!--5faf32d7da4f0f540f40219e4f7537a3-->

  3. ryanofsky force-pushed on Aug 27, 2026
  4. DrahtBot added the label CI failed on Aug 27, 2026
  5. ryanofsky commented at 7:54 PM on August 27, 2026: contributor

    Updated 94c64d40c8e5b51122c39af9d781e360752aec11 -> dfc786c75ec3cdb18b824547bf586642c8bda6b5 (pr/wrapexec.1 -> pr/wrapexec.2, compare)<!-- end --> to fix tool_bitcoin.py installed-layout check failing in CI: pass a writable -datadir so 'bitcoin node -version' doesn't depend on the default datadir ($HOME/.bitcoin) being writable https://github.com/bitcoin/bitcoin/actions/runs/33103647138/job/98627629393

  6. DrahtBot removed the label CI failed on Aug 27, 2026
  7. purpleKarrot commented at 3:18 AM on August 29, 2026: contributor

    Looks good. But it also has AI co-authors.

  8. hebasto commented at 11:52 AM on September 1, 2026: member

    Concept ACK.

    ... it also has AI co-authors.

    From the project's AI Policy:

    Do not include agents as ... co-authors of your commits...

  9. in src/bitcoin.cpp:25 in dfc786c75e
      17 | @@ -18,6 +18,12 @@
      18 |  #include <tinyformat.h>
      19 |  #include <vector>
      20 |  
      21 | +// These are used to locate installed executables relative to the wrapper and
      22 | +// must not be empty, so a missing GNUInstallDirs value fails at compile time
      23 | +// rather than silently breaking the installed-layout lookup in ExecCommand().
      24 | +static_assert(BITCOIN_BINDIR[0] != '\0', "BITCOIN_BINDIR must not be empty");
      25 | +static_assert(BITCOIN_INTERNAL_LIBEXECDIR[0] != '\0', "BITCOIN_INTERNAL_LIBEXECDIR must not be empty");
    


    hebasto commented at 2:03 PM on September 1, 2026:
    1. This limits the user's choice of values for CMAKE_INSTALL_BINDIR and CMAKE_INSTALL_LIBEXECDIR, whereas the CMake docs do not impose any such restriction. If this is strictly necessary, it should be probably documented.

    2. Shouldn't the check for unset or empty CMake variables be performed earlier, at the configuration stage?


    ryanofsky commented at 1:11 AM on September 9, 2026:

    re: #36106 (review)

    Thanks, I expanded the comment on the static assert to note the bindir limitation and added some cmake checks for empty values. It's very likely there are more checks and improvements that can be made. This PR is just closing the biggest gap by starting to use these configuration values which were ignored before.

  10. in CMakeLists.txt:643 in dfc786c75e outdated
     636 | @@ -637,6 +637,11 @@ if(CMAKE_VERSION VERSION_GREATER_EQUAL 3.29)
     637 |    set(CMAKE_SKIP_TEST_ALL_DEPENDENCY FALSE)
     638 |  endif()
     639 |  
     640 | +# Populate CMAKE_INSTALL_BINDIR, CMAKE_INSTALL_LIBEXECDIR, etc. before the
     641 | +# subdirectories below, which substitute these values into generated files
     642 | +# (test/config.ini and src/bitcoin-build-config.h).
     643 | +include(GNUInstallDirs)
    


    hebasto commented at 2:06 PM on September 1, 2026:

    While re-inclusions of GNUInstallDirs are harmless, maybe consider removing the now-redundant ones to keep the code clean.


    ryanofsky commented at 1:12 AM on September 9, 2026:

    re: #36106 (review)

    While re-inclusions of GNUInstallDirs are harmless, maybe consider removing the now-redundant ones to keep the code clean.

    Thanks, removed from cmake/module/InstallBinaryComponent.cmake in the latest push

  11. in test/functional/tool_bitcoin.py:113 in dfc786c75e
     108 | +        # prefix constructed here, so skip the check in that case.
     109 | +        libexecdir = self.config["environment"]["LIBEXECDIR"]
     110 | +        if os.path.isabs(libexecdir):
     111 | +            self.log.info("Skipping installed-layout check; CMAKE_INSTALL_LIBEXECDIR is absolute")
     112 | +            return
     113 | +        prefix = self.nodes[0].datadir_path / "fake-prefix"
    


    hebasto commented at 2:09 PM on September 1, 2026:

    Using the node's datadir for the installation prefix seems counter-intuitive to me. Maybe place it directly under self.options.tmpdir?


    ryanofsky commented at 1:12 AM on September 9, 2026:

    re: #36106 (review)

    Using the node's datadir for the installation prefix seems counter-intuitive to me. Maybe place it directly under self.options.tmpdir?

    Good idea, that does seem better and done in latest push

  12. hebasto commented at 2:10 PM on September 1, 2026: member

    Approach ACK dfc786c75ec3cdb18b824547bf586642c8bda6b5.

    Tested also with the cmake --install command's --prefix option.

    The new test fails when the user specifies CMAKE_INSTALL_BINDIR:

    $ cmake -B build -DCMAKE_INSTALL_BINDIR="nib"
    $ cmake --build build
    $ ./build/test/functional/tool_bitcoin.py
    2026-09-01T13:53:13.898723Z TestFramework (INFO): PRNG seed is: 6212645667151046958
    2026-09-01T13:53:13.899141Z TestFramework (INFO): Initializing test directory /tmp/bitcoin_func_test_0y4u82jq
    2026-09-01T13:53:13.899475Z TestFramework (INFO): Ensure bitcoin node command invokes bitcoind by default
    2026-09-01T13:53:13.903417Z TestFramework (INFO): Ensure bitcoin -M invokes bitcoind
    2026-09-01T13:53:13.907124Z TestFramework (INFO): Ensure bitcoin -M does not accept -ipcbind
    2026-09-01T13:53:13.910846Z TestFramework (INFO): Ensure bitcoin -m invokes bitcoin-node
    2026-09-01T13:53:13.914668Z TestFramework (INFO): Ensure bitcoin -m does accept -ipcbind
    2026-09-01T13:53:13.918495Z TestFramework (INFO): Ensure bitcoin accepts -ipcbind by default
    2026-09-01T13:53:13.922104Z TestFramework (INFO): Ensure bitcoin recognizes -ipcbind in config file
    2026-09-01T13:53:13.926035Z TestFramework (INFO): Ensure installed wrapper finds internal binaries in configured libexec/
    2026-09-01T13:53:14.046585Z TestFramework (ERROR): Unexpected exception:
    Traceback (most recent call last):
      File "/home/hebasto/dev/bitcoin/test/functional/test_framework/test_framework.py", line 145, in main
        self.run_test()
        ~~~~~~~~~~~~~^^
      File "/home/hebasto/dev/bitcoin/./build/test/functional/tool_bitcoin.py", line 92, in run_test
        self.test_installed_layout()
        ~~~~~~~~~~~~~~~~~~~~~~~~~~^^
      File "/home/hebasto/dev/bitcoin/./build/test/functional/tool_bitcoin.py", line 143, in test_installed_layout
        assert_equal(result.returncode, 0)
        ~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^
      File "/home/hebasto/dev/bitcoin/test/functional/test_framework/util.py", line 94, in assert_equal
        raise AssertionError("not(%s)" % " == ".join(str(arg) for arg in (thing1, thing2) + args))
    AssertionError: not(1 == 0)
    2026-09-01T13:53:14.098127Z TestFramework (INFO): Not stopping nodes as test failed. The dangling processes will be cleaned up later.
    2026-09-01T13:53:14.098499Z TestFramework (WARNING): Not cleaning up dir /tmp/bitcoin_func_test_0y4u82jq
    2026-09-01T13:53:14.098707Z TestFramework (ERROR): Test failed. Test logging available at /tmp/bitcoin_func_test_0y4u82jq/test_framework.log
    2026-09-01T13:53:14.099086Z TestFramework (ERROR): 
    2026-09-01T13:53:14.099412Z TestFramework (ERROR): Hint: Call /home/hebasto/dev/bitcoin/test/functional/combine_logs.py '/tmp/bitcoin_func_test_0y4u82jq' to consolidate all logs
    2026-09-01T13:53:14.099593Z TestFramework (ERROR): 
    2026-09-01T13:53:14.099752Z TestFramework (ERROR): If this failure happened unexpectedly or intermittently, please file a bug and provide a link or upload of the combined log.
    2026-09-01T13:53:14.099975Z TestFramework (ERROR): https://github.com/bitcoin/bitcoin/issues
    2026-09-01T13:53:14.100138Z TestFramework (ERROR): 
    
  13. cyb3ralbert commented at 9:30 AM on September 2, 2026: contributor

    The fix works — I built the branch and ran the #35785 scenario to verify it. I did find two gaps in the test coverage, though: one that seems worth fixing here, and one that could be a follow-up.

    test_installed_layout derives other_dir = "lib" if libexecdir != "lib" else "libexec", which at the default CMAKE_INSTALL_LIBEXECDIR=libexec is exactly the pair the old wrapper hardcodes:

    CMAKE_INSTALL_LIBEXECDIR wrapper result
    libexec (default) this branch pass
    libexec (default) before this change pass
    lib this branch pass
    lib before this change fail — AssertionError: not(1 == 0)

    CMAKE_INSTALL_LIBEXECDIR does not appear anywhere under ci/ or .github/, so every job builds with the GNUInstallDirs default (libexec) and none of them can tell the two wrappers apart — a regression to a hardcoded directory would stay green. The lib value is what Arch actually uses (-DCMAKE_INSTALL_LIBEXECDIR=lib in its PKGBUILD), so 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.

    The smaller one: run_wrapper calls subprocess.run([wrapper, ...]) directly, bypassing binaries.valgrind_cmd, so the new checks are skipped under --valgrind — 25 ms and 63 ms against ~2 s for each neighbouring check in the same run. The same point was raised on #36022 in this file and fixed there by prefixing self.nodes[0].binaries.valgrind_cmd; it matters here because that command carries --trace-children=yes, which is "Needed for 'bitcoin' wrapper".

  14. ryanofsky force-pushed on Sep 9, 2026
  15. ryanofsky commented at 1:30 AM on September 9, 2026: contributor

    <!-- begin push-3 -->

    Updated dfc786c75ec3cdb18b824547bf586642c8bda6b5 -> 50450a06dceffe6d86cef529c77d81be18b7852b (pr/wrapexec.2 -> pr/wrapexec.3, compare)<!-- end --> with review suggestions.


    re: hebasto #36106#pullrequestreview-5079009323

    The new test fails when the user specifies CMAKE_INSTALL_BINDIR:

    Good catch, fixed by passing CMAKE_INSTALL_BINDIR to the test now.


    re: cyb3ralbert #36106 (comment)

    The lib value is what Arch actually uses (-DCMAKE_INSTALL_LIBEXECDIR=lib in its PKGBUILD), so 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.

    Yeah it is hard to have good test coverage for build-time configuration code, but I agree it could be a good idea to change one of the CI job configurations to try setting nonstandard directories and make sure things don't break.

    I would definitely leave it for a followup because CI configuration changes need a different kind of review and probably a different set of reviewers than this code change.

    fixed there by prefixing self.nodes[0].binaries.valgrind_cmd

    Thanks! Added that here as well

  16. cyb3ralbert commented at 10:17 AM on September 10, 2026: contributor

    Rebuilt at 50450a06 and re-ran the layouts. -DCMAKE_INSTALL_LIBEXECDIR=lib, the case from my earlier comment, passes.

    A non-default bindir passes as well: with -DCMAKE_INSTALL_BINDIR=nib the test fails on dfc786c7 (AssertionError: not(1 == 0)) and passes here. The new empty-value checks exit 1 as intended.

    The last push did introduce one regression, though: tool_bitcoin.py fails under --valgrind.

    cmake -B build && cmake --build build -j4 --target bitcoin bitcoind
    python3 test/functional/tool_bitcoin.py --configfile=build/test/config.ini --valgrind
    
    TestFramework (INFO): Ensure installed wrapper finds internal binaries in configured libexec/
    TestFramework (ERROR): Unexpected exception:
    Traceback (most recent call last):
      File ".../test/functional/tool_bitcoin.py", line 148, in test_installed_layout
      File ".../test/functional/tool_bitcoin.py", line 143, in run_wrapper
      File "/usr/lib/python3.11/subprocess.py", line 1901, in _execute_child
    FileNotFoundError: [Errno 2] No such file or directory: 'valgrind'
    

    run_wrapper combines two things: env["PATH"] = "", which was already there, and binaries.valgrind_cmd, which is new in this push. valgrind_cmd[0] is the bare name "valgrind" (test_framework/util.py), and once env is passed to subprocess.run, the executable is resolved against env["PATH"] — which is empty. So it fails regardless of the install dirs.

    On dfc786c7 the file did pass under --valgrind, but the two checks took 20 ms and 63 ms, i.e. they never ran under valgrind at all — which was the point of my earlier comment.

    Resolving valgrind before PATH is blanked keeps the intent of the change:

    valgrind_cmd = self.nodes[0].binaries.valgrind_cmd
    if valgrind_cmd:
        valgrind_cmd = [shutil.which(valgrind_cmd[0]), *valgrind_cmd[1:]]
    return subprocess.run(
        valgrind_cmd + [str(wrapper), "node", f"-datadir={datadir}", "-version"],
        capture_output=True, env=env, timeout=60)
    

    With that, --valgrind is green and the two checks take 1.94 s and 0.74 s, so they do run under valgrind now. Without --valgrind it stays green. On Windows it is a no-op — valgrind_cmd is empty there.

    Environment: Debian, gcc 12.2.0, Release, BUILD_TESTS=OFF, ENABLE_IPC=OFF, valgrind 3.19.0, Python 3.11.

  17. ryanofsky force-pushed on Sep 10, 2026
  18. ryanofsky commented at 3:38 PM on September 10, 2026: contributor

    <!-- begin push-4 -->

    Updated 50450a06dceffe6d86cef529c77d81be18b7852b -> bd3d5cf57e576a48b8ebf4f06b54e4412ff315a4 (pr/wrapexec.3 -> pr/wrapexec.4, compare)<!-- end --> with another fix for valgrind #36106 (comment) and a few test cleanups

  19. cyb3ralbert commented at 6:17 AM on October 1, 2026: contributor

    tACK bd3d5cf57e576a48b8ebf4f06b54e4412ff315a4

    The valgrind issue from my comment (10.09.2026) is fixed: #36106 (comment)

    Ran test/functional/tool_bitcoin.py:

    • bd3d5cf5, default layout (-DCMAKE_INSTALL_BINDIR=bin -DCMAKE_INSTALL_LIBEXECDIR=libexec): pass, also with --valgrind
    • bd3d5cf5, -DCMAKE_INSTALL_LIBEXECDIR=lib (#35785): pass
    • bd3d5cf5, -DCMAKE_INSTALL_BINDIR=nib: pass
    • 57d7e8d3 alone, -DCMAKE_INSTALL_LIBEXECDIR=lib: pass (the old wrapper does not find bitcoind there, as the test expects); default layout: pass

    Debian 12 (bookworm), gcc 12.2.0, cmake 3.25.1, Python 3.11.2, valgrind 3.19.0 -DCMAKE_BUILD_TYPE=Release -DBUILD_TESTS=OFF -DENABLE_IPC=OFF -DBUILD_GUI=OFF

  20. DrahtBot requested review from hebasto on Oct 1, 2026
  21. sedited approved
  22. sedited commented at 12:43 PM on November 5, 2026: contributor

    ACK bd3d5cf57e576a48b8ebf4f06b54e4412ff315a4

  23. hebasto commented at 2:36 PM on November 12, 2026: member

    Tested bd3d5cf57e576a48b8ebf4f06b54e4412ff315a4 in the Nix shell:

    $ export out=/tmp/inst prefix=/tmp/inst
    $ cmakeBuildDir=build-nix cmakeConfigurePhase
    $ cmake --build . -j$(nproc) --target bitcoin bitcoin-node
    $ cmake --install . --component bitcoin && cmake --install . --component bitcoin-node
    $ /tmp/inst/bin/bitcoin -m node -version
    Error: execvp failed to execute '/tmp/inst/bin/bitcoin-node': No such file or directory
    Try '/tmp/inst/bin/bitcoin --help' for more information.
    
    
  24. test: characterize installed bitcoin wrapper libexec lookup
    Add a functional test for the installed-layout executable lookup in the
    `bitcoin` wrapper. When installed in a `bin/` directory the wrapper looks
    for internal binaries like `bitcoind` in a sibling directory under the
    same prefix; this path is never exercised by the normal build-tree tests
    because every binary sits next to the wrapper there.
    
    The test builds a fake install prefix under tmpdir, copies the wrapper
    into `bin/` and `bitcoind` into an internal directory (not next to the
    wrapper), and runs the wrapper by absolute path with PATH cleared so a
    lookup miss cannot be satisfied by an unrelated system binary. Under
    --valgrind, resolve the valgrind executable via shutil.which() before PATH
    is blanked, since subprocess.run() resolves a bare command name against
    the env it is given rather than the calling process's real PATH.
    
    This characterizes current behavior — the wrapper resolves binaries from
    hardcoded `bin/` and `libexec/` directories — so a following commit can
    change it to honor CMAKE_INSTALL_BINDIR and CMAKE_INSTALL_LIBEXECDIR and
    verify the result. Also add the absolute CMAKE_INSTALL_FULL_BINDIR and
    CMAKE_INSTALL_FULL_LIBEXECDIR values to test/config.ini.in, and lay out the
    fake install tree from the bindir name and the relative path from bindir to
    libexecdir, so the test covers both relative settings (the default) and
    absolute ones (as Nix passes them). Include GNUInstallDirs at the top level
    before add_subdirectory(test) so these variables are set when config.ini is
    generated.
    
    Adapted from https://github.com/bitcoin/bitcoin/pull/36037.
    
    Co-Authored-By: Avecci-Claussen <cto@greybound.tech>
    Co-Authored-By: cyb3ralbert <cyberalbert@protonmail.ch>
    Co-Authored-By: Hennadii Stepanov <32963518+hebasto@users.noreply.github.com>
    This change was written with Claude Opus 4.8 (1M context).
    56d9cb6032
  25. build: respect CMAKE_INSTALL_BINDIR/LIBEXECDIR in bitcoin wrapper
    Switch from hardcoded "bin"/"libexec" strings to CMAKE_INSTALL_BINDIR and
    CMAKE_INSTALL_LIBEXECDIR in the installed-layout executable lookup, so the
    wrapper works on distributions that configure non-default install
    directories. Previously `bitcoin -m node`, `bitcoin chainstate`, and
    similar subcommands failed with "execvp failed to execute" on Arch Linux,
    which sets CMAKE_INSTALL_LIBEXECDIR=lib (#35785).
    
    Have CMake compute the name of the bindir and the path from the bindir to
    the libexecdir (e.g. "bin" and "../libexec") from CMAKE_INSTALL_FULL_BINDIR
    and CMAKE_INSTALL_FULL_LIBEXECDIR, and thread both values through
    bitcoin-build-config.h. Using the FULL values means the lookup works whether
    the settings are relative to the install prefix or absolute, as Nix sets
    them. Add configure-time FATAL_ERROR guards for empty values (complement to
    the compile-time static_asserts). Remove the now-redundant
    include(GNUInstallDirs) from InstallBinaryComponent.cmake.
    
    Fixes #35785.
    
    The fix and test build on #36037, #35789, and #36085.
    
    Co-Authored-By: Avecci-Claussen <cto@greybound.tech>
    Co-Authored-By: Andrew Barnes <bortstheboat@gmail.com>
    Co-Authored-By: riba2534 <riba2534@qq.com>
    Co-Authored-By: Hennadii Stepanov <32963518+hebasto@users.noreply.github.com>
    This change was written with Claude Opus 4.8 (1M context).
    76bf68ec05
  26. DrahtBot added the label Needs rebase on Nov 12, 2026
  27. ryanofsky force-pushed on Nov 13, 2026
  28. in src/bitcoin.cpp:242 in 7d5cab41d8 outdated
     240 | -    // in libexec/
     241 | -    (wrapper_dir.filename() == "bin" && try_exec(wrapper_dir.parent_path() / "libexec" / arg0.filename())) ||
     242 | +    // If wrapper is installed in the bindir (e.g. bin/), look for the target
     243 | +    // executable in the configured internal-executable directory (libexecdir),
     244 | +    // using the path from the bindir to the libexecdir (e.g. ../libexec).
     245 | +    (wrapper_dir.filename() == BITCOIN_BINDIR_NAME && try_exec((wrapper_dir / BITCOIN_INTERNAL_LIBEXECDIR / arg0.filename()).lexically_normal())) ||
    


    ryanofsky commented at 3:54 PM on November 13, 2026:

    re: #36106#pullrequestreview-5876277519

    In commit "build: respect CMAKE_INSTALL_BINDIR/LIBEXECDIR in bitcoin wrapper" (7d5cab41d863d31f49e3a3d6dc661fbb975d7be9)

    Error: execvp failed to execute '/tmp/inst/bin/bitcoin-node': No such file or directory

    Thanks for testing this. It is a regression from this PR. The Nix cmake setup hook passes absolute values (-DCMAKE_INSTALL_BINDIR=$out/bin, -DCMAKE_INSTALL_LIBEXECDIR=$out/libexec), and this line compares the wrapper's directory name with the whole BITCOIN_BINDIR value, so "bin" == "/tmp/inst/bin" is false and the libexec lookup is skipped. The wrapper then only tries bin/bitcoin-node, which is the path in the error. On master the hardcoded bin and libexec names happen to match the Nix layout, so it works there. The functional test didn't catch this because it skips absolute values.

    This is the limitation you pointed out in #36106 (review), and documenting it wasn't enough. The latest push fixes it by having CMake compute the bindir name and the path from the bindir to the libexecdir from CMAKE_INSTALL_FULL_BINDIR and CMAKE_INSTALL_FULL_LIBEXECDIR, so the wrapper looks in ../libexec (or ../lib on Arch) whether the configured values are relative or absolute. The test now uses the absolute values too, instead of skipping them.

  29. in test/functional/tool_bitcoin.py:128 in 7d5cab41d8 outdated
     123 | +
     124 | +        def run_wrapper(wrapper):
     125 | +            valgrind_cmd = self.nodes[0].binaries.valgrind_cmd
     126 | +            if valgrind_cmd:
     127 | +                # which(): PATH is blanked below, so resolve valgrind now.
     128 | +                valgrind_cmd = [shutil.which(valgrind_cmd[0]) or valgrind_cmd[0], *valgrind_cmd[1:]]
    


    ryanofsky commented at 3:54 PM on November 13, 2026:

    re: cyb3ralbert #36106 (comment)

    In commit "test: characterize installed bitcoin wrapper libexec lookup" (70f37ab154559104382ad9d83ca524cefbda8455)

    The valgrind issue from my comment (10.09.2026) is fixed

    Thanks for re-testing all the layouts and for the shutil.which() fix, which is what the current version uses.


    cyb3ralbert commented at 9:58 AM on November 14, 2026:

    Thanks, Ryan! You're welcome.

  30. ryanofsky commented at 3:57 PM on November 13, 2026: contributor

    Thanks for the testing and reviews.

    <!-- begin push-5 -->

    Rebased bd3d5cf57e576a48b8ebf4f06b54e4412ff315a4 -> 7d5cab41d863d31f49e3a3d6dc661fbb975d7be9 (pr/wrapexec.4 -> pr/wrapexec.5, compare)<!-- end --> due to conflict with #36105, and to fix the wrapper not finding internal executables when CMAKE_INSTALL_BINDIR/LIBEXECDIR are absolute paths, as Nix sets them #36106#pullrequestreview-5876277519. The wrapper now uses a bindir-to-libexecdir relative path computed by CMake from the CMAKE_INSTALL_FULL_* values, and the test covers absolute paths instead of skipping them.

  31. DrahtBot added the label CI failed on Nov 13, 2026
  32. DrahtBot removed the label Needs rebase on Nov 13, 2026
  33. hebasto commented at 6:40 PM on November 13, 2026: member

    From https://github.com/bitcoin/bitcoin/actions/runs/43457298073/job/131994688358?pr=36106:

    457/503 - tool_bitcoin.py failed (exit code 1), Duration: 0 s
    
    stdout:
    2026-11-13T16:26:19.252968Z TestFramework (INFO): PRNG seed is: 9049126316449598964
    
    2026-11-13T16:26:19.304595Z TestFramework (INFO): Initializing test directory D:\a\bitcoin\bitcoin\_ _\test_runner_₿_🏃_20261113_161709\tool_bitcoin_44
    
    2026-11-13T16:26:19.306002Z TestFramework (INFO): Ensure bitcoin node command invokes bitcoind by default
    
    2026-11-13T16:26:19.340858Z TestFramework (INFO): Ensure bitcoin -M invokes bitcoind
    
    2026-11-13T16:26:19.368820Z TestFramework (INFO): Ensure bitcoin -M does not accept -ipcbind
    
    2026-11-13T16:26:19.399672Z TestFramework (INFO): Ensure installed wrapper finds internal binaries in configured ..\libexec/
    
    2026-11-13T16:26:19.489651Z TestFramework (ERROR): Unexpected exception:
    
    Traceback (most recent call last):
    
      File "D:\a\bitcoin\bitcoin\build\test\functional\test_framework\test_framework.py", line 146, in main
    
        self.run_test()
    
        ~~~~~~~~~~~~~^^
    
      File "D:\a\bitcoin\bitcoin\build\test\functional\tool_bitcoin.py", line 82, in run_test
    
        self.test_installed_layout()
    
        ~~~~~~~~~~~~~~~~~~~~~~~~~~^^
    
      File "D:\a\bitcoin\bitcoin\build\test\functional\tool_bitcoin.py", line 138, in test_installed_layout
    
        assert_equal(result.returncode, 0)
    
        ~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^
    
      File "D:\a\bitcoin\bitcoin\build\test\functional\test_framework\util.py", line 96, in assert_equal
    
        raise AssertionError("not(%s)" % " == ".join(str(arg) for arg in (thing1, thing2) + args))
    
    AssertionError: not(3221225781 == 0)
    
    2026-11-13T16:26:19.543265Z TestFramework (INFO): Not stopping nodes as test failed. The dangling processes will be cleaned up later.
    
    2026-11-13T16:26:19.543420Z TestFramework (WARNING): Not cleaning up dir D:\a\bitcoin\bitcoin\_ _\test_runner_₿_🏃_20261113_161709\tool_bitcoin_44
    
    2026-11-13T16:26:19.543478Z TestFramework (ERROR): Test failed. Test logging available at D:\a\bitcoin\bitcoin\_ _\test_runner_₿_🏃_20261113_161709\tool_bitcoin_44/test_framework.log
    
    2026-11-13T16:26:19.543663Z TestFramework (ERROR): 
    
    2026-11-13T16:26:19.543895Z TestFramework (ERROR): Hint: Call D:\a\bitcoin\bitcoin\build\test\functional\combine_logs.py 'D:\a\bitcoin\bitcoin\_ _\test_runner_₿_🏃_20261113_161709\tool_bitcoin_44' to consolidate all logs
    
    2026-11-13T16:26:19.543945Z TestFramework (ERROR): 
    
    2026-11-13T16:26:19.543975Z TestFramework (ERROR): If this failure happened unexpectedly or intermittently, please file a bug and provide a link or upload of the combined log.
    
    2026-11-13T16:26:19.544026Z TestFramework (ERROR): https://github.com/bitcoin/bitcoin/issues
    
    2026-11-13T16:26:19.544060Z TestFramework (ERROR): 
    
    
    
    stderr:
    
    
    Combine the logs and print the last 99999999 lines ...
    
  34. in test/functional/tool_bitcoin.py:114 in 7d5cab41d8 outdated
     109 | +            # <bindir>/<internal_dir>/bitcoind, nesting the bindir deep enough
     110 | +            # that ".." components in internal_dir stay inside <prefix>/<name>.
     111 | +            wrapper_dir = prefix / name / Path(*["sub"] * internal_dir.parts.count("..")) / bindir.name
     112 | +            internal_path = Path(os.path.normpath(wrapper_dir / internal_dir))
     113 | +            wrapper_dir.mkdir(parents=True)
     114 | +            internal_path.mkdir(parents=True, exist_ok=True)
    


    ryanofsky commented at 8:15 PM on November 16, 2026:

    re: hebasto #36106 (comment)

    In commit "test: characterize installed bitcoin wrapper libexec lookup" (56d9cb60326b5944637774fdfc9de10eebcc2076)

    AssertionError: not(3221225781 == 0)

    Thanks for flagging this. 3221225781 is 0xC0000135 (STATUS_DLL_NOT_FOUND). That CI job links dependencies as DLLs, which vcpkg copies next to the executables in build/bin, but the test only copied bitcoin.exe and bitcoind.exe into its fake install tree, so they couldn't start there. It showed up in the last push because tool_bitcoin.py was skipped on Windows until #36105. The latest push copies the DLLs next to the copied executables.

  35. ryanofsky force-pushed on Nov 16, 2026
  36. ryanofsky commented at 8:17 PM on November 16, 2026: contributor

    <!-- begin push-6 -->

    Updated 7d5cab41d863d31f49e3a3d6dc661fbb975d7be9 -> 76bf68ec0522f9cd6d857e8402fd97e1dae8fb98 (pr/wrapexec.5 -> pr/wrapexec.6, compare)<!-- end --> to fix CI: copy DLLs next to the executables the installed-layout test copies, since tool_bitcoin.py now runs on Windows after #36105 and the DLL build couldn't start them https://github.com/bitcoin/bitcoin/actions/runs/43457298073/job/131994688358

  37. DrahtBot removed the label CI failed on Nov 16, 2026

github-metadata-mirror

This is a metadata mirror of the GitHub repository bitcoin/bitcoin. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2026-12-01 02:51 UTC

This site is hosted by @0xB10C
More mirrored repositories can be found on mirror.b10c.me