Skip to content

cmake: Fix toolchain.cmake for *BSD systems - #292

Merged
hebasto merged 1 commit into
cmake-stagingfrom
240731-cmake-HW
Aug 2, 2024
Merged

hebasto merged 1 commit into
cmake-stagingfrom
240731-cmake-HW

Conversation

@hebasto

@hebasto hebasto commented Aug 1, 2024 •

Copy link
Copy Markdown
Owner

For *BSD systems, the qt and qrencode packages are not built, even without the NO_QT or NO_QR variables defined, because these package are not available for the host systems:

qrencode_linux_packages = qrencode
qrencode_darwin_packages = qrencode
qrencode_mingw32_packages = qrencode
qt_linux_packages:=qt expat libxcb xcb_proto libXau xproto freetype fontconfig libxkbcommon libxcb_util libxcb_util_render libxcb_util_keysyms libxcb_util_image libxcb_util_wm
qt_darwin_packages=qt
qt_mingw32_packages=qt

We already handle the exact logic for the systemtap (USDT) package. Therefore, it is reasonable to use this working logic uniformly for all cases.

Additionally, this PR correctly handles cases when a *_packages_ variable contains only spaces rather than being empty.


How to test this PR on a *BSD system:

  1. Build depends following the build guides (depends/README.md, doc/build-*bsd.md)
  2. Configure the main build system using the generated toolchain file:
cmake -B build --toolchain depends/<your-platform>/toolchain.cmake

It fails.

With this PR it configures successfully.

@hebasto hebasto added the bug Something isn't working label Aug 1, 2024
@hebasto

hebasto commented Aug 1, 2024 •

Copy link
Copy Markdown
Owner Author

Friendly ping @theStack @vasild :)

@vasild vasild left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

ACK 20ef783

... because these package are not available for the host systems ...

Why? FreeBSD has packages for qt and qrencode.

@hebasto

hebasto commented Aug 1, 2024

Copy link
Copy Markdown
Owner Author

... because these package are not available for the host systems ...

Why? FreeBSD has packages for qt and qrencode.

I did not mean the package availabilty via the system package manager, but rather how our depends build sub-system is configured.

@hebasto

hebasto commented Aug 1, 2024 •

Copy link
Copy Markdown
Owner Author

@vasild

Testing instructions have been added to the PR description per your request.

@vasild

vasild commented Aug 2, 2024

Copy link
Copy Markdown

I tested this on FreeBSD: on cmake-staging it fails with:

-- Checking for module 'libqrencode'
--   Package 'libqrencode' not found
CMake Error at /usr/local/share/cmake/Modules/FindPkgConfig.cmake:634 (message):
  The following required packages were not found:

   - libqrencode

and succeeds with the changes from this branch.

Unrelated to this PR: depends/README.md mentions to run make followed by cmake -B build ... but those have to be run from different directories - make has to be in the depends/ subdirectory. On FreeBSD make spits a ton of syntax errors because depends/Makefile is gnu-make specific, so I used gmake -C depends from the top source directory.

@hebasto
hebasto merged commit f63b200 into cmake-staging Aug 2, 2024

@theStack theStack left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

post-merge ACK 20ef783, tested on OpenBSD 7.5
(note that I had to cherry-pick the zeromq build fix for OpenBSD [bitcoin#30565, 89b1d5c] first, as it's seemingly not in the cmake staging branch yet)

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

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants