Skip to content

Conversation

maflcko
Copy link
Contributor

@maflcko maflcko commented Aug 20, 2025

@DrahtBot
Copy link

DrahtBot commented Aug 20, 2025

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 hebasto, ryanofsky

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

- uses: actions/checkout@v4

- name: Start OpenBSD VM
uses: vmactions/openbsd-vm@v1
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess this needs to be added, like #184 (comment).

(I can't vouch for this action, but I guess it should be fine to enable, even if backdoored?)

@Sjors
Copy link
Member

Sjors commented Aug 21, 2025

Why doesn't this fail? bitcoin/bitcoin#33219

@maflcko
Copy link
Contributor Author

maflcko commented Aug 21, 2025

Why doesn't this fail? bitcoin/bitcoin#33219

It does fail. See the previous comment on why the CI is not run here.

@ryanofsky
Copy link
Collaborator

It does fail. See the previous comment on why the CI is not run here.

This is great! Thanks for adding this. I added vmactions/openbsd-vm@* to https://github.com/bitcoin-core/libmultiprocess/settings/actions, so maybe CI could be triggered here now. Could consider adding the #include fix from bitcoin/bitcoin#33219 (comment) here too

@maflcko maflcko force-pushed the ci-bsd branch 2 times, most recently from 36b4765 to 4333bf8 Compare August 21, 2025 13:03
@maflcko
Copy link
Contributor Author

maflcko commented Aug 21, 2025

Force pushed to fix the bugs found by the LLM 😅 (existential sweat smile)

@maflcko
Copy link
Contributor Author

maflcko commented Aug 21, 2025

Build failure as expected in https://github.com/bitcoin-core/libmultiprocess/actions/runs/17128243881/job/48585209051?pr=195#step:5:2:

  cd /home/runner/work/libmultiprocess/libmultiprocess
  CI_CONFIG="ci/configs/openbsd.bash" bash ci/scripts/ci.sh
  shell: /home/runner/.local/bin/openbsd {0}
+ '[' x ']'
+ source ci/configs/openbsd.bash
++ CI_DESC='CI config for OpenBSD'
++ CI_DIR=build-openbsd
++ export 'CXXFLAGS=-Werror -Wall -Wextra -Wpedantic -Wno-unused-parameter'
++ CXXFLAGS='-Werror -Wall -Wextra -Wpedantic -Wno-unused-parameter'
++ CMAKE_ARGS=(-G Ninja)
++ BUILD_ARGS=(-k 0)
+ : build-openbsd
+ '[' -v BUILD_TARGETS ']'
+ BUILD_TARGETS=(all tests mpexamples)
+ '[' -n '' ']'
+ cmake -B build-openbsd -G Ninja
-- The CXX compiler identification is Clang 16.0.6
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: /usr/bin/c++ - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Found OpenSSL: /usr/lib/libcrypto.so.56.0 (found version "2.0.0") found components: Crypto SSL
-- Found ZLIB: /usr/lib/libz.so.7.1 (found version "1.3.1.1")
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD - Success
-- Found Threads: TRUE
-- Performing Test HAVE_PTHREAD_GETNAME_NP
-- Performing Test HAVE_PTHREAD_GETNAME_NP - Failed
-- Performing Test HAVE_PTHREAD_THREADID_NP
-- Performing Test HAVE_PTHREAD_THREADID_NP - Failed
-- Performing Test HAVE_PTHREAD_GETTHREADID_NP
-- Performing Test HAVE_PTHREAD_GETTHREADID_NP - Failed
-- Configuring done (2.9s)
-- Generating done (0.1s)
-- Build files have been written to: /home/runner/work/libmultiprocess/libmultiprocess/build-openbsd
+ cmake --build build-openbsd -t all tests mpexamples -- -k 0
[1/59] Building CXX object CMakeFiles/mputil.dir/src/mp/util.cpp.o
[2/59] Compiling Cap'n Proto schema include/mp/proxy.capnp
[3/59] Building CXX object CMakeFiles/multiprocess.dir/include/mp/proxy.capnp.c++.o
[4/59] Building CXX object CMakeFiles/mpgen.dir/src/mp/gen.cpp.o
[5/59] Linking CXX executable mpgen
FAILED: mpgen 
: && /usr/bin/c++ -Werror -Wall -Wextra -Wpedantic -Wno-unused-parameter -Xlinker --dependency-file=CMakeFiles/mpgen.dir/link.d CMakeFiles/mputil.dir/src/mp/util.cpp.o CMakeFiles/mpgen.dir/src/mp/gen.cpp.o -o mpgen  /usr/local/lib/libcapnp.a  /usr/local/lib/libcapnp-rpc.a  /usr/local/lib/libcapnpc.a  /usr/local/lib/libkj.a  /usr/local/lib/libkj-async.a  /usr/local/lib/libcapnp.a  /usr/local/lib/libkj.a  -lpthread  -Wl,-rpath-link,/usr/X11R6/lib:/usr/local/lib && :
ld: warning: parser.c++(parser.c++.o:(kj::parse::ParserRef<kj::parse::IteratorInput<capnp::compiler::Token::Reader, capnp::_::IndexingIterator<capnp::List<capnp::compiler::Token, (capnp::Kind)3>::Reader const, capnp::compiler::Token::Reader>>, capnp::compiler::CapnpParser::DeclParserResult>::WrapperImpl<kj::parse::Transform_<kj::parse::Sequence_<kj::parse::TransformOrReject_<kj::parse::TransformOrReject_<kj::parse::Any_ const&, capnp::compiler::(anonymous namespace)::MatchTokenType<capnp::Text::Reader, (capnp::compiler::Token::Which)0, &capnp::compiler::Token::Reader::getIdentifier() const>> const&, capnp::compiler::(anonymous namespace)::ExactString>, kj::parse::TransformOrReject_<kj::parse::Any_ const&, capnp::compiler::(anonymous namespace)::MatchTokenType<capnp::Text::Reader, (capnp::compiler::Token::Which)0, &capnp::compiler::Token::Reader::getIdentifier() const>> const&, kj::parse::Optional_<kj::parse::ParserRef<kj::parse::IteratorInput<capnp::compiler::Token::Reader, capnp::_::IndexingIterator<capnp::L
ld: 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)
>>> referenced by util.cpp
>>>               CMakeFiles/mputil.dir/src/mp/util.cpp.o:(mp::ThreadName(char const*))
c++: error: linker command failed with exit code 1 (use -v to see invocation)
[6/59] Building CXX object CMakeFiles/multiprocess.dir/src/mp/proxy.cpp.o
[7/59] Linking CXX static library libmultiprocess.a
ninja: build stopped: cannot make progress due to previous errors.

This is required for OpenBSD.

Authored by Ryan in bitcoin/bitcoin#33219 (comment)
@ryanofsky
Copy link
Collaborator

In dd40897 https://github.com/bitcoin-core/libmultiprocess/actions/runs/17128945048/job/48587647670?pr=195 looks like a new error linking the mpexample program ld: error: unable to find library -lstdc++fs. I don't think I tried to build this in my openbsd build, so would need to look into a fix. Possible workaround might be to not build this target for now

@ryanofsky
Copy link
Collaborator

I am also just now realizing the gnu32 job is very slow when run CI because it seems to be building a lot of things. It is fast when I run it locally, but that's because the nix outputs are cached. Should look into how to set up caching in CI.

@maflcko
Copy link
Contributor Author

maflcko commented Aug 21, 2025

thx, excluded. Looks like it passes now

@ryanofsky
Copy link
Collaborator

Actually I think I see what was causing the error. I think we just need to get rid of this line:

target_link_libraries(mpexample PRIVATE stdc++fs)

It is probably safe to just delete. Chatgpt says it is only needed on older versions of gcc so could be replaced with:

# Only link stdc++fs on ancient GCC that needed it (we don't support these, but document the rule).
if(CMAKE_CXX_COMPILER_ID STREQUAL "GNU" AND CMAKE_CXX_COMPILER_VERSION VERSION_LESS 9)
  target_link_libraries(mpexample PRIVATE stdc++fs)
endif()

But I think we don't care about compilers that old (2019)

This is no longer needed, according to
https://en.cppreference.com/w/cpp/filesystem.html#Notes:

> Using this library may require additional compiler/linker options. GNU
> implementation prior to 9.1 requires linking with -lstdc++fs and LLVM
> implementation prior to LLVM 9.0 requires linking with -lc++fs.

Also, it is causing a OpenBSD link error:

[54/59] Linking CXX executable example/mpexample
FAILED: example/mpexample
: && /usr/bin/c++ -Werror -Wall -Wextra -Wpedantic -Wno-unused-parameter -Xlinker --dependency-file=example/CMakeFiles/mpexample.dir/link.d example/CMakeFiles/mpexample.dir/example.cpp.o example/CMakeFiles/mpexample.dir/init.capnp.c++.o example/CMakeFiles/mpexample.dir/init.capnp.proxy-client.c++.o example/CMakeFiles/mpexample.dir/init.capnp.proxy-server.c++.o example/CMakeFiles/mpexample.dir/init.capnp.proxy-types.c++.o example/CMakeFiles/mpexample.dir/calculator.capnp.c++.o example/CMakeFiles/mpexample.dir/calculator.capnp.proxy-client.c++.o example/CMakeFiles/mpexample.dir/calculator.capnp.proxy-server.c++.o example/CMakeFiles/mpexample.dir/calculator.capnp.proxy-types.c++.o example/CMakeFiles/mpexample.dir/printer.capnp.c++.o example/CMakeFiles/mpexample.dir/printer.capnp.proxy-client.c++.o example/CMakeFiles/mpexample.dir/printer.capnp.proxy-server.c++.o example/CMakeFiles/mpexample.dir/printer.capnp.proxy-types.c++.o -o example/mpexample  libmultiprocess.a  -lstdc++fs  /usr/local/lib/libcapnp-rpc.a  /usr/local/lib/libcapnp.a  /usr/local/lib/libkj-async.a  /usr/local/lib/libkj.a  -lpthread  -Wl,-rpath-link,/usr/X11R6/lib:/usr/local/lib && :
ld: error: unable to find library -lstdc++fs
c++: error: linker command failed with exit code 1 (use -v to see invocation)
@maflcko
Copy link
Contributor Author

maflcko commented Aug 21, 2025

thx, removed it

Copy link
Member

@hebasto hebasto left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ACK 486a510.

Also, add name: build • openbsd
@maflcko
Copy link
Contributor Author

maflcko commented Aug 22, 2025

thx, used v5 for all tasks, to avoid having to touch this file again for the same reason

Copy link
Member

@hebasto hebasto left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ACK eed42f2.

Copy link
Collaborator

@ryanofsky ryanofsky left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code review ACK eed42f2. Nice changes!


- name: Run CI script
run: |
cd ${{ github.workspace }}
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In commit "ci: Add openbsd" (98414e7)

Seems like this line might redundant according to https://github.com/vmactions/openbsd-vm "you will have the same directory". Would be nice if if it could be dropped to be simpler and consistent with the other job

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

When defaults.run.shell runs, the working directory is /root, so cd ${{ github.workspace }} is still necessary.

- name: Run CI script
run: |
cd ${{ github.workspace }}
CI_CONFIG="ci/configs/openbsd.bash" bash ci/scripts/ci.sh
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In commit "ci: Add openbsd" (98414e7)

Note: It seems to be necessary to set CI_CONFIG this way instead of with env: because only github environment variables and environment variables in envs: are shared with the vm according to https://github.com/vmactions/openbsd-vm/blob/main/README.md

@ryanofsky ryanofsky merged commit f1fad39 into bitcoin-core:master Aug 22, 2025
5 checks passed
ryanofsky added a commit to ryanofsky/bitcoin that referenced this pull request Aug 22, 2025
…6f1e54

1b8d4a6f1e54 Merge bitcoin-core/libmultiprocess#194: mpgen: Work around c++20 / capnproto 0.8 incompatibility
f1fad396bf5f Merge bitcoin-core/libmultiprocess#195: ci: Add openbsd
eed42f210d17 ci: Bump all tasks to actions/checkout@v5
486a510bbeff ci: Remove ancient and problematic -lstdc++fs in mpexample
dd40897efe79 Add missing thread include
98414e7d2867 ci: Add openbsd
dc3ba2204606 cmake, doc: Add check for CVE-2022-46149
cb170d4913a2 Merge bitcoin-core/libmultiprocess#193: build: require CapnProto 0.7.0 or better
8ceeaa6ae401 ci: Add olddeps job to test old dependencies versions
c4cb758eccb5 mpgen: Work around c++20 / capnproto 0.8 incompatibility
30930dff7b06 build: require CapnProto 0.7.0 or better

git-subtree-dir: src/ipc/libmultiprocess
git-subtree-split: 1b8d4a6f1e54b92708bd2ad627ec6d440a1daf3d
@maflcko maflcko deleted the ci-bsd branch August 23, 2025 05:39
@maflcko maflcko mentioned this pull request Aug 24, 2025
Sjors added a commit to Sjors/bitcoin that referenced this pull request Aug 25, 2025
1b8d4a6f1e Merge bitcoin-core/libmultiprocess#194: mpgen: Work around c++20 / capnproto 0.8 incompatibility
f1fad396bf Merge bitcoin-core/libmultiprocess#195: ci: Add openbsd
eed42f210d ci: Bump all tasks to actions/checkout@v5
486a510bbe ci: Remove ancient and problematic -lstdc++fs in mpexample
dd40897efe Add missing thread include
98414e7d28 ci: Add openbsd
dc3ba22046 cmake, doc: Add check for CVE-2022-46149
cb170d4913 Merge bitcoin-core/libmultiprocess#193: build: require CapnProto 0.7.0 or better
8ceeaa6ae4 ci: Add olddeps job to test old dependencies versions
c4cb758ecc mpgen: Work around c++20 / capnproto 0.8 incompatibility
30930dff7b build: require CapnProto 0.7.0 or better

git-subtree-dir: src/ipc/libmultiprocess
git-subtree-split: 1b8d4a6f1e54b92708bd2ad627ec6d440a1daf3d
Sjors added a commit to Sjors/bitcoin that referenced this pull request Aug 25, 2025
1b8d4a6f1e Merge bitcoin-core/libmultiprocess#194: mpgen: Work around c++20 / capnproto 0.8 incompatibility
f1fad396bf Merge bitcoin-core/libmultiprocess#195: ci: Add openbsd
eed42f210d ci: Bump all tasks to actions/checkout@v5
486a510bbe ci: Remove ancient and problematic -lstdc++fs in mpexample
dd40897efe Add missing thread include
98414e7d28 ci: Add openbsd
dc3ba22046 cmake, doc: Add check for CVE-2022-46149
cb170d4913 Merge bitcoin-core/libmultiprocess#193: build: require CapnProto 0.7.0 or better
8ceeaa6ae4 ci: Add olddeps job to test old dependencies versions
c4cb758ecc mpgen: Work around c++20 / capnproto 0.8 incompatibility
30930dff7b build: require CapnProto 0.7.0 or better

git-subtree-dir: src/ipc/libmultiprocess
git-subtree-split: 1b8d4a6f1e54b92708bd2ad627ec6d440a1daf3d
Sjors added a commit to Sjors/bitcoin that referenced this pull request Aug 25, 2025
1b8d4a6f1e Merge bitcoin-core/libmultiprocess#194: mpgen: Work around c++20 / capnproto 0.8 incompatibility
f1fad396bf Merge bitcoin-core/libmultiprocess#195: ci: Add openbsd
eed42f210d ci: Bump all tasks to actions/checkout@v5
486a510bbe ci: Remove ancient and problematic -lstdc++fs in mpexample
dd40897efe Add missing thread include
98414e7d28 ci: Add openbsd
dc3ba22046 cmake, doc: Add check for CVE-2022-46149
cb170d4913 Merge bitcoin-core/libmultiprocess#193: build: require CapnProto 0.7.0 or better
8ceeaa6ae4 ci: Add olddeps job to test old dependencies versions
c4cb758ecc mpgen: Work around c++20 / capnproto 0.8 incompatibility
30930dff7b build: require CapnProto 0.7.0 or better

git-subtree-dir: src/ipc/libmultiprocess
git-subtree-split: 1b8d4a6f1e54b92708bd2ad627ec6d440a1daf3d
achow101 added a commit to bitcoin/bitcoin that referenced this pull request Aug 25, 2025
dd68d0f Squashed 'src/ipc/libmultiprocess/' changes from b4120d34bad2..1b8d4a6f1e54 (Ryan Ofsky)

Pull request description:

  Includes:

  - bitcoin-core/libmultiprocess#193
  - bitcoin-core/libmultiprocess#195
  - bitcoin-core/libmultiprocess#194

  These changes are needed to build fix libmultiprocess build issue that happens on OpenBSD and work around an incompatibility between GCC versions <14 and cap'nproto versions  <0.9 when compiling with c++20 that was fixed upstream in capnproto/capnproto#1170. The issues were reported:

  - #33219
  - #33176
  - willcl-ark/bitcoin-core-docker#43

  The fixes added CI jobs upstream to catch these issues earlier.

  The changes can be verified by running `test/lint/git-subtree-check.sh src/ipc/libmultiprocess` as described in [developer notes](https://github.com/bitcoin/bitcoin/blob/master/doc/developer-notes.md#subtrees) and [lint instructions](https://github.com/bitcoin/bitcoin/tree/master/test/lint#git-subtree-checksh)

ACKs for top commit:
  Sjors:
    ACK 323b3fd
  achow101:
    ACK 323b3fd
  hebasto:
    ACK 323b3fd, I've reproduced the subtree update locally. The two issues noted in this PR are unrelated to its changes and can be addressed separately.

Tree-SHA512: 3d03693d269c04d9ed10e8dd03e8059062929f37616d974c6fdf346ee62737c990ec550e013575e7474bfa4efcead3938bf9b259d62c073d76e720ebafe4ff66
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants