Fix Bitcoin Core build errors from libmultiprocess headers #370

pull ryanofsky wants to merge 4 commits into bitcoin-core:master from ryanofsky:pr/sockinline changing 7 files +7 −7
  1. ryanofsky commented at 12:11 AM on October 2, 2026: collaborator

    Problem: Bumping the libmultiprocess subtree in Bitcoin Core to current master breaks the build with -Werror. GCC reports SocketError as an unused const variable in every file that includes mp/util.h without using it (-Wunused-const-variable, enabled by bitcoin/bitcoin#36275; CI failure), and the #if KJ_NO_EXCEPTIONS check added in #364 fails -Wundef when the macro is not defined.

    Solution: Make SocketError an inline constexpr variable, the same change Bitcoin Core made to its own SocketError in bitcoin/bitcoin#35852, and check defined(KJ_NO_EXCEPTIONS) before testing its value. Also enable both warnings in CI here (-Wunused-const-variable in the GCC configs, -Wundef in default and llvm) so these problems are caught before a subtree update. Details are in the commit messages.

  2. util: Make SocketError inline constexpr
    Declare SocketError as an inline variable so the header does not define a
    separate internal-linkage copy in every translation unit that includes it.
    Bitcoin Core's build now enables -Wunused-const-variable (bitcoin/bitcoin#36275),
    which with GCC warns about unused const variables defined in headers and
    fails the build with -Werror in every file that includes mp/util.h without
    using SocketError. Bitcoin Core made the same change to its own SocketError
    definition in bitcoin/bitcoin#35852.
    
    This change was written with Claude Opus 5.5 (1M context).
    701449c165
  3. ci: Enable -Wunused-const-variable in GCC jobs
    Bitcoin Core builds the libmultiprocess subtree with -Wunused-const-variable
    (bitcoin/bitcoin#36275). With GCC this warns about unused const variables
    defined in headers, so a header-level constexpr that is not inline breaks the
    Bitcoin Core build. Enable it in the GCC-based CI configs to catch this here
    first. Clang's -Wunused-const-variable does not warn about variables defined
    in headers, so it is not added to the clang configs.
    
    This change was written with Claude Opus 5.5 (1M context).
    a8c64c7faa
  4. proxy-types: Avoid -Wundef error when KJ_NO_EXCEPTIONS is not defined
    Check that KJ_NO_EXCEPTIONS is defined before testing its value. Bitcoin
    Core builds the libmultiprocess subtree with -Wundef, so the plain
    `#if KJ_NO_EXCEPTIONS` check added in #364 fails the build with -Werror
    whenever the macro is not defined, which is the normal case.
    
    This change was written with Claude Opus 5.5 (1M context).
    debd42955e
  5. ci: Enable -Wundef in default and llvm jobs
    Bitcoin Core builds the libmultiprocess subtree with -Wundef, so a
    preprocessor check on an undefined macro breaks the Bitcoin Core build.
    Enable it in one GCC and one clang config to catch this here first.
    
    This change was written with Claude Opus 5.5 (1M context).
    3577d23f61
  6. DrahtBot commented at 12:11 AM on October 2, 2026: none

    <!--e57a25ab6845829454e8d69fc972939a-->

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

    <!--021abf342d371248e50ceaed478a90ca-->

    Reviews

    See the guideline and AI policy for information on the review process.

    Type Reviewers
    ACK maflcko, ViniciusCestarii, hebasto, Sjors

    If your review is incorrectly listed, please copy-paste <code>&lt;!--meta-tag:bot-skip--&gt;</code> into the comment that the bot should ignore.

    <!--174a7506f384e20aa4161008e828411d-->

    Conflicts

    Reviewers, this pull request conflicts with the following ones:

    • #342 (Allow request cancellation for wrapped C++ methods by xyzconstant)
    • #231 (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-->

  7. maflcko commented at 4:02 PM on October 2, 2026: contributor

    lgtm ACK 3577d23f616ec6e8d601d14452a5793f9d386708

  8. ViniciusCestarii commented at 4:56 PM on October 2, 2026: contributor

    tACK 3577d23f616ec6e8d601d14452a5793f9d386708

    Confirmed Bitcoin Core builds with libmultiprocess with these changes

  9. hebasto approved
  10. hebasto commented at 5:58 PM on October 3, 2026: member

    ACK 3577d23f616ec6e8d601d14452a5793f9d386708, I have reviewed the code and it looks OK.

  11. Sjors commented at 2:16 PM on October 7, 2026: member

    ACK 3577d23f616ec6e8d601d14452a5793f9d386708

  12. Sjors referenced this in commit 24b093a804 on Oct 7, 2026

github-metadata-mirror

This is a metadata mirror of the GitHub repository bitcoin-core/libmultiprocess. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2026-10-08 00:30 UTC

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