mpgen: Work around c++20 / capnproto 0.8 incompatibility #194

pull ryanofsky wants to merge 3 commits into bitcoin-core:master from ryanofsky:pr/string changing 8 files +92 −9
  1. ryanofsky commented at 8:20 pm on August 12, 2025: collaborator

    Fix ubuntu 22.04 compatibility issue reported by fanquake in https://github.com/bitcoin/bitcoin/issues/33176 and add CI job to make sure libmultiprocess stays compatible with old versions of Cap’n Proto.

    Changes are described in more detail in commit messages.

  2. DrahtBot commented at 8:20 pm on August 12, 2025: none

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

    Reviews

    See the guideline for information on the review process.

    Type Reviewers
    ACK Sjors, TheCharlatan

    If your review is incorrectly listed, please react with 👎 to this comment and the bot will ignore it on the next update.

  3. ryanofsky force-pushed on Aug 12, 2025
  4. ryanofsky commented at 9:50 pm on August 12, 2025: collaborator
    Updated 151ef65a7c91147aa14bfc1b044e997d973b44e8 -> c659685fba818b52e11f272ec8584a9fb72dbade (pr/string.1 -> pr/string.2, compare) testing some more intermediate versions Updated c659685fba818b52e11f272ec8584a9fb72dbade -> 88d95044a6cbf180f6c4cf6ed2e38e39c5bf4869 (pr/string.2 -> pr/string.3, compare) adding missing file
  5. ryanofsky force-pushed on Aug 12, 2025
  6. in shell.nix:33 in 88d95044a6 outdated
    29+      owner = "capnproto";
    30+      repo  = "capnproto";
    31+      rev   = "v${capnprotoVersion}";
    32+      hash  = lib.attrByPath [capnprotoVersion] "" capnprotoHashes;
    33+    };
    34+    patches = lib.optionals (lib.versionAtLeast capnprotoVersion "0.9.0" && lib.versionOlder capnprotoVersion "0.10.4") [ ./ci/patches/spaceship.patch ];
    


    Sjors commented at 9:36 am on August 13, 2025:
    88d95044a6cbf180f6c4cf6ed2e38e39c5bf4869: do I read this correctly as: apply patch to versions 0.9.0 <= … < 0.10.4?

    ryanofsky commented at 10:19 am on August 13, 2025:

    re: #194 (review)

    88d9504: do I read this correctly as: apply patch to versions 0.9.0 <= … < 0.10.4?

    Yes that’s right. These versions of capnproto added some c++20 support which didn’t actually work with later compiler versions.

  7. Sjors commented at 9:38 am on August 13, 2025: member
    utACK 88d95044a6cbf180f6c4cf6ed2e38e39c5bf4869
  8. mpgen: Work around c++20 / capnproto 0.8 incompatibility
    The kj/string.h header installed by capnproto 0.8 doesn't work well when
    compiling with -std=c++20 or later because the reverse StringPtr/char*
    comparison function it provides is broken in c++20:
    
    inline bool operator==(const char* a, const StringPtr& b) { return b == a; }
    
    Before C++20 this would implicitly convert `a` to a StringPtr and call the
    StringPtr::operator== method. But starting with C++20 it actually calls itself
    recursively and either loops forever or crashes.
    
    This problem was fixed upstream by
    https://github.com/capnproto/capnproto/pull/1170 in Cap'n Proto 0.9.0. Avoid
    the problem here for older versions by just not using the operator. A CI job
    testing older versions is added in the next commit to avoid similar breakage in
    the future.
    c4cb758ecc
  9. ci: Add olddeps job to test old dependencies versions
    The CI job currently just tests old Cap'n Proto versions, but it might be nice
    to extend in the future to test old compilers & build tools too.
    
    Support for versions of Cap'n Proto before 0.7.0 was dropped in
    https://github.com/bitcoin-core/libmultiprocess/pull/88 in order to avoid
    compiler warnings and simplify code. Before that, versions back to 0.5 were
    supported and are basically still compatible since the Cap'n Proto API hasn't
    changed and libmultiprocess does not rely on newer features.
    8ceeaa6ae4
  10. ryanofsky referenced this in commit cb170d4913 on Aug 13, 2025
  11. cmake, doc: Add check for CVE-2022-46149
    Also document minimum Cap'n Proto version in doc/install.md
    dc3ba22046
  12. ryanofsky force-pushed on Aug 13, 2025
  13. ryanofsky commented at 10:21 am on August 13, 2025: collaborator
    Rebased 88d95044a6cbf180f6c4cf6ed2e38e39c5bf4869 -> dc3ba2204606d8b5b681a6798407e68b3567e7a9 (pr/string.3 -> pr/string.4, compare) on top of #193 and added explicit check for CVE-2022-46149
  14. Sjors commented at 1:34 pm on August 13, 2025: member

    utACK dc3ba2204606d8b5b681a6798407e68b3567e7a9

    Thanks for adding the CVE version check.

  15. TheCharlatan approved
  16. TheCharlatan commented at 11:51 am on August 19, 2025: collaborator
    ACK dc3ba2204606d8b5b681a6798407e68b3567e7a9
  17. in CMakeLists.txt:32 in dc3ba22046
    28+   OR CapnProto_VERSION STREQUAL "0.9.0"
    29+   OR CapnProto_VERSION STREQUAL "0.9.1"
    30+   OR CapnProto_VERSION STREQUAL "0.10.0"
    31+   OR CapnProto_VERSION STREQUAL "0.10.1"
    32+   OR CapnProto_VERSION STREQUAL "0.10.2")
    33+  message(FATAL_ERROR
    


    maflcko commented at 2:21 pm on August 19, 2025:

    isn’t ipc a trusted interface, where anyone having access can already fully control the process (like calling createTransaction), so leaking memory should not make anything worse? A warning seems fine here? Also, a cve check seems a bit unrelated from a C++20 code workaround (from the title).

    Just a nit and not a blocker, but I wanted to mention it, since this will lead to a compile error on Ubuntu 22.04 (https://github.com/bitcoin/bitcoin/issues/33176#issuecomment-3183673187), for an option that will be enabled by default?


    ryanofsky commented at 2:52 pm on August 19, 2025:

    For ubuntu 22.04 if this will create confusion, I feel like a good solution might be to improve error message and documentation to specifically suggest disabling ENABLE_IPC, or installing a newer version of capnproto. Ideally it seems like ubuntu could update from 0.8.0 to 0.8.1 given 0.8.1 was released to fix the CVE and doesn’t have any other changes.

    On IPC being a trusted interface, it’s definitely true with the current interface, a malicious client could do a lot of things to crash the node and maybe even take control of it. But this doesn’t have to be the case. We could provide capnproto interfaces that do rigorously check all their inputs and enforce resource constraints. It would even be possible to adapt the Mining interface to do this, but it hasn’t been a reason to make the extra effort. I also feel like showing an error after discovering a package with a CVE is kind of a public service, since we don’t know if there may be other software using the package.

  18. willcl-ark referenced this in commit af8053ae38 on Aug 21, 2025
  19. ryanofsky merged this on Aug 22, 2025
  20. ryanofsky closed this on Aug 22, 2025

  21. in src/mp/gen.cpp:1 in c4cb758ecc outdated


    ryanofsky commented at 9:20 pm on August 22, 2025:

    In commit “mpgen: Work around c++20 / capnproto 0.8 incompatibility” (c4cb758eccb56f0d0c8bf26197156dfb5f6cb21c)

    I think commit message is wrong in suggesting that with c++20 the operator== function is buggy and will call itself recursively. It seems the reason this happens is not really because of c++20 but because of a gcc bug https://gcc.gnu.org/bugzilla/show_bug.cgi?id=53499. See also https://github.com/bitcoin/bitcoin/issues/33176#issuecomment-3194776823

  22. ryanofsky referenced this in commit dd68d0f40b on Aug 22, 2025
  23. Sjors referenced this in commit 38d7eeaddb on Aug 25, 2025
  24. Sjors referenced this in commit 18a717abb7 on Aug 25, 2025
  25. Sjors referenced this in commit 8ce3ac4bb8 on Aug 25, 2025
  26. achow101 referenced this in commit 6ca6f3b37b on Aug 25, 2025
  27. willcl-ark commented at 10:34 am on September 1, 2025: member

    I’m not sure, as you say this was fixed upstream in v0.9 , but I think I might still be hitting this on debian bookworm with 0.9.2?:

     0<snip>
     1
     2-- Checking for module 'capnp'
     3--   Found capnp, version 0.9.2
     4-- Checking for module 'capnpc'
     5--   Found capnpc, version 0.9.2
     6-- Checking for module 'capnp-rpc'
     7--   Found capnp-rpc, version 0.9.2
     8-- Checking for module 'capnp-json'
     9--   Found capnp-json, version 0.9.2
    10-- Checking for module 'capnp-websocket'
    11--   Found capnp-websocket, version 0.9.2
    12-- Checking for module 'kj'
    13--   Found kj, version 0.9.2
    14-- Checking for module 'kj-async'
    15--   Found kj-async, version 0.9.2
    16-- Checking for module 'kj-http'
    17--   Found kj-http, version 0.9.2
    18-- Checking for module 'kj-gzip'
    19--   Found kj-gzip, version 0.9.2
    20-- Checking for module 'kj-tls'
    21--   Found kj-tls, version 0.9.2
    22-- Checking for module 'kj-test'
    23--   Found kj-test, version 0.9.2
    24
    25<snip>
    26
    27C++ compiler .......................... Clang 19.1.4, /usr/bin/clang++-19
    28CMAKE_BUILD_TYPE ...................... RelWithDebInfo
    29Preprocessor defined macros ...........
    30C++ compiler flags .................... -O2 -g -std=c++20 -fPIC -fdebug-prefix-map=/src/bitcoin/src=. -fmacro-prefix-map=/src/bitcoin/src=. -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=3 -Wstack-protector -fstack-protector-all -fcf-protection=full -fstack-clash-protection -Wall -Wextra -Wgnu -Wformat -Wformat-security -Wvla -Wshadow-field -Wthread-safety -Wloop-analysis -Wredundant-decls -Wunused-member-function -Wdate-time -Wconditional-uninitialized -Woverloaded-virtual -Wsuggest-override -Wimplicit-fallthrough -Wunreachable-code -Wdocumentation -Wself-assign -Wundef -Wno-unused-parameter
    31Linker flags .......................... -O2 -g -fstack-protector-all -fcf-protection=full -fstack-clash-protection -Wl,-z,relro -Wl,-z,now -Wl,-z,separate-code -fPIE -pie
    32
    33<snip>
    34
    35In file included from /src/bitcoin/src/ipc/libmultiprocess/src/mp/util.cpp:6:
    36In file included from /src/bitcoin/src/ipc/libmultiprocess/include/mp/util.h:8:
    37In file included from /usr/include/capnp/schema.h:39:
    38In file included from /usr/include/capnp/schema.capnp.h:6:
    39In file included from /usr/include/capnp/generated-header-support.h:27:
    40In file included from /usr/include/capnp/layout.h:34:
    41/usr/include/capnp/blob.h:176:74: error: invalid operands to binary expression ('const char *' and 'kj::StringPtr')
    42  176 | inline bool operator==(const char* a, const Text::Builder& b) { return a == b.asString(); }
    43      |                                                                        ~ ^  ~~~~~~~~~~~~
    44/usr/include/kj/common.h:744:13: note: candidate function template not viable: no known conversion from 'kj::StringPtr' to 'MaxValue_' for 2nd argument
    45  744 | inline bool operator==(T t, MaxValue_) { return t == Decay<T>(maxValue); }
    46      |             ^               ~~~~~~~~~
    47/usr/include/kj/common.h:746:13: note: candidate function template not viable: no known conversion from 'kj::StringPtr' to 'MinValue_' for 2nd argument
    48  746 | inline bool operator==(T t, MinValue_) { return t == Decay<T>(minValue); }
    49      |             ^               ~~~~~~~~~
    50/usr/include/capnp/blob.h:176:13: note: candidate function not viable: no known conversion from 'kj::StringPtr' to 'const Text::Builder' for 2nd argument
    51  176 | inline bool operator==(const char* a, const Text::Builder& b) { return a == b.asString(); }
    52      |             ^                         ~~~~~~~~~~~~~~~~~~~~~~
    53/usr/include/kj/common.h:744:13: note: candidate function (with reversed parameter order) template not viable: no known conversion from 'const char *' to 'MaxValue_' for 1st argument
    54  744 | inline bool operator==(T t, MaxValue_) { return t == Decay<T>(maxValue); }
    55      |             ^          ~~~
    56/usr/include/kj/common.h:746:13: note: candidate function (with reversed parameter order) template not viable: no known conversion from 'const char *' to 'MinValue_' for 1st argument
    57  746 | inline bool operator==(T t, MinValue_) { return t == Decay<T>(minValue); }
    58      |             ^          ~~~
    59/usr/include/capnp/blob.h:176:13: note: candidate function (with reversed parameter order) not viable: no known conversion from 'const char *' to 'const Text::Builder' for 1st argument
    60  176 | inline bool operator==(const char* a, const Text::Builder& b) { return a == b.asString(); }
    61      |             ^          ~~~~~~~~~~~~~
    62/usr/include/capnp/blob.h:177:74: error: invalid operands to binary expression ('const char *' and 'kj::StringPtr')
    63  177 | inline bool operator!=(const char* a, const Text::Builder& b) { return a != b.asString(); }
    64      |                                                                        ~ ^  ~~~~~~~~~~~~
    65/usr/include/kj/common.h:744:13: note: candidate function template not viable: no known conversion from 'kj::StringPtr' to 'MaxValue_' for 2nd argument
    66  744 | inline bool operator==(T t, MaxValue_) { return t == Decay<T>(maxValue); }
    67      |             ^               ~~~~~~~~~
    68/usr/include/kj/common.h:746:13: note: candidate function template not viable: no known conversion from 'kj::StringPtr' to 'MinValue_' for 2nd argument
    69  746 | inline bool operator==(T t, MinValue_) { return t == Decay<T>(minValue); }
    70      |             ^               ~~~~~~~~~
    71/usr/include/capnp/blob.h:176:13: note: candidate function not viable: no known conversion from 'kj::StringPtr' to 'const Text::Builder' for 2nd argument
    72  176 | inline bool operator==(const char* a, const Text::Builder& b) { return a == b.asString(); }
    73      |             ^                         ~~~~~~~~~~~~~~~~~~~~~~
    74/usr/include/capnp/blob.h:177:13: note: candidate function not viable: no known conversion from 'kj::StringPtr' to 'const Text::Builder' for 2nd argument
    75  177 | inline bool operator!=(const char* a, const Text::Builder& b) { return a != b.asString(); }
    76      |             ^                         ~~~~~~~~~~~~~~~~~~~~~~
    77/usr/include/kj/common.h:744:13: note: candidate function (with reversed parameter order) template not viable: no known conversion from 'const char *' to 'MaxValue_' for 1st argument
    78  744 | inline bool operator==(T t, MaxValue_) { return t == Decay<T>(maxValue); }
    79      |             ^          ~~~
    80/usr/include/kj/common.h:746:13: note: candidate function (with reversed parameter order) template not viable: no known conversion from 'const char *' to 'MinValue_' for 1st argument
    81  746 | inline bool operator==(T t, MinValue_) { return t == Decay<T>(minValue); }
    82      |             ^          ~~~
    832 errors generated.
    84gmake[2]: *** [src/ipc/libmultiprocess/CMakeFiles/mputil.dir/build.make:76: src/ipc/libmultiprocess/CMakeFiles/mputil.dir/src/mp/util.cpp.o] Error 1
    85gmake[1]: *** [CMakeFiles/Makefile2:900: src/ipc/libmultiprocess/CMakeFiles/mputil.dir/all] Error 2
    86gmake[1]: *** Waiting for unfinished jobs....
    

    log.txt

    May also be a different issue (in which case I can open a new issue here or in bitcoin/bitcoin if that would be more appropriate).

  28. maflcko commented at 11:12 am on September 1, 2025: contributor

    I’m not sure, as you say this was fixed upstream in v0.9 , but I think I might still be hitting this on debian bookworm with 0.9.2?:

    Yeah, to reproduce:

     0diff --git a/ci/configs/openbsd.bash b/ci/configs/openbsd.bash
     1index a404e2b..70ae010 100644
     2--- a/ci/configs/openbsd.bash
     3+++ b/ci/configs/openbsd.bash
     4@@ -1,5 +1,6 @@
     5 CI_DESC="CI config for OpenBSD"
     6 CI_DIR=build-openbsd
     7+export CXX=clang++-16
     8 export CXXFLAGS="-Werror -Wall -Wextra -Wpedantic -Wno-unused-parameter"
     9 CMAKE_ARGS=(-G Ninja)
    10 BUILD_ARGS=(-k 0)
    

    And (on debian:bookworm !):

      0# CI_CLEAN=1 CI_CONFIG="ci/configs/openbsd.bash" bash ci/scripts/ci.sh 
      1+ '[' x ']'
      2+ source ci/configs/openbsd.bash
      3++ CI_DESC='CI config for OpenBSD'
      4++ CI_DIR=build-openbsd
      5++ export CXX=clang++-16
      6++ CXX=clang++-16
      7++ export 'CXXFLAGS=-Werror -Wall -Wextra -Wpedantic -Wno-unused-parameter'
      8++ CXXFLAGS='-Werror -Wall -Wextra -Wpedantic -Wno-unused-parameter'
      9++ CMAKE_ARGS=(-G Ninja)
     10++ BUILD_ARGS=(-k 0)
     11+ : build-openbsd
     12+ '[' -v BUILD_TARGETS ']'
     13+ BUILD_TARGETS=(all tests mpexamples)
     14+ '[' -n 1 ']'
     15+ rm -rf build-openbsd
     16+ cmake -B build-openbsd -G Ninja
     17-- The CXX compiler identification is Clang 16.0.6
     18-- Detecting CXX compiler ABI info
     19-- Detecting CXX compiler ABI info - done
     20-- Check for working CXX compiler: /usr/bin/clang++-16 - skipped
     21-- Detecting CXX compile features
     22-- Detecting CXX compile features - done
     23-- Performing Test CMAKE_HAVE_LIBC_PTHREAD
     24-- Performing Test CMAKE_HAVE_LIBC_PTHREAD - Success
     25-- Found Threads: TRUE  
     26-- Found OpenSSL: /usr/lib/x86_64-linux-gnu/libcrypto.so (found version "3.0.17") found components: Crypto SSL 
     27-- Found PkgConfig: /usr/bin/pkg-config (found version "1.8.1") 
     28-- Checking for module 'capnp'
     29--   Found capnp, version 0.9.2
     30-- Checking for module 'capnpc'
     31--   Found capnpc, version 0.9.2
     32-- Checking for module 'capnp-rpc'
     33--   Found capnp-rpc, version 0.9.2
     34-- Checking for module 'capnp-json'
     35--   Found capnp-json, version 0.9.2
     36-- Checking for module 'capnp-websocket'
     37--   Found capnp-websocket, version 0.9.2
     38-- Checking for module 'kj'
     39--   Found kj, version 0.9.2
     40-- Checking for module 'kj-async'
     41--   Found kj-async, version 0.9.2
     42-- Checking for module 'kj-http'
     43--   Found kj-http, version 0.9.2
     44-- Checking for module 'kj-gzip'
     45--   Found kj-gzip, version 0.9.2
     46-- Checking for module 'kj-tls'
     47--   Found kj-tls, version 0.9.2
     48-- Checking for module 'kj-test'
     49--   Found kj-test, version 0.9.2
     50-- Performing Test HAVE_PTHREAD_GETNAME_NP
     51-- Performing Test HAVE_PTHREAD_GETNAME_NP - Success
     52-- Performing Test HAVE_PTHREAD_THREADID_NP
     53-- Performing Test HAVE_PTHREAD_THREADID_NP - Failed
     54-- Performing Test HAVE_PTHREAD_GETTHREADID_NP
     55-- Performing Test HAVE_PTHREAD_GETTHREADID_NP - Failed
     56-- Configuring done
     57-- Generating done
     58-- Build files have been written to: /libmultiprocess/build-openbsd
     59+ cmake --build build-openbsd -t all tests mpexamples -- -k 0
     60[1/59] Building CXX object CMakeFiles/mputil.dir/src/mp/util.cpp.o
     61FAILED: CMakeFiles/mputil.dir/src/mp/util.cpp.o 
     62/usr/bin/clang++-16  -I/libmultiprocess/include -I/libmultiprocess/build-openbsd/include -Werror -Wall -Wextra -Wpedantic -Wno-unused-parameter -std=gnu++20 -MD -MT CMakeFiles/mputil.dir/src/mp/util.cpp.o -MF CMakeFiles/mputil.dir/src/mp/util.cpp.o.d -o CMakeFiles/mputil.dir/src/mp/util.cpp.o -c /libmultiprocess/src/mp/util.cpp
     63In file included from /libmultiprocess/src/mp/util.cpp:6:
     64In file included from /libmultiprocess/include/mp/util.h:8:
     65In file included from /usr/include/capnp/schema.h:39:
     66In file included from /usr/include/capnp/schema.capnp.h:6:
     67In file included from /usr/include/capnp/generated-header-support.h:27:
     68In file included from /usr/include/capnp/layout.h:34:
     69/usr/include/capnp/blob.h:176:74: error: invalid operands to binary expression ('const char *' and 'kj::StringPtr')
     70inline bool operator==(const char* a, const Text::Builder& b) { return a == b.asString(); }
     71                                                                       ~ ^  ~~~~~~~~~~~~
     72/usr/include/kj/common.h:744:13: note: candidate function template not viable: no known conversion from 'kj::StringPtr' to 'MaxValue_' for 2nd argument
     73inline bool operator==(T t, MaxValue_) { return t == Decay<T>(maxValue); }
     74            ^
     75/usr/include/kj/common.h:744:13: note: candidate function (with reversed parameter order) template not viable: no known conversion from 'const char *' to 'MaxValue_' for 1st argument
     76/usr/include/kj/common.h:746:13: note: candidate function template not viable: no known conversion from 'kj::StringPtr' to 'MinValue_' for 2nd argument
     77inline bool operator==(T t, MinValue_) { return t == Decay<T>(minValue); }
     78            ^
     79/usr/include/kj/common.h:746:13: note: candidate function (with reversed parameter order) template not viable: no known conversion from 'const char *' to 'MinValue_' for 1st argument
     80/usr/include/capnp/blob.h:176:13: note: candidate function not viable: no known conversion from 'kj::StringPtr' to 'const Text::Builder' for 2nd argument
     81inline bool operator==(const char* a, const Text::Builder& b) { return a == b.asString(); }
     82            ^                                                               ~~~~~~~~~~~~
     83/usr/include/capnp/blob.h:176:13: note: candidate function (with reversed parameter order) not viable: no known conversion from 'const char *' to 'const Text::Builder' for 1st argument
     84inline bool operator==(const char* a, const Text::Builder& b) { return a == b.asString(); }
     85            ^                                                          ~
     86/usr/include/capnp/blob.h:177:74: error: invalid operands to binary expression ('const char *' and 'kj::StringPtr')
     87inline bool operator!=(const char* a, const Text::Builder& b) { return a != b.asString(); }
     88                                                                       ~ ^  ~~~~~~~~~~~~
     89/usr/include/kj/common.h:744:13: note: candidate function template not viable: no known conversion from 'kj::StringPtr' to 'MaxValue_' for 2nd argument
     90inline bool operator==(T t, MaxValue_) { return t == Decay<T>(maxValue); }
     91            ^
     92/usr/include/kj/common.h:744:13: note: candidate function (with reversed parameter order) template not viable: no known conversion from 'const char *' to 'MaxValue_' for 1st argument
     93/usr/include/kj/common.h:746:13: note: candidate function template not viable: no known conversion from 'kj::StringPtr' to 'MinValue_' for 2nd argument
     94inline bool operator==(T t, MinValue_) { return t == Decay<T>(minValue); }
     95            ^
     96/usr/include/kj/common.h:746:13: note: candidate function (with reversed parameter order) template not viable: no known conversion from 'const char *' to 'MinValue_' for 1st argument
     97/usr/include/capnp/blob.h:176:13: note: candidate function not viable: no known conversion from 'kj::StringPtr' to 'const Text::Builder' for 2nd argument
     98inline bool operator==(const char* a, const Text::Builder& b) { return a == b.asString(); }
     99            ^
    100/usr/include/capnp/blob.h:177:13: note: candidate function not viable: no known conversion from 'kj::StringPtr' to 'const Text::Builder' for 2nd argument
    101inline bool operator!=(const char* a, const Text::Builder& b) { return a != b.asString(); }
    102            ^                                                               ~~~~~~~~~~~~
    1032 errors generated.
    104[2/59] Building CXX object CMakeFiles/mpgen.dir/src/mp/gen.cpp.o
    105FAILED: CMakeFiles/mpgen.dir/src/mp/gen.cpp.o 
    106/usr/bin/clang++-16  -I/libmultiprocess/build-openbsd/include -I/libmultiprocess/include -Werror -Wall -Wextra -Wpedantic -Wno-unused-parameter -std=gnu++20 -MD -MT CMakeFiles/mpgen.dir/src/mp/gen.cpp.o -MF CMakeFiles/mpgen.dir/src/mp/gen.cpp.o.d -o CMakeFiles/mpgen.dir/src/mp/gen.cpp.o -c /libmultiprocess/src/mp/gen.cpp
    107In file included from /libmultiprocess/src/mp/gen.cpp:6:
    108In file included from /libmultiprocess/include/mp/util.h:8:
    109In file included from /usr/include/capnp/schema.h:39:
    110In file included from /usr/include/capnp/schema.capnp.h:6:
    111In file included from /usr/include/capnp/generated-header-support.h:27:
    112In file included from /usr/include/capnp/layout.h:34:
    113/usr/include/capnp/blob.h:176:74: error: invalid operands to binary expression ('const char *' and 'kj::StringPtr')
    114inline bool operator==(const char* a, const Text::Builder& b) { return a == b.asString(); }
    115                                                                       ~ ^  ~~~~~~~~~~~~
    116/usr/include/kj/common.h:744:13: note: candidate function template not viable: no known conversion from 'kj::StringPtr' to 'MaxValue_' for 2nd argument
    117inline bool operator==(T t, MaxValue_) { return t == Decay<T>(maxValue); }
    118            ^
    119/usr/include/kj/common.h:744:13: note: candidate function (with reversed parameter order) template not viable: no known conversion from 'const char *' to 'MaxValue_' for 1st argument
    120/usr/include/kj/common.h:746:13: note: candidate function template not viable: no known conversion from 'kj::StringPtr' to 'MinValue_' for 2nd argument
    121inline bool operator==(T t, MinValue_) { return t == Decay<T>(minValue); }
    122            ^
    123/usr/include/kj/common.h:746:13: note: candidate function (with reversed parameter order) template not viable: no known conversion from 'const char *' to 'MinValue_' for 1st argument
    124/usr/include/capnp/blob.h:176:13: note: candidate function not viable: no known conversion from 'kj::StringPtr' to 'const Text::Builder' for 2nd argument
    125inline bool operator==(const char* a, const Text::Builder& b) { return a == b.asString(); }
    126            ^                                                               ~~~~~~~~~~~~
    127/usr/include/capnp/blob.h:176:13: note: candidate function (with reversed parameter order) not viable: no known conversion from 'const char *' to 'const Text::Builder' for 1st argument
    128inline bool operator==(const char* a, const Text::Builder& b) { return a == b.asString(); }
    129            ^                                                          ~
    130/usr/include/capnp/blob.h:177:74: error: invalid operands to binary expression ('const char *' and 'kj::StringPtr')
    131inline bool operator!=(const char* a, const Text::Builder& b) { return a != b.asString(); }
    132                                                                       ~ ^  ~~~~~~~~~~~~
    133/usr/include/kj/common.h:744:13: note: candidate function template not viable: no known conversion from 'kj::StringPtr' to 'MaxValue_' for 2nd argument
    134inline bool operator==(T t, MaxValue_) { return t == Decay<T>(maxValue); }
    135            ^
    136/usr/include/kj/common.h:744:13: note: candidate function (with reversed parameter order) template not viable: no known conversion from 'const char *' to 'MaxValue_' for 1st argument
    137/usr/include/kj/common.h:746:13: note: candidate function template not viable: no known conversion from 'kj::StringPtr' to 'MinValue_' for 2nd argument
    138inline bool operator==(T t, MinValue_) { return t == Decay<T>(minValue); }
    139            ^
    140/usr/include/kj/common.h:746:13: note: candidate function (with reversed parameter order) template not viable: no known conversion from 'const char *' to 'MinValue_' for 1st argument
    141/usr/include/capnp/blob.h:176:13: note: candidate function not viable: no known conversion from 'kj::StringPtr' to 'const Text::Builder' for 2nd argument
    142inline bool operator==(const char* a, const Text::Builder& b) { return a == b.asString(); }
    143            ^
    144/usr/include/capnp/blob.h:177:13: note: candidate function not viable: no known conversion from 'kj::StringPtr' to 'const Text::Builder' for 2nd argument
    145inline bool operator!=(const char* a, const Text::Builder& b) { return a != b.asString(); }
    146            ^                                                               ~~~~~~~~~~~~
    1472 errors generated.
    148ninja: build stopped: cannot make progress due to previous errors.
    
  29. ryanofsky commented at 2:16 pm on September 1, 2025: collaborator

    re: @willcl-ark #194 (comment)

    I’m not sure, as you say this was fixed upstream in v0.9 , but I think I might still be hitting this on debian bookworm with 0.9.2?:

    If I’m interpreting correctly, debian bookworm uses clang 14 according to https://packages.debian.org/bookworm/clang so maybe doesn’t have this issue by default, but I think you will run into this problem with clang-16 and newer. I made a new issue for this #199 so maybe we can figure out a solution there

  30. janus referenced this in commit ab3a29600f on Sep 15, 2025

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: 2025-12-04 19:30 UTC

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