ipc: Support for windows support #35084

pull ryanofsky wants to merge 9 commits into bitcoin:master from ryanofsky:pr/ipc-wins changing 13 files +335 −281
  1. ryanofsky commented at 4:25 PM on April 15, 2026: contributor

    This PR makes bitcoin core changes needed to be compatible with https://github.com/bitcoin-core/libmultiprocess/pull/231, which adds windows to support libmultiprocess.

    The two PRs are meant to be reviewed in parallel and there is a draft PR #32387 combining both of these with more changes to enable IPC by default on windows.

  2. DrahtBot commented at 4:25 PM on April 15, 2026: contributor

    <!--e57a25ab6845829454e8d69fc972939a-->

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

    <!--021abf342d371248e50ceaed478a90ca-->

    Reviews

    See the guideline for information on the review process.

    Type Reviewers
    Concept ACK stickies-v

    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:

    • #35037 (ipc: support per-address max-connections options on -ipcbind by enirox001)
    • #34806 (refactor: logging: Various API improvements by ajtowns)
    • #34020 (mining: add getTransactions(ByWitnessID) IPC methods by Sjors)
    • #32387 (ipc: add windows support by ryanofsky)
    • #19461 (multiprocess: Add bitcoin-gui -ipcconnect option by ryanofsky)
    • #19460 (multiprocess: Add bitcoin-wallet -ipcconnect option by ryanofsky)
    • #10102 (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 places where comparison-specific test macros should replace generic comparisons:

    • [src/ipc/test/ipc_tests.cpp] BOOST_CHECK_THROW(process->bind(datadir, "test_bitcoin", invalid_bind), std::invalid_argument); -> Consider using BOOST_CHECK_EXCEPTION with HasReason(...) to validate the thrown message (e.g., Unrecognized address 'invalid:'), not just the exception type.
    • [src/ipc/test/ipc_tests.cpp] BOOST_CHECK_THROW(process->connect(datadir, "test_bitcoin", invalid_bind), std::invalid_argument); -> Consider using BOOST_CHECK_EXCEPTION with HasReason(...) to validate the thrown message (e.g., Unrecognized address 'invalid:'), not just the exception type.

    <sup>2026-04-17 00:47:10</sup>

  3. DrahtBot added the label CI failed on Apr 15, 2026
  4. DrahtBot commented at 5:15 PM on April 15, 2026: contributor

    <!--85328a0da195eb286784d51f73fa0af9-->

    🚧 At least one of the CI tasks failed. <sub>Task FreeBSD Cross: https://github.com/bitcoin/bitcoin/actions/runs/24465865499/job/71492637060</sub> <sub>LLM reason (✨ experimental): CI failed due to a linker error: duplicate symbol mp::SocketPair() in libbitcoin_ipc.a (defined in multiple objects).</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>

  5. stickies-v commented at 5:45 PM on April 15, 2026: contributor

    Concept ACK

  6. ipc, moveonly: combine ipc_test.cpp and ipc_tests.cpp
    Previously ipc_test.cpp contained tests which depended on
    libmultiprocess and ipc_tests.cpp contained tests which didn't.
    Separation was needed because libmultiprocess tests need to be built
    with additional include and link paths, and cmake only has good support
    for setting these on libraries, not source files. The separation also
    allowed the add_boost_test custom cmake function to work with no changes,
    because it could find the boost test registration in ipc_tests.cpp, and
    then ipc_tests.cpp would run the tests in ipc_test.cpp without them
    needing to be registered in boost.
    
    But with windows support being added, the parse address test can't
    easily avoid a dependecy on libmultiprocess, because it depends on the
    ipc/process.h header, and ipc/process.h header will now need
    platform-specific ProcessId and SocketId types defined by
    libmultiprocess, rather than plain ints.
    
    With all ipc tests depending on libmultiprocess, there is not really a
    rationale for having separate test files anymore, so this change
    combines them, and move the cmake add_boost_test function definition so
    it can be used instead of target_sources to register ipc_tests.cpp with
    ctest.
    
    The change prevents CI errors from including ipc/process.h in
    ipc_tests.cpp:
    
    In file included from /Users/runner/work/bitcoin/bitcoin/repo_archive/src/ipc/test/ipc_tests.cpp:5:
    In file included from /Users/runner/work/bitcoin/bitcoin/repo_archive/src/ipc/process.h:11:
    /Users/runner/work/bitcoin/bitcoin/repo_archive/src/ipc/util.h:14:10: fatal error: 'kj/debug.h' file not found
       14 | #include <kj/debug.h>
    
    https://github.com/bitcoin/bitcoin/actions/runs/24465865499/job/71492617687?pr=35084
    968ad00408
  7. ipc, refactor: Drop connect/listen/serve exe_name parameters
    Pass to ipc::Protocol class constructor instead. It never really made
    sense to have exe parameters as part of the protocol interface and
    removing them makes adding new features like windows support easier.
    
    The exe name values are only used for logging and debuggging purposes to
    distinguish log messages from different processes.
    3d30dfb4f3
  8. ipc, refactor: Change Protocol class field order
    This just changes Protocol class field order to make no class members
    are destroyed before the event loop thread exits. There is no change in
    behavior. The change is just being made to clarify intent and avoid
    potential bugs.
    aa711cecdb
  9. ipc, refactor: use native path separators in test
    Avoid hardcoded forward slashes is ParseAddress test, use native path
    separators instead.
    274cbd6033
  10. ipc, refactor: fix include order
    Keep standard headers separate from posix headers
    db2a895212
  11. ipc, refactor: Add ProcessId type alias and use it
    Use ProcessId type instead of int to represent process ids to be
    compatible with an upcoming version of libmultiprocess which adds
    windows support.
    1e57be75d9
  12. ipc, refactor: Add SocketId type alias and use it
    Use SocketId type instead of int to represent socket ids to be
    compatible with an upcoming version of libmultiprocess which adds
    windows support.
    d152ea93a0
  13. ipc, refactor: Add ConnectInfo type alias and use it
    Use ConnectInfo type instead of int to represent socket ids that are
    passed between processes, to be compatible with an upcoming version of
    libmultiprocess which adds windows support.
    4f277abe79
  14. ipc, refactor: Add Stream type alias and use it
    Use Stream type to abstract socket ids and be compatible with updated
    mp::ConnectStream() and mp::ServeStream() functions that use streams
    instead of socket ids in an upcoming version of libmultiprocess which
    adds windows support.
    
    Since creating Stream objects from socket ids can require the event loop
    to be running, the ipc::Protocol::serve() method is also updated to
    accept the server stream though a callback parameter instead of a normal
    parameter.
    2367628021
  15. ryanofsky force-pushed on Apr 16, 2026
  16. ryanofsky commented at 11:29 PM on April 16, 2026: contributor

    <!-- begin push-2 -->

    Updated 9c39299c7589cb650178f4a411956f2818d1b5c5 -> 012f428e7fe52707ea7421201def84a847328341 (pr/ipc-wins.1 -> pr/ipc-wins.2, compare)<!-- end --> to fix CI failures https://github.com/bitcoin/bitcoin/actions/runs/24465865499: ipc_tests cmake include directory bug and multiple definition link error

    <!-- begin push-3 -->

    Updated 012f428e7fe52707ea7421201def84a847328341 -> 129f48be88f738e6af9960fe81c0a9d05bb8b5f9 (pr/ipc-wins.2 -> pr/ipc-wins.3, compare)<!-- end --> to fix CI failures https://github.com/bitcoin/bitcoin/actions/runs/24539375845: HasReason include error and lint error about ipc_tests filename

    <!-- begin push-4 -->

    Updated 129f48be88f738e6af9960fe81c0a9d05bb8b5f9 -> 236762802185b1c8219e6f567964be1ddc97b839 (pr/ipc-wins.3 -> pr/ipc-wins.4, compare)<!-- end --> adding an extra version check to be able to build against https://github.com/bitcoin-core/libmultiprocess/pull/231 without code changes

  17. ryanofsky referenced this in commit e563c968b4 on Apr 16, 2026
  18. ryanofsky referenced this in commit b42ec11a5c on Apr 16, 2026
  19. ryanofsky force-pushed on Apr 17, 2026
  20. ryanofsky force-pushed on Apr 17, 2026
  21. ryanofsky referenced this in commit d9fcac6e30 on Apr 17, 2026
  22. ryanofsky referenced this in commit c537b41d09 on Apr 17, 2026
  23. ryanofsky referenced this in commit f813f9f959 on Apr 17, 2026
  24. DrahtBot removed the label CI failed on Apr 17, 2026
  25. ryanofsky referenced this in commit 74fc8ac8c3 on Apr 17, 2026
  26. ryanofsky referenced this in commit 6d87dd7990 on Apr 17, 2026
  27. ryanofsky referenced this in commit 68e367a0aa on Apr 17, 2026
  28. ryanofsky referenced this in commit 97b3bc9e31 on Apr 17, 2026
  29. ryanofsky referenced this in commit eeac89b481 on Apr 17, 2026
  30. ryanofsky referenced this in commit e451de95b3 on Apr 17, 2026
  31. SirMentos-apt commented at 1:14 PM on April 20, 2026: none

    can run bitcoin core on WSL ?

  32. Sjors commented at 3:04 PM on April 20, 2026: member

    @SirMentos-apt: @hebasto might know.


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-04-21 09:12 UTC

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