1 minor finding · 1 suggestion
Findings
[minor] · External libmultiprocess builds leave Core IPC targets on KJ autodetection
With WITH_EXTERNAL_LIBMULTIPROCESS=ON, configure can confirm KJ exception support while Core-compiled IPC code still uses autodetected KJ_NO_EXCEPTIONS; base has the same gap, so this is not a regression.
Location: src/ipc/CMakeLists.txt:65 (head).
Details and suggested fix
The NOT WITH_EXTERNAL_LIBMULTIPROCESS guard also skips Core-owned targets that are compiled in both modes: bitcoin_ipc, bitcoin_ipc_test, bitcoin_ipc_fuzz, and fuzz. These targets include generated proxy-server sources that call kj::runCatchingExceptions.
In external mode, the configure probe explicitly sets KJ_NO_EXCEPTIONS=0 and can report exception support, but Core's translation units still rely on KJ's autodetection. If that detection is wrong, as with the documented NetBSD __has_feature stub, rebuilding libkj as the documentation advises can leave Core's server-side runCatchingExceptions compiled without exception catching. An exception thrown while serving an IPC request then escapes instead of being returned to the client, causing the #36058 failure. No CI job or documented build was found that combines external libmultiprocess with a misdetecting toolchain, so real-world impact is unconfirmed.
Apply KJ_NO_EXCEPTIONS=0 to the Core-owned IPC targets and fuzz in both modes, for example through a Core interface target they all link. Keep the external-mode guard only around multiprocess, mputil, mpgen, and mptest.
Optional improvements
[suggestion] · The in-tree KJ probe re-resolves libkj instead of using IPC's Cap'n Proto target
The configure check resolves libkj separately from the dependency used by IPC, adding discovery logic that can drift from the link configuration; no installation where it misdetects was identified.
Location: cmake/libmultiprocess.cmake:13 (head).
Details and suggested fix
In the default in-tree build, find_package(CapnProto) runs inside src/ipc/libmultiprocess, where its imported targets are directory-scoped. When add_libmultiprocess() calls check_kj_exception_support() from the parent scope, TARGET CapnProto::kj is false. The check works around this by copying CAPNP_INCLUDE_DIRECTORY out of the subdirectory, then falls back to CapnProto_kj_IMPORTED_LOCATION or a prefix-only find_library(kj). It uses that bare library path for the probe, rather than the CapnProto::kj target and related interface requirements used to link multiprocess.
This second resolution assumes the headers and library share a prefix, and reports every probe failure as a libkj or exception problem. No installation where it selects the wrong library or fails was identified, so this is a complexity and drift risk, not a demonstrated bug.
Run the probe inside libmultiprocess after find_package, where CapnProto::kj is in scope, or use the compile-time #if KJ_NO_EXCEPTIONS / #error guard proposed in bitcoin-core/libmultiprocess#364. Either approach removes Core's include-directory scraping and library reconstruction. The guard approach fails on the first IPC compile rather than at configure time.