Skip to content

cmake: Add BOOST_NO_CXX98_FUNCTION_BASE definition when needed - #219

Merged
hebasto merged 2 commits into
cmake-stagingfrom
2406012-cmake-FU
Jun 4, 2024
Merged

hebasto merged 2 commits into
cmake-stagingfrom
2406012-cmake-FU

Conversation

@hebasto

@hebasto hebasto commented Jun 2, 2024

Copy link
Copy Markdown
Owner

This PR mirrors the master branch behaviour.

@hebasto
hebasto marked this pull request as ready for review June 2, 2024 16:23
@hebasto

hebasto commented Jun 2, 2024

Copy link
Copy Markdown
Owner Author

@theuni @fanquake You requested this change offline.

Delivered :)

@hebasto hebasto added the enhancement New feature or request label Jun 2, 2024
@m3dwards

m3dwards commented Jun 3, 2024 •

Copy link
Copy Markdown

This is what I got with boost 1.76. Passed the NO_CXX98_FUNCTION_BASE check but failed the HAVE_BOOST_INCLUDED_UNIT_TEST_H. I'm thinking the unit test header check failure could be that I have an incomplete boost library but should the NO_CXX98_FUNCTION_BASE check have succeeded?

-- Found Boost: /opt/homebrew/include (found suitable version "1.76.0", minimum required is "1.73.0")
-- Performing Test NO_DIAGNOSTICS_BOOST_NO_CXX98_FUNCTION_BASE
-- Performing Test NO_DIAGNOSTICS_BOOST_NO_CXX98_FUNCTION_BASE - Success
-- Performing Test HAVE_BOOST_INCLUDED_UNIT_TEST_H
-- Performing Test HAVE_BOOST_INCLUDED_UNIT_TEST_H - Failed
CMake Error at cmake/module/AddBoostIfNeeded.cmake:66 (message):
  Building test_bitcoin executable requested but
  boost/test/included/unit_test.hpp header not available.
Call Stack (most recent call first):
  CMakeLists.txt:360 (add_boost_if_needed)


-- Configuring incomplete, errors occurred!

Tested on ARM Mac

hebasto added 2 commits June 3, 2024 14:36
Add `BOOST_NO_CXX98_FUNCTION_BASE` definition when needed.

This mirrors the master branch behavior and fixes native build on macOS
with Homebrew's `[email protected]`.
@hebasto
hebasto force-pushed the 2406012-cmake-FU branch from 1f30141 to bf49bde Compare June 3, 2024 13:36
@hebasto

hebasto commented Jun 3, 2024

Copy link
Copy Markdown
Owner Author

This is what I got with boost 1.76. Passed the NO_CXX98_FUNCTION_BASE check but failed the HAVE_BOOST_INCLUDED_UNIT_TEST_H. I'm thinking the unit test header check failure could be that I have an incomplete boost library but should the NO_CXX98_FUNCTION_BASE check have succeeded?

-- Found Boost: /opt/homebrew/include (found suitable version "1.76.0", minimum required is "1.73.0")
-- Performing Test NO_DIAGNOSTICS_BOOST_NO_CXX98_FUNCTION_BASE
-- Performing Test NO_DIAGNOSTICS_BOOST_NO_CXX98_FUNCTION_BASE - Success
-- Performing Test HAVE_BOOST_INCLUDED_UNIT_TEST_H
-- Performing Test HAVE_BOOST_INCLUDED_UNIT_TEST_H - Failed
CMake Error at cmake/module/AddBoostIfNeeded.cmake:66 (message):
  Building test_bitcoin executable requested but
  boost/test/included/unit_test.hpp header not available.
Call Stack (most recent call first):
  CMakeLists.txt:360 (add_boost_if_needed)


-- Configuring incomplete, errors occurred!

Tested on ARM Mac

@m3dwards

Thank you for testing! That was a bug in the staging branch as well. So I've reworked this PR and added a new CI job that tests it. This CI job fails on the staging branch.

@m3dwards

m3dwards commented Jun 3, 2024 •

Copy link
Copy Markdown

ACK bf49bde

On cmake-staging branch I can demonstrate the error with boost 1.76 (below) and confirm no error with this PR applied. Also issue with boost unit test header is resolved.

