Skip to content

build: require KJ exception support for IPC - #36060

Closed
151henry151 wants to merge 3 commits into
bitcoin:masterfrom
151henry151:36058-kj-exceptions
Closed

151henry151 wants to merge 3 commits into
bitcoin:masterfrom
151henry151:36058-kj-exceptions

Conversation

@151henry151

Copy link
Copy Markdown
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

Also pin native_capnp, which host mpgen links.
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.
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).
@DrahtBot

DrahtBot commented Aug 24, 2026 •

Copy link
Copy Markdown
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/36060.

Reviews

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

Conflicts

Reviewers, this pull request conflicts with the following ones:

  • #36612 (doc: Merge all BSD build docs back into build-unix.md by maflcko)
  • #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.

@maflcko

maflcko commented Nov 4, 2026

Copy link
Copy Markdown
Member

Closing due to inactivity and AI policy violation

@maflcko maflcko closed this Nov 4, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants