ipc: add windows support #32387

pull ryanofsky wants to merge 1 commits into bitcoin:master from ryanofsky:pr/ipc-win changing 9 files +115 −86
  1. ryanofsky commented at 12:43 pm on April 30, 2025: contributor

    This is based on https://github.com/bitcoin-core/libmultiprocess/pull/231. The non-base commits are:

    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

    PR is a draft since this is less of a priority compared to other multiprocess PR’s (see tracking issue #28722). Also it would probably make sense to split this up into separate commits. But the code is working and clean, and this could be reviewed and tested.


    This PR is part of the process separation project.

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

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

    Code Coverage & Benchmarks

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

    Reviews

    See the guideline for information on the review process.

    Type Reviewers
    Concept ACK hebasto

    If your review is incorrectly listed, please copy-paste <!–meta-tag:bot-skip–> into the comment that the bot should ignore.

    Conflicts

    Reviewers, this pull request conflicts with the following ones:

    • #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.

    LLM Linter (✨ experimental)

    Possible typos and grammar issues:

    • “needs be to called” -> “needs to be called” [grammatical error: missing “to” in infinitive]
    • “//! up its own state (calling ProxyServer destructors, etc) on disconnect,” -> “//! clean up its own state (calling ProxyServer destructors, etc.) on disconnect,” [fragment/missing verb; “clean up” restores meaning; add period after “etc” for completeness]

    Possible places where named args for integral literals may be used (e.g. func(x, /*named_arg=*/0) in C++, and func(x, named_arg=0) in Python):

    • socket(addr.sun_family, SOCK_STREAM, 0) in src/ipc/process.cpp
    • socket(addr.sun_family, SOCK_STREAM, 0) in src/ipc/process.cpp

    2025-12-12

  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

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

    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.

  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.

    Updated 5f272b7cc3b72fe4a59f590825b68dc2c342baca -> 13aef5ad7669e0302e27f96876615907dc98c3c3 (pr/ipc-win.6 -> pr/ipc-win.7, compare) 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)

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

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

    Rebased 3d0737720ae6bbd2c3eb4382e41fa49dd3d727d9 -> 24f5e883f20d0c65bc163dba0e3d8c2f031c63c7 (pr/ipc-win.9 -> pr/ipc-win.10, compare)

  17. ryanofsky force-pushed on May 6, 2025
  18. ?
    added_to_project_v2 fanquake
  19. ?
    project_v2_item_status_changed fanquake
  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. ipc: add windows support 24f5e883f2
  30. ryanofsky force-pushed on Dec 12, 2025
  31. DrahtBot removed the label Needs rebase on Dec 12, 2025
  32. DrahtBot added the label CI failed on Dec 12, 2025
  33. DrahtBot commented at 4:18 pm on December 12, 2025: contributor

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

    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.


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-01-01 06:13 UTC

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