In file included from /Users/maxedwards/source/bitcoin/src/common/interfaces.cpp:8:
In file included from /opt/homebrew/include/boost/signals2/connection.hpp:18:
In file included from /opt/homebrew/include/boost/function.hpp:30:
In file included from /opt/homebrew/include/boost/function/detail/prologue.hpp:17:
In file included from /opt/homebrew/include/boost/function/function_base.hpp:21:
In file included from /opt/homebrew/include/boost/type_index.hpp:29:
In file included from /opt/homebrew/include/boost/type_index/stl_type_index.hpp:47:
/opt/homebrew/include/boost/container_hash/hash.hpp:131:33: error: no template named 'unary_function' in namespace 'std'; did you mean '__unary_function'?
        struct hash_base : std::unary_function<T, std::size_t> {};
                           ~~~~~^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX14.5.sdk/usr/include/c++/v1/__functional/unary_function.h:46:1: note: '__unary_function' declared here
using __unary_function = __unary_function_keep_layout_base<_Arg, _Result>;
^
1 error generated.
gmake[2]: *** [src/CMakeFiles/bitcoin_common.dir/build.make:202: src/CMakeFiles/bitcoin_common.dir/common/interfaces.cpp.o] Error 1
gmake[1]: *** [CMakeFiles/Makefile2:1318: src/CMakeFiles/bitcoin_common.dir/all] Error 2
gmake: *** [Makefile:146: all] Error 2

@hebasto
hebasto merged commit 0e6def0 into cmake-staging Jun 4, 2024
hebasto pushed a commit that referenced this pull request Jul 7, 2026
….makePool` method

6b0a907 Squashed 'src/ipc/libmultiprocess/' changes from 3edbe8f..16bf05d (Ryan Ofsky)

Pull request description:

  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).

  Changes since last subtree update (bitcoin#34977):

  - Adds `makePool` method on `ThreadMap` to support thread pool routing, allowing requests without a specific client thread to be dispatched to a pool using a shortest-queue strategy ([#283](bitcoin-core/libmultiprocess#283)).
  - Adds `std::unordered_set` support, a `BuildList` helper, and a `ReadList` helper to reduce duplication in list build and read handlers ([#277](bitcoin-core/libmultiprocess#277), [#285](bitcoin-core/libmultiprocess#285)).
  - Adds support for translating C++ `std::optional<T>` struct fields to pairs of `T` + `hasT :Bool` Cap'n Proto struct fields, allowing unset optional primitive fields to be represented ([#243](bitcoin-core/libmultiprocess#243)).
  - Produces more readable log output for Proxy object lifecycle events and IPC server-side failures ([#218](bitcoin-core/libmultiprocess#218)).
  - Handles exceptions thrown by `destroy` methods by logging instead of aborting ([#273](bitcoin-core/libmultiprocess#273)). This can prevent server crashes when non-libmultiprocess clients disconnect without destroying objects, in the case where a server object owns client objects and the server destructor tries to call the disconnected client to free them ([#219](bitcoin-core/libmultiprocess#219)).
  - Handles unexpected exceptions thrown by callbacks (that should never happen) by logging errors instead of deadlocking ([#260](bitcoin-core/libmultiprocess#260)).
  - Fixes a rare mptest hang on musl builds caused by a lost wakeup bug in `Waiter` ([#295](bitcoin-core/libmultiprocess#295)).
  - Fixes a race condition in a log print detected by TSan ([#286](bitcoin-core/libmultiprocess#286)).
  - Build improvements: makes `target_capnp_sources` work correctly when libmultiprocess is used as a CMake subproject ([#289](bitcoin-core/libmultiprocess#289)), adds `mp_headers` target for better lint tool support ([#291](bitcoin-core/libmultiprocess#291)), and fixes compatibility with recent Nix and CMake 4.0 ([#238](bitcoin-core/libmultiprocess#238)).
  - Test, CI, documentation, and minor code improvements: design document corrections ([#278](bitcoin-core/libmultiprocess#278)), field constant comments ([#279](bitcoin-core/libmultiprocess#279)), clang-tidy fix ([#292](bitcoin-core/libmultiprocess#292)), new smoke test for double-precision float values ([#294](bitcoin-core/libmultiprocess#294)), new test for recursive async IPC calls ([#301](bitcoin-core/libmultiprocess#301)), removal of libevent from Core CI builds ([#299](bitcoin-core/libmultiprocess#299)), and rename of `EventLoop::m_num_clients` to `m_num_refs` ([#302](bitcoin-core/libmultiprocess#302)).

ACKs for top commit:
  fanquake:
    ACK 02afa66
  hebasto:
    ACK 02afa66.

Tree-SHA512: ef81a951c971f328a0a98436030467eeea30925eb6016eafd9bc7a25726c87628a852bbb1d84b88bce340aeea2bed25c65bc55db1168ebcb850628cd18808883
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants