build: require KJ exception support for IPC #36060

pull 151henry151 wants to merge 3 commits into bitcoin:master from 151henry151:36058-kj-exceptions changing 12 files +179 −0
  1. 151henry151 commented at 3:25 AM on August 24, 2026: contributor

    IPC needs libkj built with exception support; runCatchingExceptions depends on getCaughtExceptionAsKj, which is omitted when KJ_NO_EXCEPTIONS is set.

    Build depends capnproto with -DKJ_NO_EXCEPTIONS=0. Fail configure if the compiler or the installed libkj lacks exception support. Define the same macro privately on in-tree IPC targets so our headers match the library.

    Addresses #36058

    Tested with: make -C depends NO_QT=1 NO_QR=1 -j$(nproc) — passed cmake -B /tmp/btc-36058-deptc --toolchain depends/x86_64-pc-linux-gnu/toolchain.cmake -DBUILD_GUI=OFF -DBUILD_BENCH=OFF -DBUILD_TESTS=ON -DBUILD_FUZZ_BINARY=ON — passed cmake --build /tmp/btc-36058-deptc --target bitcoin_ipc multiprocess mputil mpgen bitcoin_ipc_test bitcoin_ipc_fuzz mptest bitcoind bitcoin-node bitcoin-cli bitcoin test_bitcoin fuzz — passed mptest — 16 passed test_bitcoin --run_test=ipc_tests — passed interface_ipc.py — passed interface_ipc_cli.py — passed interface_ipc_mining.py — passed cmake -DENABLE_IPC=OFF — passed cmake -DENABLE_IPC=ON -DCMAKE_CXX_FLAGS=-fno-exceptions — configure fails (compiler probe) cmake -DENABLE_IPC=ON -DWITH_EXTERNAL_LIBMULTIPROCESS=ON -DCMAKE_PREFIX_PATH=/tmp/mp-ext-prefix — passed test/lint/git-subtree-check.sh src/ipc/libmultiprocess — GOOD

  2. depends: pin KJ_NO_EXCEPTIONS=0 when building capnproto
    Also pin native_capnp, which host mpgen links.
    4f71358ccb
  3. cmake: check KJ exception support when ENABLE_IPC is on
    The check is in Core cmake because src/ipc/libmultiprocess is a
    subtree. Fail if the compiler cannot throw or libkj lacks
    getCaughtExceptionAsKj. Header autodetection is not a configure
    failure. Look up libkj next to the scraped headers so depends
    and system copies cannot be mixed. The compiler probe uses
    CMAKE_CXX_FLAGS; target-level -fno-exceptions would not trip it.
    34201d5fb0
  4. cmake: define KJ_NO_EXCEPTIONS=0 on in-tree IPC targets
    PRIVATE so the define is not exported. Skip
    WITH_EXTERNAL_LIBMULTIPROCESS; those TUs are already compiled.
    Apply to bitcoin_ipc, bitcoin_ipc_test, bitcoin_ipc_fuzz, the
    in-tree mp targets, and fuzz (which compiles ipc.cpp with kj
    headers).
    68bee5832c
  5. DrahtBot added the label Build system on Aug 24, 2026
  6. DrahtBot commented at 3:25 AM on August 24, 2026: 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/36060.

    <!--021abf342d371248e50ceaed478a90ca-->

    Reviews

    See the guideline and AI policy for information on the review process. A summary of reviews will appear here.

    <!--174a7506f384e20aa4161008e828411d-->

    Conflicts

    Reviewers, this pull request conflicts with the following ones:

    • #32387 (ipc: add windows support 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-->


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-09-09 07:56 UTC