Skip to content

[RFC] ipc: Check / enforce exception support #36058

Open

Description

@hebasto

When configured with -DENABLE_IPC=ON, the Bitcoin Core codebase expects the underlying KJ library to be built with exception support. If it is not, the interface_ipc.py and interface_ipc_mining.py functional tests fail, as shown in https://github.com/hebasto/bitcoin-core-nightly/actions/runs/32576370006/job/97039239853. When this behavior is not set explicitly via the KJ_NO_EXCEPTIONS macro, it is autodetected in the c++/src/kj/common.h header.

Instead of relying on autodetection, it seems reasonable to:

  1. Check that all related dependencies, including the kj and capnproto libraries, are built with exception support.

  2. Enforce exception support in depends/packages/capnp.mk.

  3. Enforce exception support for the targets in src/ipc/libmultiprocess/.

For more details, see capnproto/capnproto#2756.

Activity

  1. 151henry151 commented on Aug 24, 2026

    @151henry151
    Contributor

    Draft PR for the three items: #36060

    I put the check in Core cmake so we don't touch the libmultiprocess subtree. Finding libkj from the parent isn't great; I can move the check into libmultiprocess if that's preferable.

    KJ_NO_EXCEPTIONS=0 on Core does not rebuild libkj. Configure fails when the library was built without exception support.

  2. fanquake commented on Sep 9, 2026

    @fanquake
    Member
  3. Sjors commented on Sep 10, 2026

    @Sjors
    Member

    That sounds reasonable to me. Exceptions are expected, so it's not just about breaking functional tests.

  4. ryanofsky commented on Sep 10, 2026

    @ryanofsky
    Contributor

    Description of the proposed changes is a little vague, but I don't think most of the changes in #36060 currently make sense.

    34201d5 which corresponds to suggestion 1 here seems very complicated. I do think it's good to detect problems at compile time but I think a simpler solution like bitcoin-core/libmultiprocess#364 would be better.

    4f71358 seems to correspond to suggestion #2 here. It is setting -DKJ_NO_EXCEPTIONS=0 depends without an explanation of why it being set, apparently due to a bug that only happens in the netbsd packaging system capnproto/capnproto#2756 that doesn't happen in depends.

    68bee58 has a little more justification than 4f71358 because it at least does work around a bug that can happen in reality. But I'm not sure it is worth the complexity if capnproto bug capnproto/capnproto#2756 is already fixed upstream and there is a clear error and manual workaround for netbsd users in the meantime.

    Note: It would also help to link to capnproto/capnproto#2756 in the issue description otherwise the CI failure linked there doesn't make a lot of sense. (I wasted some time trying to debug it.)

  5. hebasto commented on Sep 10, 2026

    @hebasto
    MemberAuthor

    Note: It would also help to link to capnproto/capnproto#2756 in the issue description otherwise the CI failure linked there doesn't make a lot of sense. (I wasted some time trying to debug it.)

    Thanks! Added.

  6. added 2 commits that reference this issue on Oct 1, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions