depends: native_libmultiprocess fails to build on OpenBSD #33219

issue hebasto openend this issue on August 19, 2025
  1. hebasto commented at 6:00 pm on August 19, 2025: member

    The native_libmultiprocess package fails to build on OpenBSD starting with #32345:

     0$ uname -a
     1OpenBSD openbsd.home 7.7 GENERIC.MP#625 amd64
     2$ gmake -j 1 -C depends/ MULTIPROCESS=1 native_libmultiprocess
     3gmake: Entering directory '/home/hebasto/dev/bitcoin/depends'
     4Extracting native_libmultiprocess...
     5(SHA256) /home/hebasto/dev/bitcoin/depends/sources/src-ipc-libmultiprocess.tar: OK
     6Preprocessing native_libmultiprocess...
     7Configuring native_libmultiprocess...
     8-- The CXX compiler identification is Clang 16.0.6
     9-- Detecting CXX compiler ABI info
    10-- Detecting CXX compiler ABI info - done
    11-- Check for working CXX compiler: /usr/bin/clang++ - skipped
    12-- Detecting CXX compile features
    13-- Detecting CXX compile features - done
    14-- Performing Test CMAKE_HAVE_LIBC_PTHREAD
    15-- Performing Test CMAKE_HAVE_LIBC_PTHREAD - Success
    16-- Found Threads: TRUE
    17-- Performing Test HAVE_PTHREAD_GETNAME_NP
    18-- Performing Test HAVE_PTHREAD_GETNAME_NP - Failed
    19-- Performing Test HAVE_PTHREAD_THREADID_NP
    20-- Performing Test HAVE_PTHREAD_THREADID_NP - Failed
    21-- Performing Test HAVE_PTHREAD_GETTHREADID_NP
    22-- Performing Test HAVE_PTHREAD_GETTHREADID_NP - Failed
    23-- Configuring done (1.6s)
    24-- Generating done (0.3s)
    25CMake Warning:
    26  Manually-specified variables were not used by the project:
    27
    28    CMAKE_EXPORT_NO_PACKAGE_REGISTRY
    29
    30
    31-- Build files have been written to: /home/hebasto/dev/bitcoin/depends/work/build/x86_64-unknown-openbsd7.7/native_libmultiprocess/-874c5f6e479
    32Building native_libmultiprocess...
    33gmake[1]: Entering directory '/home/hebasto/dev/bitcoin/depends/work/build/x86_64-unknown-openbsd7.7/native_libmultiprocess/-874c5f6e479'
    34[ 14%] Building CXX object CMakeFiles/mputil.dir/src/mp/util.cpp.o
    35[ 14%] Built target mputil
    36[ 28%] Compiling Cap'n Proto schema include/mp/proxy.capnp
    37[ 42%] Building CXX object CMakeFiles/multiprocess.dir/include/mp/proxy.capnp.c++.o
    38[ 57%] Building CXX object CMakeFiles/multiprocess.dir/src/mp/proxy.cpp.o
    39[ 71%] Linking CXX static library libmultiprocess.a
    40[ 71%] Built target multiprocess
    41[ 85%] Building CXX object CMakeFiles/mpgen.dir/src/mp/gen.cpp.o
    42[100%] Linking CXX executable mpgen
    43ld: warning: string.c++(string.c++.o:(kj::_::(anonymous namespace)::FloatToBuffer(float, char*)) in archive /home/hebasto/dev/bitcoin/depends/x86_64-unknown-openbsd7.7/native/lib/libkj.a): warning: strcpy() is almost always misused, please use strlcpy()
    44ld: warning: parser.c++(parser.c++.o:(capnp::compiler::CapnpParser::CapnpParser(capnp::Orphanage, capnp::compiler::ErrorReporter&)::$_39::operator()(capnp::compiler::(anonymous namespace)::Located<capnp::Text::Reader>&&, kj::Maybe<capnp::Orphan<capnp::compiler::LocatedInteger>>&&, capnp::compiler::(anonymous namespace)::Located<kj::Array<kj::Maybe<capnp::compiler::(anonymous namespace)::Located<capnp::Text::Reader>>>>&&, capnp::Orphan<capnp::compiler::Expression>&&, kj::Array<capnp::Orphan<capnp::compiler::Declaration::AnnotationApplication>>&&) const) in archive /home/hebasto/dev/bitcoin/depends/x86_64-unknown-openbsd7.7/native/lib/libcapnpc.a): warning: strcat() is almost always misused, please use strlcat()
    45ld: error: undefined hidden symbol: std::__1::basic_ostream<char, std::__1::char_traits<char>>& std::__1::operator<<[abi:v160006]<char, std::__1::char_traits<char>>(std::__1::basic_ostream<char, std::__1::char_traits<char>>&, std::__1::__thread_id)
    46>>> referenced by util.cpp
    47>>>               CMakeFiles/mputil.dir/src/mp/util.cpp.o:(mp::ThreadName(char const*))
    48clang++: error: linker command failed with exit code 1 (use -v to see invocation)
    49gmake[3]: *** [CMakeFiles/mpgen.dir/build.make:110: mpgen] Error 1
    50gmake[2]: *** [CMakeFiles/Makefile2:1138: CMakeFiles/mpgen.dir/all] Error 2
    51gmake[1]: *** [Makefile:146: all] Error 2
    52gmake[1]: Leaving directory '/home/hebasto/dev/bitcoin/depends/work/build/x86_64-unknown-openbsd7.7/native_libmultiprocess/-874c5f6e479'
    53gmake: *** [funcs.mk:345: /home/hebasto/dev/bitcoin/depends/work/build/x86_64-unknown-openbsd7.7/native_libmultiprocess/-874c5f6e479/./.stamp_built] Error 2
    54gmake: Leaving directory '/home/hebasto/dev/bitcoin/depends'
    
  2. hebasto added the label Build system on Aug 19, 2025
  3. hebasto commented at 6:02 pm on August 19, 2025: member
  4. Sjors commented at 6:06 pm on August 19, 2025: member
    @vasild if I remember correctly you had a PR to add ?BSD CI coverage?
  5. hebasto commented at 6:08 pm on August 19, 2025: member

    @vasild if I remember correctly you had a PR to add ?BSD CI coverage?

    For Bitcoin Core, see https://github.com/hebasto/bitcoin-core-nightly.

  6. Sjors commented at 6:14 pm on August 19, 2025: member
    Maybe we could have a label like “moar-ci” that runs these extra systems? Similar to how we can request guix builds.
  7. ryanofsky commented at 6:48 pm on August 19, 2025: contributor
    I am waiting for openbsd to slowly install in a vm. It might not be too hard to add an openbsd job in the libmultiprocess repository too with https://github.com/vmactions/openbsd-vm
  8. ryanofsky commented at 9:34 pm on August 19, 2025: contributor

    Thanks for the report and clear reproduction steps. Following change fixes the problem for me, and I guess this was caused by the IWYU commit in https://github.com/bitcoin-core/libmultiprocess/pull/184,

    0--- a/src/ipc/libmultiprocess/src/mp/util.cpp
    1+++ b/src/ipc/libmultiprocess/src/mp/util.cpp
    2@@ -16,6 +16,7 @@
    3 #include <sys/socket.h>
    4 #include <sys/wait.h>
    5 #include <system_error>
    6+#include <thread>
    7 #include <unistd.h>
    8 #include <utility>
    9 #include <vector>
    

    An alternate change also fixed the problem:

     0--- a/src/ipc/libmultiprocess/src/mp/util.cpp
     1+++ b/src/ipc/libmultiprocess/src/mp/util.cpp
     2@@ -69,7 +69,7 @@ std::string ThreadName(const char* exe_name)
     3 #elif defined(HAVE_PTHREAD_GETTHREADID_NP)
     4     buffer << pthread_getthreadid_np();
     5 #else
     6-    buffer << std::this_thread::get_id();
     7+    buffer << pthread_self();
     8 #endif
     9 
    10     return std::move(buffer).str();
    

    But the first change is probably better.


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: 2025-08-21 03:12 UTC

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