ipc: add windows support #32387

pull ryanofsky wants to merge 33 commits into bitcoin:master from ryanofsky:pr/ipc-win changing 99 files +2592 −839
  1. ryanofsky commented at 12:43 PM on April 30, 2025: contributor

    These changes make IPC features work on windows, resolving https://github.com/bitcoin-core/libmultiprocess/issues/53 and https://github.com/bitcoin-core/libmultiprocess/issues/114

    This is a draft because it is based on https://github.com/bitcoin-core/libmultiprocess/pull/231, https://github.com/bitcoin-core/libmultiprocess/pull/317, https://github.com/bitcoin-core/libmultiprocess/pull/318.


    This PR is part of the process separation project.

    <!-- begin based-on -->

    This is based on #. The non-base commits are:

  2. DrahtBot commented at 12:43 PM on April 30, 2025: contributor

    <!--e57a25ab6845829454e8d69fc972939a-->

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

    <!--006a51241073e994b41acfe9ec718e94-->

    Code Coverage & Benchmarks

    For details see: https://corecheck.dev/bitcoin/bitcoin/pulls/32387.

    <!--021abf342d371248e50ceaed478a90ca-->

    Reviews

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

    Type Reviewers
    Concept ACK hebasto

    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)
    • #36167 <sub><img src="https://drahtbot.space/ack_count/bitcoin/bitcoin/36167.svg"></sub> ([RFC] Enable -Wunused by fanquake)
    • #36106 <sub><img src="https://drahtbot.space/ack_count/bitcoin/bitcoin/36106.svg"></sub> (bitcoin wrapper: respect CMAKE_INSTALL_BINDIR/LIBEXECDIR by ryanofsky)
    • #36097 <sub><img src="https://drahtbot.space/ack_count/bitcoin/bitcoin/36097.svg"></sub> (mining: replace interrupt methods with cancellation arguments by xyzconstant)
    • #36074 <sub><img src="https://drahtbot.space/ack_count/bitcoin/bitcoin/36074.svg"></sub> (scripted-diff: [test] Add util/check.h includes for assertions by maflcko)
    • #36060 <sub><img src="https://drahtbot.space/ack_count/bitcoin/bitcoin/36060.svg"></sub> (build: require KJ exception support for IPC by 151henry151)
    • #35916 <sub><img src="https://drahtbot.space/ack_count/bitcoin/bitcoin/35916.svg"></sub> (fuzz: improve ipc fuzz coverage by enirox001)
    • #35911 <sub><img src="https://drahtbot.space/ack_count/bitcoin/bitcoin/35911.svg"></sub> (Warn on and add missing [[noreturn]] by fanquake)
    • #31260 <sub><img src="https://drahtbot.space/ack_count/bitcoin/bitcoin/31260.svg"></sub> (scripted-diff: Type-safe settings retrieval by ryanofsky)
    • #29409 <sub><img src="https://drahtbot.space/ack_count/bitcoin/bitcoin/29409.svg"></sub> (multiprocess: Add capnp wrapper for Chain interface by ryanofsky)
    • #19461 <sub><img src="https://drahtbot.space/ack_count/bitcoin/bitcoin/19461.svg"></sub> (multiprocess: Add bitcoin-gui -ipcconnect option by ryanofsky)
    • #19460 <sub><img src="https://drahtbot.space/ack_count/bitcoin/bitcoin/19460.svg"></sub> (multiprocess: Add bitcoin-wallet -ipcconnect option by ryanofsky)
    • #10102 <sub><img src="https://drahtbot.space/ack_count/bitcoin/bitcoin/10102.svg"></sub> (Multiprocess bitcoin by ryanofsky)

    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-->

    LLM Linter (✨ experimental)

    Possible typos and grammar issues:

    • It it possible to obtain the actual process ID from handles by calling the GetProcessId API. -> It is possible to obtain the actual process ID from handles by calling the GetProcessId API. [“It it” is a typo]

    <sup>2026-10-02 03:04:33</sup>

  3. ryanofsky force-pushed on Apr 30, 2025
  4. ryanofsky commented at 12:47 PM on April 30, 2025: contributor

    Updated 9df5a838aa9c020adf8d024393749d75bd932ec2 -> 87432b6a4325e09a13c912d77b386daa3832b34d (pr/ipc-win.1 -> pr/ipc-win.2, compare) fixing accidentally disabled tests

  5. hebasto commented at 1:47 PM on April 30, 2025: member

    Concept ACK.

  6. DrahtBot added the label CI failed on Apr 30, 2025
  7. DrahtBot commented at 3:00 PM on April 30, 2025: contributor

    <!--85328a0da195eb286784d51f73fa0af9-->

    🚧 At least one of the CI tasks failed. <sub>Task multiprocess, i686, DEBUG: https://github.com/bitcoin/bitcoin/runs/41420704031</sub> <sub>LLM reason (✨ experimental): The CI failure is caused by an assertion failure in the IPC test suite due to a nullptr dereference.</sub>

    <details><summary>Hints</summary>

    Try to run the tests locally, according to the documentation. However, a CI failure may still happen due to a number of reasons, for example:

    • Possibly due to a silent merge conflict (the changes in this pull request being incompatible with the current code in the target branch). If so, make sure to rebase on the latest commit of the target branch.

    • A sanitizer issue, which can only be found by compiling with the sanitizer and running the affected test.

    • An intermittent issue.

    Leave a comment here, if you need help tracking down a confusing failure.

    </details>

  8. Sjors commented at 7:12 PM on April 30, 2025: member

    I guess the easiest way to test this would be to combine it with:

    1. #31756 so I can bake a Widnows guix build instead of learning to compile on Windows; and
    2. #30437 to have something to test against
  9. ryanofsky force-pushed on Apr 30, 2025
  10. ryanofsky commented at 9:24 PM on April 30, 2025: contributor

    Updated 87432b6a4325e09a13c912d77b386daa3832b34d -> 0a35e21103b7fed6e46c809e9029446277b6f6ee (pr/ipc-win.2 -> pr/ipc-win.3, compare) to fix test CI failure https://cirrus-ci.com/task/5583224107171840 due to bad std::optional access Updated 0a35e21103b7fed6e46c809e9029446277b6f6ee -> 27328195136754babe8d8f5d99f4f0b6a5ab2e55 (pr/ipc-win.3 -> pr/ipc-win.4, compare) to fix CI test failure https://cirrus-ci.com/task/5668412652781568 in rpc_misc.py echoipc call due to CLOEXEC flag


    re: #32387 (comment)

    Agree changes in #31756 should make this easier to test (though I might be able to make a minimal change here to turn on multiprocess windows build).

    Having #30437 or #32297 merged first would also make test coverage more meaningful because they both add functional tests for -ipcbind and -ipcconect options.

    In general there is more work to do here and I hope other PRs can be merged before this one.

  11. ryanofsky force-pushed on May 1, 2025
  12. DrahtBot removed the label CI failed on May 1, 2025
  13. ryanofsky force-pushed on May 2, 2025
  14. ryanofsky commented at 9:12 PM on May 2, 2025: contributor

    Updated 27328195136754babe8d8f5d99f4f0b6a5ab2e55 -> f215e742045401ab386f0cd67d06b358558ecf89 (pr/ipc-win.4 -> pr/ipc-win.5, compare) fixing many windows bugs.

    With this update, IPC code is mostly working on windows: mpexample and mptest programs work, test_bitcoin IPC calls over socketpairs work, bitcoin-node echoipc command is able to create a subprocess and successfully make calls to it, and bitcoin-node -ipcbind option creates a unix socket file. Some problems remain:

    • This is a hang on shutdown that prevents child processes from exiting. You can kill them manually and everything works fine, but this problem needs to be debugged.
    • bitcoin-mine -ipcconnect seems unable to find the unix socket, failing with "Error: The system cannot find the file specified" even though the socket exists. Two test_bitcoin unix socket tests also give similar errors.
    • The test_bitcoin parse address tests fails because some checks are looking for / not \ separators.
  15. ryanofsky force-pushed on May 6, 2025
  16. ryanofsky commented at 3:09 PM on May 6, 2025: contributor

    Updated f215e742045401ab386f0cd67d06b358558ecf89 -> 5f272b7cc3b72fe4a59f590825b68dc2c342baca (pr/ipc-win.5 -> pr/ipc-win.6, compare) with more fixes.

    <!-- begin push-7 -->

    Updated 5f272b7cc3b72fe4a59f590825b68dc2c342baca -> 13aef5ad7669e0302e27f96876615907dc98c3c3 (pr/ipc-win.6 -> pr/ipc-win.7, compare)<!-- end --> improving comments.

    With the new fixes, IPC is fully working on windows: both creating child processes and communicating over socket pairs, and listening and making connections over unix sockets. (Latter currently requires adding a SetupNetworking call to bitcoin-mine in #30437). The code changes are also mostly straightforward and clean, although I want to split commits to make them easier to review.

    Will leave this PR in a draft state for now since other multiprocess PRs should have higher priority (see tracking issue #28722)

    --

    <!-- begin push-8 -->

    Rebased 13aef5ad7669e0302e27f96876615907dc98c3c3 -> cbd06846803e800f23f4498e27f930e09d260000 (pr/ipc-win.7 -> pr/ipc-win.8, compare)<!-- end --> due to conflicts with #32345

    <!-- begin push-9 -->

    Rebased cbd06846803e800f23f4498e27f930e09d260000 -> 3d0737720ae6bbd2c3eb4382e41fa49dd3d727d9 (pr/ipc-win.8 -> pr/ipc-win.9, compare)<!-- end --> due to conflicts with #33517

    <!-- begin push-10 -->

    Rebased 3d0737720ae6bbd2c3eb4382e41fa49dd3d727d9 -> 24f5e883f20d0c65bc163dba0e3d8c2f031c63c7 (pr/ipc-win.9 -> pr/ipc-win.10, compare)<!-- end --> due to conflict with #33960

    <!-- begin push-11 -->

    Rebased 24f5e883f20d0c65bc163dba0e3d8c2f031c63c7 -> ac0b14c567f40ed813f9bf2ebe316fcd8249ffbe (pr/ipc-win.10 -> pr/ipc-win.11, compare)<!-- end --> on top of https://github.com/bitcoin-core/libmultiprocess/pull/231 pr/win.3 and #35084 pr/ipc-wins.1

    <!-- begin push-12 -->

    Updated ac0b14c567f40ed813f9bf2ebe316fcd8249ffbe -> 533b3460457c0f26727646677cccb303a4036c7e (pr/ipc-win.11 -> pr/ipc-win.12, compare)<!-- end --> to fix ci errors https://github.com/bitcoin/bitcoin/actions/runs/24465570509 vcpkg capnproto dependency error, ipc_test cmake include directory errors, lint subtree error

    <!-- begin push-13 -->

    Updated 533b3460457c0f26727646677cccb303a4036c7e -> ec10ff7c9d9a82b5caee50e2d0d6b90a55fa8ea4 (pr/ipc-win.12 -> pr/ipc-win.13, compare)<!-- end --> to fix ci errors https://github.com/bitcoin/bitcoin/actions/runs/24539458137 in base prs: lint ipc_test.cpp boost test name error, and HasReason boost test include errors

    <!-- begin push-14 -->

    Updated ec10ff7c9d9a82b5caee50e2d0d6b90a55fa8ea4 -> 23b1d507334c6e429ca87ad6af2b401313a5623b (pr/ipc-win.13 -> pr/ipc-win.14, compare)<!-- end --> to fix bitcoin core macos exception type error https://github.com/bitcoin/bitcoin/actions/runs/24542080405/job/71749864777?pr=32387

    <!-- begin push-15 -->

    Updated 23b1d507334c6e429ca87ad6af2b401313a5623b -> 0211390861baa245ec77766f9a6f1d17ad441649 (pr/ipc-win.14 -> pr/ipc-win.15, compare)<!-- end --> to fix pthreads include error https://github.com/bitcoin/bitcoin/actions/runs/24543367909/job/71753783189?pr=32387 in native windows build and enable ipc in windows cross builds

    <!-- begin push-16 -->

    Updated 0211390861baa245ec77766f9a6f1d17ad441649 -> cac16bb4859b6b2ec96063ea52d71d997643c87c (pr/ipc-win.15 -> pr/ipc-win.16, compare)<!-- end --> to fix CI errors https://github.com/bitcoin/bitcoin/actions/runs/24545738655/job/71762261393?pr=32387 bitcoin-gui RC file error and commit message formatting lint error, also adding mp::MakeStream method to simplify changes

    <!-- begin push-17 -->

    Updated cac16bb4859b6b2ec96063ea52d71d997643c87c -> 6baabfe441da0a6430993d0e11d407a6416ece6f (pr/ipc-win.16 -> pr/ipc-win.17, compare)<!-- end --> to fix more RC file errors caused by build path problem in previous attempted fix https://github.com/bitcoin/bitcoin/actions/runs/24568789956/job/71836011315?pr=32387, which caused cross compiled windows builds to now fail as well as the native build. Also move previous fix for pthreads include error to a new commit also implementing a fix for a unistd include error in the msvc build. Also rearrange commits and add a whitespace fix to fix a lint error.

    <!-- begin push-18 -->

    Updated 6baabfe441da0a6430993d0e11d407a6416ece6f -> d53bc6c783e7e91bc06f23140f8415eb48c9ab0b (pr/ipc-win.17 -> pr/ipc-win.18, compare)<!-- end --> to fix another msvc (non-mingw) posix error with execvp, and a wsasocket error https://github.com/bitcoin/bitcoin/actions/runs/24575486745/job/71859566530?pr=32387, also more cross-compiled test manifest rc errors

    <!-- begin push-19 -->

    Updated d53bc6c783e7e91bc06f23140f8415eb48c9ab0b -> aa323482ccb40edf3b6bfed16d3e136257ca5d6e (pr/ipc-win.18 -> pr/ipc-win.19, compare)<!-- end --> to fix more ci errors https://github.com/bitcoin/bitcoin/actions/runs/24582112980/job/71882361998?pr=32387: MSVC errors dealing with std::variant (known compiler bug) and workaround for lack of fork in mpgen(). Also ipc_tests.cpp fix for incorrect closesocket call in test. Also added /k option to msvc build to try to get more complete lists of compiler errors

    <!-- begin push-20 -->

    Updated aa323482ccb40edf3b6bfed16d3e136257ca5d6e -> 68bc7eeff2ffd44d79e8669fc8dc8b335ae18e7d (pr/ipc-win.19 -> pr/ipc-win.20, compare)<!-- end --> to fix error from /k flag https://github.com/bitcoin/bitcoin/actions/runs/24587189710/job/71899642665?pr=32387, also cleaning up internal commits and replacing confusing SpawnProcess overload

    <!-- begin push-21 -->

    Updated 68bc7eeff2ffd44d79e8669fc8dc8b335ae18e7d -> 855cfb764d21e1b6f05c26d5cfadd0a2d165580d (pr/ipc-win.20 -> pr/ipc-win.21, compare)<!-- end --> reorganizing windows support comits and fixing ci errors: https://github.com/bitcoin/bitcoin/actions/runs/24589091659/job/71905779254?pr=32387 -Werror unused function warning in cross-compiled win32 job, and attempting to fix mpgen runtime error in visual studio ci job

    <!-- begin push-22 -->

    Updated 855cfb764d21e1b6f05c26d5cfadd0a2d165580d -> 2573aff25d9f773249ecd790af3a232de6397f46 (pr/ipc-win.21 -> pr/ipc-win.22, compare)<!-- end --> fixing bitcoin.exe wrapper exiting after spawning subprocesses to fix functional tests failures in windows cross-compiled binaries test https://github.com/bitcoin/bitcoin/actions/runs/24686166591/job/72198932709?pr=32387 and also adding better mpgen exception handling to determine why Windows native VS job still fails on windows, since it is still just exiting with code -1073740791 (STATUS_FAIL_FAST_EXCEPTION)

    <!-- begin push-23 -->

    Updated 2573aff25d9f773249ecd790af3a232de6397f46 -> 13de58e1b5ec29d0db22073faa3d5eee36a03616 (pr/ipc-win.22 -> pr/ipc-win.23, compare)<!-- end --> changing the way mpgen tool locates capnproto binaries to fix mpgen errors in https://github.com/bitcoin/bitcoin/actions/runs/24695410947/job/72226931947?pr=32387 and fixing the way socket error codes are translated to try to get better functional tests errors than "error: timeout on transient error: The operation completed successfully" in https://github.com/bitcoin/bitcoin/pull/32387

  17. ryanofsky force-pushed on May 6, 2025
  18. fanquake added this to a project on May 10, 2025
  19. fanquake changed the project status on May 10, 2025
  20. DrahtBot added the label Needs rebase on May 20, 2025
  21. ryanofsky referenced this in commit 7d9789401b on Aug 20, 2025
  22. ryanofsky force-pushed on Oct 15, 2025
  23. ryanofsky referenced this in commit 0f75629bc5 on Oct 22, 2025
  24. ryanofsky referenced this in commit 7d2f3c4371 on Oct 22, 2025
  25. ryanofsky force-pushed on Oct 22, 2025
  26. ryanofsky renamed this:
    [DRAFT] ipc: add windows support
    ipc: add windows support
    on Oct 22, 2025
  27. DrahtBot removed the label Needs rebase on Oct 22, 2025
  28. DrahtBot added the label Needs rebase on Dec 2, 2025
  29. ryanofsky force-pushed on Dec 12, 2025
  30. DrahtBot removed the label Needs rebase on Dec 12, 2025
  31. DrahtBot added the label CI failed on Dec 12, 2025
  32. DrahtBot commented at 4:18 PM on December 12, 2025: contributor

    <!--85328a0da195eb286784d51f73fa0af9-->

    🚧 At least one of the CI tasks failed. <sub>Task No wallet: https://github.com/bitcoin/bitcoin/actions/runs/20166538974/job/57891563544</sub> <sub>LLM reason (✨ experimental): Compilation failure: missing mp::Stream and mp::SocketId types (making CapnpProtocol abstract and uninstantiable).</sub>

    <details><summary>Hints</summary>

    Try to run the tests locally, according to the documentation. However, a CI failure may still happen due to a number of reasons, for example:

    • Possibly due to a silent merge conflict (the changes in this pull request being incompatible with the current code in the target branch). If so, make sure to rebase on the latest commit of the target branch.

    • A sanitizer issue, which can only be found by compiling with the sanitizer and running the affected test.

    • An intermittent issue.

    Leave a comment here, if you need help tracking down a confusing failure.

    </details>

  33. ryanofsky referenced this in commit 2975facdd1 on Apr 3, 2026
  34. ryanofsky referenced this in commit 070e0d1cc8 on Apr 3, 2026
  35. ryanofsky referenced this in commit 869691cc12 on Apr 15, 2026
  36. ryanofsky force-pushed on Apr 15, 2026
  37. ryanofsky force-pushed on Apr 16, 2026
  38. ryanofsky force-pushed on Apr 17, 2026
  39. ryanofsky force-pushed on Apr 17, 2026
  40. ryanofsky force-pushed on Apr 17, 2026
  41. ryanofsky force-pushed on Apr 17, 2026
  42. ryanofsky force-pushed on Apr 17, 2026
  43. ryanofsky force-pushed on Apr 17, 2026
  44. ryanofsky force-pushed on Apr 17, 2026
  45. ryanofsky force-pushed on Apr 17, 2026
  46. ryanofsky force-pushed on Apr 20, 2026
  47. Sjors referenced this in commit d42af54c56 on Apr 20, 2026
  48. Sjors referenced this in commit 7de24f776c on Apr 20, 2026
  49. Sjors referenced this in commit 2f549eb17d on Apr 20, 2026
  50. ryanofsky force-pushed on Apr 20, 2026
  51. ryanofsky force-pushed on Apr 21, 2026
  52. Sjors referenced this in commit baf5d5e571 on Apr 23, 2026
  53. Sjors referenced this in commit 36b415c486 on Apr 23, 2026
  54. Sjors referenced this in commit a20bfd86d2 on Apr 23, 2026
  55. DrahtBot added the label Needs rebase on May 22, 2026
  56. Kino1994 referenced this in commit df4bde1ae5 on Jun 28, 2026
  57. BigcoinBGC referenced this in commit f955c0b0ed on Jun 30, 2026
  58. ryanofsky force-pushed on Jul 22, 2026
  59. ryanofsky commented at 5:38 PM on July 22, 2026: contributor

    <!-- begin push-24 -->

    Rebased 13de58e1b5ec29d0db22073faa3d5eee36a03616 -> e99cb6170e6761f1678a7e8822fc7cd9a5606b2b (pr/ipc-win.23 -> pr/ipc-win.24, compare)<!-- end --> with many new fixes on top of base PRs https://github.com/bitcoin-core/libmultiprocess/pull/231, https://github.com/bitcoin-core/libmultiprocess/pull/317, https://github.com/bitcoin-core/libmultiprocess/pull/318, and #35084, also resolving conflicts with #35661 and #35684

    <!-- begin push-25 -->

    Updated e99cb6170e6761f1678a7e8822fc7cd9a5606b2b -> aa2892e82a334b6d2998937ffab27c2a6fa889dc (pr/ipc-win.24 -> pr/ipc-win.25, compare)<!-- end --> rebasing onto latest master and fixing lint errors (trailing newline in type-unordered-set.h, commit message format) https://github.com/bitcoin/bitcoin/actions/runs/29943010623/job/89001345876

    <!-- begin push-26 -->

    Rebased aa2892e82a334b6d2998937ffab27c2a6fa889dc -> 3177fbd5f2d553325f5414232d0be90aedec2aae (pr/ipc-win.25 -> pr/ipc-win.26, compare)<!-- end --> after #35084 to fix lint: duplicate #include <cerrno> in protocol.cpp https://github.com/bitcoin/bitcoin/actions/runs/29956699510/job/89047462559, also including upstream libmultiprocess updates

    <!-- begin push-27 -->

    Updated 3177fbd5f2d553325f5414232d0be90aedec2aae -> 3a845a8be9060c6abd8bdeb2f08cb37e9371c7a9 (pr/ipc-win.26 -> pr/ipc-win.27, compare)<!-- end --> to fix Windows build: remove compatibility shim that unconditionally included sys/socket.h https://github.com/bitcoin/bitcoin/actions/runs/30702460336/job/91375771635

    <!-- begin push-28 -->

    Updated 3a845a8be9060c6abd8bdeb2f08cb37e9371c7a9 -> 399c8820ce4b6847a0dc8e2e2c2cfe0b5b7b6fda (pr/ipc-win.27 -> pr/ipc-win.28, compare)<!-- end --> updating libmultiprocess base, restructuring commits and fixing various conflicts

    <!-- begin push-29 -->

    Updated 01ac9a03b580fd8066bd18440984dfcb15958b17 -> d0863ee76db080b558df0d307d244318eb2c887c (pr/ipc-win.28 -> pr/ipc-win.29, compare)<!-- end --> to fix CI: suppress C++23 lambda attribute warnings on clang-17/MSVC, and fix unused error_fds on Windows builds https://github.com/bitcoin/bitcoin/actions/runs/31636108883/job/94246747032

    <!-- begin push-30 -->

    Updated d0863ee76db080b558df0d307d244318eb2c887c -> 8f384c9f2499a5df8588100f563d0328cf51fd17 (pr/ipc-win.29 -> pr/ipc-win.30, compare)<!-- end --> to fix mptest connect_tests race: accept either disconnect error message https://github.com/bitcoin/bitcoin/actions/runs/31655880824/job/94310097285

    <!-- begin push-31 -->

    Rebased 8f384c9f2499a5df8588100f563d0328cf51fd17 -> 62dd45984057326b410c0208a5a86fda8c0351a2 (pr/ipc-win.30 -> pr/ipc-win.31, compare)<!-- end --> due to conflicts with #35084 and #35852

    <!-- begin push-32 -->

    Rebased 62dd45984057326b410c0208a5a86fda8c0351a2 -> cebd525b92f2cbc55e4650ecc5e78a2d08ce8b28 (pr/ipc-win.31 -> pr/ipc-win.32, compare)<!-- end --> due to conflicts with #33593, and moves the ExecVp, .exe extension, and tool_bitcoin.py commits to #36105

    <!-- begin push-33 -->

    Rebased cebd525b92f2cbc55e4650ecc5e78a2d08ce8b28 -> 82fec83d0c78c499aabf6352a6660ebfd3f3eb27 (pr/ipc-win.32 -> pr/ipc-win.33, compare)<!-- end --> replacing the "sync with libmultiprocess master" commit with a real subtree bump (libmultiprocess master plus the sockinline fixes) and adding the #36105 commits, to fix GCC -Wunused-const-variable build failures and the Windows native IPC functional test failures

    <!-- begin push-34 -->

    Updated 82fec83d0c78c499aabf6352a6660ebfd3f3eb27 -> 9c3306e2be4ca7986e0146406095201c300211ec (pr/ipc-win.33 -> pr/ipc-win.34, compare)<!-- end --> to fix the MSVC build of mptest (error C1128: number of sections exceeded object file format limit) by compiling it with /bigobj (Windows native VS job), and a libmultiprocess clang-tidy error (performance-prefer-single-char-overloads) in CommandLineFromArgv (macOS job on bitcoin-core/libmultiprocess#231)

  60. DrahtBot removed the label Needs rebase on Jul 22, 2026
  61. ryanofsky force-pushed on Jul 22, 2026
  62. sedited referenced this in commit a9d181f2d3 on Jul 29, 2026
  63. DrahtBot added the label Needs rebase on Jul 29, 2026
  64. ryanofsky force-pushed on Aug 1, 2026
  65. ryanofsky force-pushed on Aug 1, 2026
  66. DrahtBot removed the label Needs rebase on Aug 1, 2026
  67. DrahtBot removed the label CI failed on Aug 1, 2026
  68. DrahtBot added the label IPC on Aug 1, 2026
  69. Kino1994 referenced this in commit 33bd9b5d17 on Aug 2, 2026
  70. ryanofsky referenced this in commit abf127a314 on Aug 3, 2026
  71. DrahtBot added the label CI failed on Aug 4, 2026
  72. ryanofsky force-pushed on Aug 4, 2026
  73. DrahtBot removed the label CI failed on Aug 5, 2026
  74. DrahtBot added the label Needs rebase on Aug 7, 2026
  75. ryanofsky force-pushed on Aug 12, 2026
  76. DrahtBot removed the label Needs rebase on Aug 12, 2026
  77. DrahtBot added the label CI failed on Aug 12, 2026
  78. DrahtBot commented at 9:35 PM on August 12, 2026: contributor

    <!--85328a0da195eb286784d51f73fa0af9-->

    🚧 At least one of the CI tasks failed. <sub>Task test ancestor commits: https://github.com/bitcoin/bitcoin/actions/runs/31636108883/job/94246696076</sub> <sub>LLM reason (✨ experimental): CI failed due to a C++ build error: clang++ rejected [[noreturn]] on a lambda in mp/proxy-types.h as a C++23 extension and treated the warning as an -Werror compile failure.</sub>

    <details><summary>Hints</summary>

    Try to run the tests locally, according to the documentation. However, a CI failure may still happen due to a number of reasons, for example:

    • Possibly due to a silent merge conflict (the changes in this pull request being incompatible with the current code in the target branch). If so, make sure to rebase on the latest commit of the target branch.

    • A sanitizer issue, which can only be found by compiling with the sanitizer and running the affected test.

    • An intermittent issue.

    Leave a comment here, if you need help tracking down a confusing failure.

    </details>

  79. ryanofsky force-pushed on Aug 13, 2026
  80. ryanofsky force-pushed on Aug 13, 2026
  81. DrahtBot removed the label CI failed on Aug 13, 2026
  82. DrahtBot added the label Needs rebase on Aug 14, 2026
  83. ryanofsky force-pushed on Aug 15, 2026
  84. DrahtBot removed the label Needs rebase on Aug 15, 2026
  85. Kino1994 referenced this in commit 23854f0cec on Aug 19, 2026
  86. Kino1994 referenced this in commit 0a4ead0267 on Aug 19, 2026
  87. Sjors referenced this in commit 1d2ea2d265 on Aug 20, 2026
  88. Sjors referenced this in commit eba772de2c on Aug 20, 2026
  89. Sjors referenced this in commit c5809dc123 on Aug 20, 2026
  90. Sjors referenced this in commit b0efdd6f4e on Aug 20, 2026
  91. Sjors referenced this in commit c52dc06071 on Aug 21, 2026
  92. Sjors referenced this in commit 20b1d99d47 on Aug 21, 2026
  93. Sjors referenced this in commit 114c7d49f0 on Aug 21, 2026
  94. DrahtBot added the label Needs rebase on Sep 16, 2026
  95. Sjors referenced this in commit 1b9254dc6e on Sep 28, 2026
  96. Sjors referenced this in commit 5a45c7e463 on Sep 28, 2026
  97. Sjors referenced this in commit 38b68a22e0 on Sep 28, 2026
  98. Sjors referenced this in commit 2cc1787e11 on Sep 28, 2026
  99. Sjors referenced this in commit 636b9e8e6b on Sep 28, 2026
  100. Sjors referenced this in commit be14ff2251 on Sep 28, 2026
  101. Sjors referenced this in commit d26cbf9916 on Sep 28, 2026
  102. Sjors referenced this in commit d28a92bc14 on Sep 28, 2026
  103. Sjors referenced this in commit a28ad80b82 on Sep 28, 2026
  104. Sjors referenced this in commit 74d71c8fb4 on Sep 28, 2026
  105. Sjors referenced this in commit 6c6b4d3e20 on Sep 28, 2026
  106. Sjors referenced this in commit df9048da49 on Sep 28, 2026
  107. Sjors referenced this in commit ada1de6b4b on Sep 28, 2026
  108. Sjors referenced this in commit a5c391dc3e on Sep 28, 2026
  109. Sjors referenced this in commit 4fdceb4691 on Sep 28, 2026
  110. Squashed 'src/ipc/libmultiprocess/' changes from e8de5c7b68e..3577d23f616
    3577d23f616 ci: Enable -Wundef in default and llvm jobs
    debd42955ea proxy-types: Avoid -Wundef error when KJ_NO_EXCEPTIONS is not defined
    a8c64c7faa5 ci: Enable -Wunused-const-variable in GCC jobs
    701449c1657 util: Make SocketError inline constexpr
    6fd2a9c90e1 Merge bitcoin-core/libmultiprocess#367: mpgen: Change Cap'n Proto link order to fix undefined references in static builds
    f1042b1a60e Merge bitcoin-core/libmultiprocess#366: ci: Compile with minimum supported g++-10 in olddeps
    a6ecdc113ff Merge bitcoin-core/libmultiprocess#364: util: Error out at compile time if KJ_NO_EXCEPTIONS is set
    56cfdaa884e Change CapnProto library linkage for mpgen
    fa5633467af ci: Compile with minimum supported g++-10 in olddeps
    4a1f400f8b7 util: Error out at compile time if KJ_NO_EXCEPTIONS is set
    2dba130478a Merge bitcoin-core/libmultiprocess#363: ci: use LLVM 23 in Bitcoin Core CI
    161197a5c7b Merge bitcoin-core/libmultiprocess#352: ci: add cmake debug output
    fb4ac7eb8c8 ci: use LLVM 23 in Bitcoin Core CI
    7bac69de1fc Merge bitcoin-core/libmultiprocess#360: pull latest .clang-tidy from downstream
    79ddc44eb32 Merge bitcoin-core/libmultiprocess#359: ci: bump cmake version to 4.3.4 in newdeps job
    bf229bf82ae Merge bitcoin-core/libmultiprocess#351: ci: do not ignore NIXPKGS_CHANNEL in local ci runs
    073ac4f1972 Merge bitcoin-core/libmultiprocess#347: refactor: Replace EventLoop::post() with sync() taking kj::FunctionParam
    fa1db7a9e3e pull latest .clang-tidy from downstream
    5c49666a1d8 refactor: rename EventLoop::m_post_fn to m_sync_fn
    2330fbe81e2 refactor: replace EventLoop::post() with sync() taking kj::FunctionParam
    4d454a81da6 Merge bitcoin-core/libmultiprocess#358: refactor: Enable readability-container-contains
    dba99582b32 Merge bitcoin-core/libmultiprocess#357: doc: Update Cap'n Proto version to match minimum
    00923922ac3 Merge bitcoin-core/libmultiprocess#356: ci: Remove hard-coded -j4 from sanitize config
    766867fb326 ci: clarify CAPNP_CHECKOUT=master is the v1.x release branch
    cc3675280bf ci: bump cmake version to 4.3.4 in newdeps job
    fa101113b50 refactor: Enable readability-container-contains
    81f824b025f doc: Update Cap'n Proto version to match minimum
    fa30e2093c7 ci: Remove hard-coded -j4 from sanitize config
    a7ff9d5da22 ci: add cmake debug output
    f2e8df82ede Merge bitcoin-core/libmultiprocess#350: cmake: add type-unordered-set.h and version.h to public headers
    0e146c0468d Merge bitcoin-core/libmultiprocess#349: type-context: fix async disconnect race condition found by antithesis
    49f95e26326 Merge bitcoin-core/libmultiprocess#212: ci: add newdeps job testing newer versions of cmake and capnproto
    7c73cceda9b ci: rename CI-internal variables to use CI_ prefix
    fe1b8339f00 ci: do not ignore NIXPKGS_CHANNEL in local ci runs
    914dc839f27 proxy: fix data race between server request threads and disconnect handling
    275c8eefdfb Merge bitcoin-core/libmultiprocess#345: Remove trailing whitespace and Add -Wtrailing-whitespace to default ci config
    cd7162fb832 Merge bitcoin-core/libmultiprocess#304: proxy: fix BuildList to use non-const iteration for interface types
    9b136782af1 ci: Add -Wtrailing-whitespace to default config
    2f4be9ec6ea refactor: Remove trailing whitespace
    2448d282ccd cmake: add type-unordered-set.h and version.h to public headers
    b3fc922ee4a ci: add newdeps job testing newest versions of cmake and capnproto
    390b5f901f1 Merge bitcoin-core/libmultiprocess#344: test: listen_tests and connect_tests follow-ups
    d6f8588d1ab proxy: fix BuildList to use non-const iteration for interface types
    e18ca520f45 Merge bitcoin-core/libmultiprocess#343: test: fix race in connect_tests disconnect-deferred-failure test
    c39c7850c66 doc: note construct() call in valid init interface test
    b9c36c61751 test: close sockets unconditionally and check errors with KJ_SYSCALL
    7eb741e6359 test: drop unnecessary KJ_EXPECT(true)
    113f1d4d287 test: join server thread unconditionally in connect tests
    44bc4630bc1 test: drop mp:: prefixes in connect tests
    038d33eb31e test: share DefaultLogHandler between test files
    b54a1633085 test: drop TestSetup socket members in connect tests
    70467c5a727 test: add m_ prefix to TestSetup members in connect tests
    cc260f2526f test: replace capnp fix link with upstream PR
    137a6e4e039 test: fix race in connect_tests disconnect-deferred-failure test
    8dab0d4bdeb Merge bitcoin-core/libmultiprocess#341: ci: add -Wextra-semi to llvm config
    b3b134eed8b ci: add -Wextra-semi to llvm config
    bdd0cd69418 Merge bitcoin-core/libmultiprocess#339: refactor: add `[[noreturn]]` attributes
    a779a09764c ci: add -Wmissing-noreturn
    636aaff576b refactor: add missing [[noreturn]] attributes
    cc11c2b1b41 Merge bitcoin-core/libmultiprocess#338: test: check ReadList return value
    2d6e863c77a Merge bitcoin-core/libmultiprocess#334: ci: Set CMAKE_BUILD_PARALLEL_LEVEL to enable parallelism by default
    d4d10ff98ab Merge bitcoin-core/libmultiprocess#332: ci: add -Wextra-semi to default config
    b540e70f25f Merge bitcoin-core/libmultiprocess#324: proxy: Name threads spawned by the event loop
    e5e367e785c Merge bitcoin-core/libmultiprocess#312: util: report back child errors to parent and throw
    2220df68c91 Merge bitcoin-core/libmultiprocess#298: Fix error handling when creating clients (`mp::ConnectStream`)
    51defb79ef7 Merge bitcoin-core/libmultiprocess#340: ci: Update `capnproto` prerequisites on NetBSD
    7e94790b08a ci: Update `capnproto` prerequisites on NetBSD
    9f25ffca5b0 test: Cover OS thread names for worker, pool, and async threads
    648a18589c4 proxy: Name threads spawned by the event loop
    49834b2609e ci: add -Wextra-semi to default config
    fae9a637e35 example: Remove unused kj/async.h include
    bb473690c97 Fix error handling when creating clients
    44d191420c6 Add test coverage for ConnectStream
    231361ae5af Correct stale UnixListener doc comment
    060c1a50d03 Extract `UnixListener` class to a dedicated file
    62f25af06c3 test: check ReadList return value
    ce51d737255 ci: Set CMAKE_BUILD_PARALLEL_LEVEL to enable parallism in build jobs by default
    67302cd132a Merge bitcoin-core/libmultiprocess#331: Remove code for Cap'n Proto versions before 0.9
    f13c64ab54e Merge bitcoin-core/libmultiprocess#330: ci: Compile with minimum supported g++ in olddeps
    8e026f66252 Merge bitcoin-core/libmultiprocess#327: build: avoid unnecessary capnp-rpc dependency for mpgen
    e5206e9eb5b Merge bitcoin-core/libmultiprocess#325: cmake: Remove `QUIET` option from `find_package(CapnProto ...)`
    879efea2bc7 Merge bitcoin-core/libmultiprocess#321: ci: Roll NetBSD releases to 11.0, drop 9.4
    abf127a3141 Merge bitcoin-core/libmultiprocess#317: ipc: Fix mpgen capnp tool path for vcpkg/Windows builds
    c437d7f107e Merge bitcoin-core/libmultiprocess#310: test: cover immediate client disconnects for `ListenConnections`
    31bff8a673f Merge bitcoin-core/libmultiprocess#307: refactor: memcpy -> std::ranges::copy
    f355108b0a0 Merge bitcoin-core/libmultiprocess#303: type-chrono: Add CustomBuildField/CustomReadField overloads for std::chrono::time_point
    2d678177c14 Merge bitcoin-core/libmultiprocess#296: ci: Bump channel to nixos-26.05
    3f05b11624c util: kill and reap child on SpawnProcess error
    4a56c1837a7 util: report back child error to parent and throw
    a9e70dbe775 ci: Add NetBSD release 11.0
    2d33b14fb0e ci: Switch to default compiler on NetBSD 9.4
    36f74002775 ci: Drop NetBSD release 9.4
    bd508311b56 refactor: Drop stray semicolons after function definitions
    788f17a8509 Remove code for Cap'n Proto versions before 0.9
    7402affd0ce ci: Pin oldeps config to older nixpkgs channel to compile older cmake with older gcc
    edf63435624 ci: Compile with minimum supported g++-11 in olddeps
    fa47449afe1 cmake: avoid unnecessary capnp-rpc dependency for mpgen
    a494b764de5 cmake: Remove `QUIET` option from `find_package(CapnProto ...)`
    26452e02d75 refactor: memcpy -> std::ranges::copy
    e1dcc6eb182 Merge bitcoin-core/libmultiprocess#316: cmake: Fix stale codegen when mpgen binary changes
    7a72df02e2d type-chrono: Add CustomBuildField/CustomReadField overloads for std::chrono::time_point
    45b685c3f58 type-number, type-chrono: Fix static assert signed/unsigned comparisons
    45f6255975d type-number: exclude bool from the integral overload
    8d6d4649482 Merge bitcoin-core/libmultiprocess#315: Fix startup race in example
    a6fc80d2547 Merge bitcoin-core/libmultiprocess#311: bugfix: clear FD_CLOEXEC in child instead of parent before fork
    496fb84e69f test: cover immediate client disconnects for `ListenConnections`
    36c6c63520e doc: Document reference-counted EventLoop lifetime
    3a997e113cf Fix startup race in mpexample
    f5c15ce33ff Merge bitcoin-core/libmultiprocess#323: refactor: access ThreadContext through CurrentThread(), ci: switch Bitcoin Core to master
    66298c737f4 ci: Switch back to Bitcoin Core's master branch
    86b48105018 refactor: access ThreadContext through CurrentThread()
    eea9c64f6e1 cmake: Fix stale codegen when mpgen binary changes
    a26a08496b8 cmake: Fix mpgen capnp tool path for vcpkg/Windows builds
    140d9ba6ff7 test: allow custom log handler in `ListenSetup`
    1e0c7ff9a51 util: Clear FD_CLOEXEC in child instead of parent before fork
    8550ee6a317 util, refactor: Add ChildFail helper for post-fork child errors
    17eab90b526 test: Fix typo in listen_tests.cpp
    ce865a9ba86 refactor: Directly use value in CustomBuildField
    3f221b5bfd7 Merge bitcoin-core/libmultiprocess#274: Add nonunix platform support
    1b0f6056062 doc: Remove trailing whitespace
    d8f8ca3119f ipc: Wrap mpgen main() in try-catch to print errors
    fbe5a14ad46 ci: Check out bitcoin/bitcoin PR #35084 instead of master
    39d3690d83d types: Replace SFINAE with requires clauses to avoid MSVC C2039 error
    ba68520203c proxy, refactor: Fix C4305 truncation warning in Accessor on MSVC
    1d81d47811e util, refactor: Fix PtrOrValue constructor for move-only types on MSVC
    b883fe1e527 proxy: Fix shutdownWrite() exception handling on macOS with dynamic libraries
    0012411ccc6 proxy: Call shutdownWrite() in Connection destructor
    38312ad1912 proxy, refactor: Change ConnectStream and ServeStream to accept stream objects
    e96d5d742ab proxy, refactor: Replace EventLoop wakeup fd integers with KJ stream objects
    db4f9a3d739 cmake: Bump minimum required Cap'n Proto version to 0.9
    652934fb793 util, refactor: Add SocketPair() and use it in SpawnProcess
    1c6ef7a26c0 util, refactor: Do not fork() and exec() separately
    1389cf3132f util, refactor: Add SpawnConnectInfo type alias and use it
    c7ca1f00b62 util, refactor: Add SocketId type alias and use it
    be46a35203c util, refactor: Add ProcessId type alias and use it
    91a78db7808 doc: Bump version 13 > 14
    fa2c56ec27f ci: Bump channel to nixos-26.05
    
    git-subtree-dir: src/ipc/libmultiprocess
    git-subtree-split: 3577d23f616ec6e8d601d14452a5793f9d386708
    8f4631b22f
  111. Merge commit '8f4631b22f95c57984f01972ed77e37b0807dc62' into subtree-base 4415165f2d
  112. build: suppress -Wc++23-lambda-attributes in warn_interface
    Lambda [[noreturn]] attributes before the parameter list are a C++23
    extension intentionally used in C++20 builds (needed for compatibility
    with -Wmissing-noreturn). Suppress the extension warning rather than
    removing the attributes or working around them.
    
    Uses the existing IF_CHECK_PASSED idiom so GCC, which silently ignores
    unknown -Wno-* flags, is unaffected.
    
    This change was written with Claude Sonnet 4.6.
    f88029f39b
  113. util: Fix ExecVp on Windows to wait for child process
    Switch from _execvp to _spawnvp(_P_NOWAIT) + _cwait so bitcoin.exe
    waits for the child process to finish and forwards its exit code.
    Previously _execvp would exit the parent as soon as the child started,
    making it impossible for anything waiting on bitcoin.exe (such as a test
    framework) to track whether the child succeeded or failed. _P_NOWAIT is
    used instead of _P_WAIT so that a child exit code of -1 (0xffffffff) is
    not confused with a spawn failure: _spawnvp(_P_WAIT) returns -1 for both,
    but _spawnvp(_P_NOWAIT) returns the child handle on success, and _cwait
    fills a separate status that is forwarded via _exit.
    
    Co-Authored-By: Bortlesboat <169967362+Bortlesboat@users.noreply.github.com>
    This change was written with Claude Sonnet 4.6.
    4957ab2189
  114. test: Enable tool_bitcoin.py and interface_gui.py tests on Windows
    Now that util::ExecVp on Windows uses _spawnvp(_P_NOWAIT) + _cwait
    instead of _execvp, the bitcoin wrapper process blocks until the child
    exits and Python can capture its stdout/stderr and exit code normally.
    Remove the Windows skips added in #33229 and #35551.
    
    The interface_gui.py test is still skipped in vcpkg Qt builds. vcpkg builds Qt
    with -opengl dynamic, making the minimal platform plugin unusable due to
    internal Qt bugs. This matches existing logic in src/qt/test/CMakeLists.txt
    avoiding the minimal platform plugin with test_bitcoin-qt. A comment
    there is also updated for clarity.
    
    Co-Authored-By: Hodlinator <172445034+hodlinator@users.noreply.github.com>
    be80524ac8
  115. bitcoin: Use generic_category for errno from exec/spawn CRT functions
    Switch from system_category to generic_category when throwing from
    ExecVp failure, so errno is read as a POSIX value. On Windows,
    system_category interprets codes as Win32 errors, so EINVAL=22 would
    produce "The device does not recognize the command" instead of
    "Invalid argument".
    
    This change was written with Claude Sonnet 4.6.
    f9f93f5be0
  116. lint: Skip subtree check for src/ipc/libmultiprocess
    WARNING: DO NOT MERGE — this draft PR modifies the libmultiprocess
    subtree directly (intentionally, for testing purposes) which causes
    the subtree link check to fail. Disabling the check here to avoid
    masking unrelated lint failures while the PR is open for testing.
    
    Restore the omitted entry before any merge attempt.
    
    Note: removing src/ipc/libmultiprocess from get_subtrees() also removes
    it from get_pathspecs_default_excludes(), so all other lint checks
    (trailing newline, whitespace, etc.) now run on files in that directory
    as well. This is why src/ipc/libmultiprocess/include/mp/type-unordered-set.h
    needs a trailing newline added here even though it is not otherwise
    modified by this PR: it has always been missing the newline, but was
    previously hidden from the lint check by the subtree exclusion.
    
    This change was written with Claude Sonnet 4.6.
    a527358e2c
  117. ipc: remove compatibility shim after libmultiprocess update 564dfab851
  118. util: Improve SpawnProcess API and documentation
    Remove recently introduced SpawnConnectInfo and SpawnConnectInfoToArgsFn type
    aliases since they are the same on all platforms and might obscure the fact
    that connect info should be treated as an opaque string.
    
    Co-authored-by: Sjors Provoost <sjors@sprovoost.nl>
    c24176a0e9
  119. util, test: Add CloseSocket, use SocketId
    This change was written with Claude Sonnet 4.6.
    3f9e4bc2e5
  120. util, test: Replace UnixListener with SocketListener
    Replace the Unix-only UnixListener test helper with a cross-platform
    SocketListener backed by a std::variant<sockaddr_un> (TCP arm will be
    added later for Wine compatibility).
    
    - test/socketlistener.h: New header with SocketListener class extracted from
      the pattern of UnixListener but using SocketId/SocketError types,
      std::filesystem for temp dir cleanup, and mp::CloseSocket for teardown.
      Uses std::variant<sockaddr_un> so the TCP arm can be appended later without
      restructuring the class.
    - test/unixlistener.h: Deleted.
    - test/listen_tests.cpp: Switch to socketlistener.h and socketlistener.
    - test/connect_tests.cpp: Switch to socketlistener.h and socketlistener.
    
    This change was written with Claude Sonnet 4.6.
    fe9fb2d979
  121. util, test: guard Unix-only code for Windows build
    Move POSIX-only headers in util.cpp into a #ifndef WIN32 block so the file
    compiles on Windows without modification. Guard the Unix-only helpers (MakeArgv,
    MaxFd, ChildFail, SpawnError*, ReadSpawnResult, WriteSpawnError, KillAndReapChild)
    with a single #ifndef WIN32 block. Guard the extern "C" environ declaration
    likewise. Guard Unix-only includes in spawn_tests.cpp and connect_tests.cpp and
    wrap the Unix-only spawn tests with #ifndef WIN32.
    
    No Windows implementations are added here; those come in a later commit.
    
    This change was written with Claude Sonnet 4.6.
    14075662d0
  122. util: Add Windows CommandLineFromArgv escaping function
    Co-authored-by: Sjors Provoost <sjors@sprovoost.nl>
    165bf23e0c
  123. ryanofsky force-pushed on Oct 1, 2026
  124. DrahtBot removed the label Needs rebase on Oct 1, 2026
  125. DrahtBot added the label CI failed on Oct 1, 2026
  126. DrahtBot commented at 6:27 PM on October 1, 2026: contributor

    <!--85328a0da195eb286784d51f73fa0af9-->

    🚧 At least one of the CI tasks failed. <sub>Task 32 bit ARM: https://github.com/bitcoin/bitcoin/actions/runs/36893943097/job/110476103772</sub> <sub>LLM reason (✨ experimental): CI failed during the build because a C++ warning was treated as an error: mp::SocketError in ipc/libmultiprocess/include/mp/util.h was “defined but not used” (-Werror=unused-const-variable).</sub>

    <details><summary>Hints</summary>

    Try to run the tests locally, according to the documentation. However, a CI failure may still happen due to a number of reasons, for example:

    • Possibly due to a silent merge conflict (the changes in this pull request being incompatible with the current code in the target branch). If so, make sure to rebase on the latest commit of the target branch.

    • A sanitizer issue, which can only be found by compiling with the sanitizer and running the affected test.

    • An intermittent issue.

    Leave a comment here, if you need help tracking down a confusing failure.

    </details>

  127. util: Add Windows support
    Add Windows-specific code to support building and running on Windows:
    
    - util.h: Guard ProcessId/SocketId/SocketError type aliases with WIN32
      ifdefs so they use SOCKET/uintptr_t on Windows and int on Unix.
      Add winsock2.h include on Windows.
    - util.cpp: Guard Unix-specific system headers with WIN32 ifdefs. Add
      Windows-specific includes (windows.h, winsock2.h). Guard MaxFd() with
      #ifndef WIN32. Add GetCurrentThreadId() branch in ThreadName(). Add
      win32Socketpair() forward-declare. Add Windows branch in SocketPair()
      using win32Socketpair(). Add CommandLineFromArgv() helper needed to
      construct CreateProcess command lines. Add Windows branch in
      SpawnProcess() using named pipes and WSADuplicateSocket to pass socket
      to child. Add Windows branch in StartSpawned() reading socket from
      named pipe. Add Windows branch in WaitProcess() using
      WaitForSingleObject/GetExitCodeProcess.
    - proxy.cpp: Add SocketOutputStream class on Windows (analogous to
      FdOutputStream but using SOCKET/send()). Add Windows branch in
      EventLoop constructor to create m_post_writer using SocketOutputStream.
    
    Co-Authored-By: ViniciusCestarii <viniciuscestari01@gmail.com>
    8043bd0ec6
  128. util: Fix Windows SpawnProcess hang when child exits before connecting to named pipe
    SpawnProcess on Windows creates a named pipe with PIPE_WAIT and then calls
    ConnectNamedPipe synchronously. If the child exits or crashes before
    connecting, ConnectNamedPipe blocks forever with no recovery path.
    
    Fix by opening the pipe with FILE_FLAG_OVERLAPPED and using
    WaitForMultipleObjects on both the connect event and the child process
    handle. If the process handle signals first, the child died without
    connecting and SpawnProcess throws instead of hanging. Since the pipe is
    now in overlapped mode, WriteFile also requires an OVERLAPPED structure;
    use GetOverlappedResult with bWait=TRUE to handle both synchronous and
    asynchronous completion.
    
    Add a Windows-only test that spawns a child which exits immediately
    without opening the named pipe and asserts SpawnProcess does not block.
    
    (https://github.com/bitcoin-core/libmultiprocess/pull/231#discussion_r3706021950)
    
    Co-Authored-By: ViniciusCestarii <viniciuscestari01@gmail.com>
    This change was written with Claude Sonnet 4.6.
    bb1ed7b1c3
  129. util: make pthreads optional on Windows to enable MSVC builds
    Allow code to compile without pthreads available, as required for MSVC
    compatibility. Avoid unconditional POSIX calls (fork, posix_spawn,
    pthread_getname_np) by moving them into #ifndef WIN32 or HAVE_PTHREAD_*
    guards. When pthreads is available on Windows (detected via cmake
    HAVE_PTHREAD_* checks), still use it for thread name reporting since it
    provides useful information at low cost.
    
    Also add Threads::Threads as an explicit dependency of the multiprocess
    library. proxy.cpp directly uses thread_local, std::this_thread, and
    std::thread, and the dependency was previously satisfied only through
    transitive linkage from CapnProto::kj-async.
    
    This change was written with Claude Sonnet 4.6.
    a18fc9ad24
  130. test: Add TCP SocketListener and Windows compat to socketlistener.h
    Add TCP (sockaddr_in) support to SocketListener and platform-conditional
    header guards so the class compiles and works on Windows:
    
    - Wrap POSIX headers (arpa/inet.h, netinet/in.h, sys/socket.h, sys/un.h)
      in #else of #ifdef WIN32, with Windows equivalents (afunix.h,
      ws2tcpip.h) in the #ifdef WIN32 branch.
    - Add a WsaInit static initializer on Windows that calls WSAStartup
      before any socket operations. Tests create sockets directly (not via
      StartSpawned), so Winsock must be initialized here.
    - Add Init(sockaddr_in&) and Connect(const sockaddr_in&) overloads for
      TCP loopback connections.
    - Use TCP on Windows to work around Wine's lack of the AcceptEx extension
      required by KJ's AF_UNIX listener; Unix platforms continue using
      AF_UNIX.
    - Expand std::variant<sockaddr_un> to std::variant<sockaddr_in, sockaddr_un>.
    
    This change was written with Claude Sonnet 4.6.
    9474aeade2
  131. ci: add Windows cross-compilation config using MinGW and Wine
    - shell.nix: add `windows` parameter that selects pkgs.pkgsCross.mingwW64
      as the cross target; also change crossPkgs default from import<nixpkgs>{}
      to null (cleaner API). When windows=true, add native pkgs.capnproto to
      nativeBuildInputs so capnp/capnpc-c++ are in PATH for cmake code generation,
      and add wine64Packages.staging so ctest can run mptest.exe via wine.
      Change llvmBase to always use pkgs (native) instead of crossPkgs.
    
    - ci/configs/windows.bash: new config that cross-compiles with mingw,
      sets CMAKE_SYSTEM_NAME=Windows, CMAKE_FIND_ROOT_PATH_MODE_PROGRAM=NEVER
      (so cmake finds native capnp from PATH), CMAKE_CROSSCOMPILING_EMULATOR=wine
      (so ctest runs mptest.exe via wine), and sets MPGEN_PRE_BUILD=1.
    
    - ci/scripts/ci.sh: add MPGEN_PRE_BUILD support: when set, build native mpgen
      in $CI_DIR-native before the main cross build, then inject
      -DMPGEN_EXECUTABLE into CMAKE_ARGS. This is needed because cmake's
      add_custom_command does not use CMAKE_CROSSCOMPILING_EMULATOR, so the
      cross-compiled mpgen.exe cannot be used as a code generator directly.
    
    This change was written with Claude Sonnet 4.6.
    2b8e39588d
  132. workaround: MinGW thread_local use-after-free in ThreadContext
    MinGW has a bug where thread_local destructors can run on already-freed memory
    at thread exit, causing heap corruption. MSVC builds and non-Windows platforms
    are unaffected.
    
    This caused intermittent STATUS_HEAP_CORRUPTION in MinGW CI builds when
    ~ThreadContext walked freed memory at thread exit. See CurrentThread() in
    proxy-io.h for the full explanation and upstream bug references.
    
    Workaround: change CurrentThread() accessor in MinGW builds to return a
    heap-allocated object held by a trivially-destructible pointer, skipping
    destructor registration at thread exit. The object is deliberately
    leaked.
    
    This change was written with Claude Fable 5.
    da8d75fcba
  133. ipc: Windows + ENABLE_IPC build fixes
    Various small fixes for making ENABLE_IPC build work on windows.
    bab23102c4
  134. ipc: Fix MSVC build error C3861 in ipc_tests.cpp
    MSVC does not provide mkstemp (a POSIX function available in MinGW but
    not the MSVC runtime), causing:
    
      error C3861: 'mkstemp': identifier not found
      error C4996: 'close': The POSIX name for this item is deprecated
    
    Fix by using _mktemp_s on WIN32, which fills in the XXXXXX suffix
    in-place without creating a file (so no fd to close or file to remove).
    
    This change was written with Claude Sonnet 4.6.
    dd3522054f
  135. ipc: Fix windows socket error formatting 89d81aac8d
  136. ipc: Fix Windows connect() error for missing Unix socket path
    On Windows, connect() to a Unix domain socket path that doesn't exist
    may return a WSA error code (e.g. WSAECONNREFUSED) that doesn't map to
    std::errc::no_such_file_or_directory via std::system_category(), unlike
    POSIX where ENOENT is returned. After a failed connect, explicitly check
    if the socket path exists and throw the expected error if not.
    
    Also add an fs::exists(path, ec) overload to fs.h: the file's existing
    exists() wrappers shadow std::filesystem::exists(path, error_code&),
    causing the new call in process.cpp to fail to compile under MinGW.
    
    This change was written with Claude Sonnet 4.6.
    fda839826f
  137. ipc: Work around MinGW system_category() not mapping WSAECONNREFUSED
    When the IPC socket file exists but no node is listening, ProcessImpl::connect
    throws std::system_error(WSAECONNREFUSED, std::system_category()). MinGW
    libstdc++'s system_category() does not map Winsock error values to std::errc
    conditions, so the std::errc::connection_refused check in connectAddress fails
    to catch it, and bitcoin-cli -ipcconnect=auto throws CConnectionFailed instead
    of falling back to HTTP.
    
    This is a workaround: the proper fix is for ProcessImpl::connect to throw
    std::errc::connection_refused (using generic_category) rather than relying on
    system_category() to map Winsock codes. As a workaround, check for
    WSAECONNREFUSED explicitly in system_category on WIN32.
    
    MSVC's STL does map WSAECONNREFUSED to errc::connection_refused, so this
    check is redundant but harmless there.
    
    This change was written with Claude Fable 5.
    4e492426ee
  138. ipc: Skip MAX_DOUBLE static_assert on MSVC to fix C2131
    Bug: MSVC C2131 "expression did not evaluate to a constant" on line:
      static_assert(ipc::capnp::messages::MAX_DOUBLE == std::numeric_limits<double>::max())
    
    Root cause: Capnp floating-point constants can't be constexpr on MSVC.
    In capnp's generated-header-support.h, CAPNP_NON_INT_CONSTEXPR_DECL_INIT
    is defined as empty on MSVC (with the comment "MSVC doesn't understand
    floating-point constexpr yet"), so MAX_DOUBLE is declared as
    `static const double MAX_DOUBLE;` without an initializer in the header.
    A `const double` (unlike `const int`) is not a constant expression in C++,
    so it can't be used in static_assert on MSVC.
    
    Fix: Guard with `#if !defined(_MSC_VER) || defined(__clang__)` to match
    the exact condition capnp itself uses for the same limitation. The other
    three static_asserts in the same block use integer constants (MAX_MONEY,
    DEFAULT_BLOCK_RESERVED_WEIGHT, DEFAULT_COINBASE_OUTPUT_MAX_ADDITIONAL_SIGOPS)
    which don't have this MSVC limitation and continue to run.
    
    Alternatives considered:
    - Convert to a runtime BOOST_CHECK: would require moving into a test
      function, more invasive change.
    - Use std::numeric_limits<double>::max() literal: wouldn't help since
      MAX_DOUBLE is the non-constexpr side.
    
    This change was written with Claude Sonnet 4.6.
    65ccd8e5ba
  139. test: Add Windows AF_UNIX asyncio support to ipc_util.py
    Python's asyncio doesn't support create_unix_connection() on Windows. Implement
    it by patching asyncio.ProactorEventLoop, using ctypes ws2_32.connect() and
    a non-blocking select() loop. See ipc_util.py for details on why each of those
    choices was necessary.
    
    Also: run blocking do_fn() callables in run_in_executor() in wait_and_do();
    unlink stale AF_UNIX socket files before node restart on Windows (test_node.py);
    set UNIX_PATH_MAX = 108 for Windows (test_node.py); catch OSError in the
    connection retry loop in interface_ipc_mining.py.
    
    This change was written with Claude Sonnet 4.6.
    5e1a57c2e5
  140. test: Fix interface_ipc_cli.py error assertions on Windows
    On POSIX, connect() to a stopped node returns ECONNREFUSED and bitcoin-cli
    prints "error: Connection refused" followed by help text. On Windows the
    equivalent WSAECONNREFUSED produces a different OS error string without help
    text. Fix the expected string and switch to a prefix match since the Windows
    message has no appended help text.
    
    Also, on Windows, bitcoind removes the IPC socket file on clean shutdown
    (unlike Linux where the file persists and connect() returns ECONNREFUSED).
    A subsequent connect attempt sees ENOENT ("No such file or directory").
    Update test_cli() to accept a tuple of alternative prefixes and use a
    two-entry tuple for the Windows case covering both error strings.
    
    Also add diagnostic logging retained for future debugging: ipc_socket_path
    in both backslash and forward-slash forms with encoded byte length (to
    diagnose MinGW path format issues), socket file existence before each
    explicit-path test, and per-call debug logging of returncode and stdout.
    
    This change was written with Claude Sonnet 4.6.
    5da8099c5c
  141. cmake: Add add_windows_exe_resources() for Windows exe manifest/version
    Add a helper function that generates a target-specific resource file from a
    template and links it along with an application manifest, replacing the static
    per-binary *-res.rc files previously used by non-GUI executables and the
    bitcoin-qt-res.rc previously used by GUI executables.
    
    The new add_windows_exe_resources(target description [ICON_DIR dir]) function
    in AddWindowsResources.cmake handles both GUI and non-GUI executables through a
    single cmake/windows-res.rc.in template. When ICON_DIR is provided, the
    function prepends icon declarations to the generated RC file and sets
    ProductName to the project name, matching the previous GUI-specific behavior.
    
    Also adds the missing add_windows_exe_resources() call for bitcoin-node, which
    previously had no resource section and caused the Windows CI manifest
    validation check (mt.exe -validate_manifest) to fail.
    
    This change was written with Claude Sonnet 4.6.
    347a548075
  142. ipc: enable by default in windows builds d66405c019
  143. ci: Enable IPC in Windows cross-compiled CI jobs
    Remove -DENABLE_IPC=OFF from the win64 cross-build environment file
    and install pycapnp in the Windows cross-build test runner. The
    depends/ system already builds capnp for the MinGW target (NO_IPC is
    not set), so cmake will find it via the toolchain file. This lets
    interface_ipc.py and related tests run in the "Windows, test
    cross-built" CI jobs.
    
    This change was written with Claude Sonnet 4.6.
    e1b29af671
  144. ci: Install capnproto via vcpkg and pycapnp for Windows IPC support
    Add an "ipc" feature to vcpkg.json with capnproto as a dependency and
    include it in default-features, so the Windows native VS CI job installs
    capnproto when ENABLE_IPC is ON (the default). The fuzz build already
    uses VCPKG_MANIFEST_NO_DEFAULT_FEATURES=ON, so it is unaffected.
    
    Also install pycapnp in ci-windows.py alongside pyzmq so the IPC
    functional tests (interface_ipc.py) have their required Python library,
    matching what every other CI platform already does.
    
    This change was written with Claude Sonnet 4.6.
    4dc3720bdd
  145. ci: Add missing ipc and tests vcpkg features to Windows fuzz build
    The fuzz build in ci-windows.py set -DVCPKG_MANIFEST_FEATURES=wallet but
    omitted ipc and tests, so vcpkg installed wallet dependencies but not
    capnproto. The build then failed with:
      "Cap'n Proto is required but was not found"
    
    Fix: extend VCPKG_MANIFEST_FEATURES to ipc;tests;wallet.
    
    This change was written with Claude Sonnet 4.6.
    9586385713
  146. ryanofsky force-pushed on Oct 2, 2026
  147. test: Compile mptest with /bigobj on MSVC
    The proxy-server code generated for test/mp/test/foo.capnp now has more
    sections than MSVC's default object file format allows, failing the
    Windows native VS CI job with "error C1128: number of sections exceeded
    object file format limit: compile with /bigobj"
    (https://github.com/bitcoin/bitcoin/actions/runs/36945085020/job/110645241551).
    Bitcoin Core already passes /bigobj for its own debug builds.
    
    Not reproduced locally; based on the error message.
    
    This change was written with Claude Opus 5.5 (1M context).
    9c3306e2be
  148. ryanofsky force-pushed on Oct 2, 2026
  149. DrahtBot removed the label CI failed on Oct 2, 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-10-11 08:51 UTC

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