Skip to content

Conversation

fanquake
Copy link
Member

@fanquake fanquake commented Mar 25, 2024

This picks up a change, which is a switch to building zeromq with CMake. It includes a number of patches, some which have already been upstreamed (see each patch for details).

@DrahtBot
Copy link
Contributor

DrahtBot commented Mar 25, 2024

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

Code Coverage

For detailed information about the code coverage, see the test coverage report.

Reviews

See the guideline for information on the review process.

Type Reviewers
ACK hebasto

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

Conflicts

No conflicts as of last run.

@hebasto
Copy link
Member

hebasto commented Mar 25, 2024

Concept ACK.

@hebasto
Copy link
Member

hebasto commented Mar 25, 2024

This picks up a change, which is a switch to building zeromq with CMake.

From zeromq/libzmq#4667 (comment):

Please note that CMake-generated libzmq.pc file is also broken as its "Libs.private" section contains only -lstdc++ when cross-compiling for Windows.

@fanquake
Copy link
Member Author

From zeromq/libzmq#4667 (comment):

Can you elaborate / suggest something concrete? As far as I can see, the cross-compiling build of Windows for this branch currently works fine, we already link again -lws2_32 from our own build (so that shouldn't cause build failures), and we currently patch the -lstdc++ out of Libs.private, because as far as we are concerned, it's a bug.

@fanquake fanquake force-pushed the zeromq_cmake_switch branch from 328da34 to eac93d3 Compare March 25, 2024 16:53
@fanquake fanquake force-pushed the zeromq_cmake_switch branch from eac93d3 to 0dd69d4 Compare March 27, 2024 14:57
@fanquake fanquake marked this pull request as ready for review March 27, 2024 14:57
@fanquake
Copy link
Member Author

Given both changes have landed, I've reordered the commits, and undrafted. Will followup with the Windows issues.

@fanquake
Copy link
Member Author

Will followup with the Windows issues.

IPC build issue should be fixed in zeromq/libzmq#4672

@fanquake fanquake force-pushed the zeromq_cmake_switch branch from 0dd69d4 to 8ebe5d3 Compare April 5, 2024 14:19
@fanquake fanquake force-pushed the zeromq_cmake_switch branch from 8ebe5d3 to 2a7b137 Compare April 15, 2024 11:21
@fanquake fanquake force-pushed the zeromq_cmake_switch branch from 2a7b137 to 37da2ae Compare April 25, 2024 13:45
@fanquake
Copy link
Member Author

IPC build issue should be fixed in zeromq/libzmq#4672

This was resolved using a different change. Have pulled in that patch, rebased and updated the PR description.

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.

I've tested 796a271 on Ubuntu 23.10 using a patch from #29960.

There are a few differences between Autotools and CMake builds:

  1. In CMake, the resulted archive lacks object files from the following sources:
gssapi_client.cpp
gssapi_mechanism_base.cpp
gssapi_server.cpp
vmci_address.cpp
vmci_connecter.cpp
vmci_listener.cpp
vmci.cpp
  1. CMake build is effectively compiled with -O3 flag.

  2. CMake adds -DZMQ_CUSTOM_PLATFORM_HPP.

@fanquake fanquake force-pushed the zeromq_cmake_switch branch from 796a271 to 02a95f6 Compare May 10, 2024 05:32
@DrahtBot
Copy link
Contributor

/ci_container_base/depends/work/build/x86_64-w64-mingw32/zeromq/4.3.5-fa67b8336a3/src/ipc_listener.cpp:22:2: error: #error On Windows, IPC does not work with POLLER=select, use POLLER=epoll instead, or disable IPC transport
   22 | #error On Windows, IPC does not work with POLLER=select, use POLLER=epoll instead, or disable IPC transport
      |  ^~~~~

@fanquake fanquake force-pushed the zeromq_cmake_switch branch from 02a95f6 to 111ca59 Compare May 13, 2024 08:48
@fanquake
Copy link
Member Author

Fixed the Windows build error, but drafted while based on #30078.

@fanquake fanquake marked this pull request as draft May 13, 2024 08:49
@fanquake fanquake force-pushed the zeromq_cmake_switch branch 2 times, most recently from 7dfe36e to 0ed152a Compare May 14, 2024 07:04
@fanquake
Copy link
Member Author

CMake compiles 7 fewer source files compared to Autotools. It skips::

That's expected. We aren't opting in to either of these features.

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 0388ad0.

CMake compiles 7 fewer source files compared to Autotools. It skips::

That's expected. We aren't opting in to either of these features.

Right. Perhaps, it should be considered an upstream bug in configure.ac, as we aren't opting into these features in Autotools either.

@fanquake
Copy link
Member Author

fanquake commented Jul 22, 2024

Perhaps, it should be considered an upstream bug in configure.ac

The files are compiled unconditionally, and the content is control by defines. If you look at the object files in depends, none have any symbols, so I'm not sure how it's a bug.

@fanquake fanquake merged commit c69ba20 into bitcoin:master Jul 22, 2024
16 checks passed
@fanquake fanquake deleted the zeromq_cmake_switch branch July 22, 2024 16:49
@hebasto
Copy link
Member

hebasto commented Jul 23, 2024

Looking at the mingw .pc generated by this PR:

Libs: -L${libdir} -lzmq
Libs.private:
Requires.private:

It looks like we'll need to take zeromq/libzmq#4706 as well for CMake. That can be done as a follow-up though, as it's not yet merged upstream.

Done in #30508.

hebasto added a commit to hebasto/bitcoin that referenced this pull request Jul 24, 2024
00355fd depends: switch zmq to CMake (Cory Fields)
5989754 depends: add zeromq no librt patch (fanquake)
b4c5f72 depends: add zeromq cmake minimum patch (fanquake)
caae50a depends: add zeromq windows usage patch (fanquake)
1b55c75 depends: add zeromq builtin sha1 patch (fanquake)
73eda12 depends: add zeromq mktemp macos patch (fanquake)
30e258d fixup! cmake: Add `libzmq` optional package support (Hennadii Stepanov)
fcc075d Revert "depends: Fix Autotools-generated `libzmq.pc` file" (Hennadii Stepanov)

Pull request description:

  This PR ports bitcoin#29723.

  It aims to avoid conflicts when pushing the `cmake-staging` branch as an update of bitcoin#30454.

  Also a documenting comment added in regard to bitcoin#30508.

Top commit has no ACKs.

Tree-SHA512: 7976db24bd347d7ce7d63cbe7a6c6544009a93fdfb1ffc7709f2711a47c5a6c7d0bec3c03fb236a4c52ced01bfd69a778a7373484152157b359ae643a474dc00
@hebasto
Copy link
Member

hebasto commented Jul 24, 2024

Ported to the CMake-based build system in hebasto#278.

fanquake added a commit that referenced this pull request Jul 25, 2024
…o CMake

a0314c1 depends: cleanup after qrencode build (fanquake)
745bf0f depends: cleanup after miniupnpc build (fanquake)
06d4aab depends: Cleanup postprocess commands after switching to CMake (Hennadii Stepanov)

Pull request description:

  I overlooked this while reviewing #29723, #29835, and #29880.

ACKs for top commit:
  fanquake:
    ACK a0314c1

Tree-SHA512: debeffa7027e6213cc25c0652660ff0f36f51e63f688041d1d6cd6323e2c6cb02936fa0ecea86455b8c9874d6ea665684085189cfa523ca084792c57b0fb7c4e
@hebasto
Copy link
Member

hebasto commented Jul 31, 2024

This PR fails to compile on OpenBSD 7.5 :

[ 19%] Building CXX object CMakeFiles/objects.dir/src/io_thread.cpp.o
/home/hebasto/bitcoin/depends/work/build/amd64-unknown-openbsd7.5/zeromq/4.3.5-df5b1b9f936/src/io_thread.cpp:14:22: error: static_cast from 'std::nullptr_t' to 'poller_t::handle_t' (aka 'int') is not allowed
    _mailbox_handle (static_cast<poller_t::handle_t> (NULL))
                     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1 error generated.

UPD. Fixed in #30565.

fanquake added a commit that referenced this pull request Aug 1, 2024
89b1d5c depends: Fix `zeromq` build on OpenBSD (Hennadii Stepanov)

Pull request description:

  On the master branch @ 66e82dc, the `zeromq` package fails to build on OpenBSD 7.5:
  ```
  [ 19%] Building CXX object CMakeFiles/objects.dir/src/io_thread.cpp.o
  /home/hebasto/bitcoin/depends/work/build/amd64-unknown-openbsd7.5/zeromq/4.3.5-df5b1b9f936/src/io_thread.cpp:14:22: error: static_cast from 'std::nullptr_t' to 'poller_t::handle_t' (aka 'int') is not allowed
      _mailbox_handle (static_cast<poller_t::handle_t> (NULL))
                       ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  1 error generated.
  ```

  This [regression](#29723 (comment)) was overlooked by me in #29723.

  This PR fixes the issue by backporting an upstream commit from zeromq/libzmq#4659.

ACKs for top commit:
  theStack:
    tACK 89b1d5c

Tree-SHA512: 48d22ea99dfd44c5adf858c74e64082390da27b8ccad8c0d5a91d4dabfa3d12267cef98e4bb8c088e4cd0ec477c242cb1d47aace5c88cd86f796715bba957ed8
achow101 added a commit that referenced this pull request Aug 5, 2024
ee934d0 doc: Add missed cmake package to build depends (Hennadii Stepanov)

Pull request description:

  CMake is used to build the following packages in depends when cross-compiling for Windows:
  - `libevent` (#29835)
  - `libnatpmp` (#29708)
  - `miniupnpc` (#29707)
  - `qrencode` (#29725)
  - `zeromq` (#29723)

ACKs for top commit:
  vostrnad:
    ACK ee934d0
  achow101:
    ACK ee934d0
  TheCharlatan:
    ACK ee934d0
  tdb3:
    cr ut ACK ee934d0

Tree-SHA512: 7483a680607aa218a375c285859ab19773267c81324de61f457f40057381090b15779534ff0ddb3d981341b9cd9b9e1d4afffda1ec5d5b105ad5bfcac3c7d76a
fanquake added a commit that referenced this pull request Aug 28, 2024
371910a depends: Fix CMake-generated `libzmq.pc` file (Hennadii Stepanov)

Pull request description:

  This is a backport of: zeromq/libzmq#4706.

  Similar to #30488.

  Addresses #29723 (comment):
  > Looking at the mingw .pc generated by this PR:
  >
  > ```
  > Libs: -L${libdir} -lzmq
  > Libs.private:
  > Requires.private:
  > ```
  >
  > It looks like we'll need to take [zeromq/libzmq#4706](zeromq/libzmq#4706) as well for CMake. That can be done as a follow-up though, as it's not yet merged upstream.

ACKs for top commit:
  fanquake:
    ACK 371910a

Tree-SHA512: 6f9c2e32f83c0e629e32fd3e4c86712af00ffeaf0906bf85e5c2df889302707b9df102e8031249d1bae036eb4fc019c2a5124655682fbc5652d9337cb21c5f2c
PastaPastaPasta pushed a commit to PastaPastaPasta/dash that referenced this pull request Sep 27, 2024
0388ad0 depends: switch zmq to CMake (Cory Fields)
fefb3bb depends: add zeromq no librt patch (fanquake)
a522ef1 depends: add zeromq cmake minimum patch (fanquake)
cbbc229 depends: add zeromq windows usage patch (fanquake)
2de68d6 depends: add zeromq builtin sha1 patch (fanquake)
0c86052 depends: add zeromq mktemp macos patch (fanquake)

Pull request description:

  This picks up a change, which is a switch to building zeromq with CMake. It includes a number of patches, some which have already been upstreamed (see each patch for details).

ACKs for top commit:
  hebasto:
    ACK 0388ad0.

Tree-SHA512: 5567e432b4e4e0446c41d502bd61810a80b329dea2399b5d9d9f6e79acc450d1c6ba861c8238ba895de98338cfc5dc44ad2bf86ee8c222ecb3fbf47d6eb60da4
PastaPastaPasta pushed a commit to PastaPastaPasta/dash that referenced this pull request Sep 27, 2024
371910a depends: Fix CMake-generated `libzmq.pc` file (Hennadii Stepanov)

Pull request description:

  This is a backport of: zeromq/libzmq#4706.

  Similar to bitcoin#30488.

  Addresses bitcoin#29723 (comment):
  > Looking at the mingw .pc generated by this PR:
  >
  > ```
  > Libs: -L${libdir} -lzmq
  > Libs.private:
  > Requires.private:
  > ```
  >
  > It looks like we'll need to take [zeromq/libzmq#4706](zeromq/libzmq#4706) as well for CMake. That can be done as a follow-up though, as it's not yet merged upstream.

ACKs for top commit:
  fanquake:
    ACK 371910a

Tree-SHA512: 6f9c2e32f83c0e629e32fd3e4c86712af00ffeaf0906bf85e5c2df889302707b9df102e8031249d1bae036eb4fc019c2a5124655682fbc5652d9337cb21c5f2c
PastaPastaPasta pushed a commit to PastaPastaPasta/dash that referenced this pull request Sep 27, 2024
0388ad0 depends: switch zmq to CMake (Cory Fields)
fefb3bb depends: add zeromq no librt patch (fanquake)
a522ef1 depends: add zeromq cmake minimum patch (fanquake)
cbbc229 depends: add zeromq windows usage patch (fanquake)
2de68d6 depends: add zeromq builtin sha1 patch (fanquake)
0c86052 depends: add zeromq mktemp macos patch (fanquake)

Pull request description:

  This picks up a change, which is a switch to building zeromq with CMake. It includes a number of patches, some which have already been upstreamed (see each patch for details).

ACKs for top commit:
  hebasto:
    ACK 0388ad0.

Tree-SHA512: 5567e432b4e4e0446c41d502bd61810a80b329dea2399b5d9d9f6e79acc450d1c6ba861c8238ba895de98338cfc5dc44ad2bf86ee8c222ecb3fbf47d6eb60da4
PastaPastaPasta pushed a commit to PastaPastaPasta/dash that referenced this pull request Sep 27, 2024
371910a depends: Fix CMake-generated `libzmq.pc` file (Hennadii Stepanov)

Pull request description:

  This is a backport of: zeromq/libzmq#4706.

  Similar to bitcoin#30488.

  Addresses bitcoin#29723 (comment):
  > Looking at the mingw .pc generated by this PR:
  >
  > ```
  > Libs: -L${libdir} -lzmq
  > Libs.private:
  > Requires.private:
  > ```
  >
  > It looks like we'll need to take [zeromq/libzmq#4706](zeromq/libzmq#4706) as well for CMake. That can be done as a follow-up though, as it's not yet merged upstream.

ACKs for top commit:
  fanquake:
    ACK 371910a

Tree-SHA512: 6f9c2e32f83c0e629e32fd3e4c86712af00ffeaf0906bf85e5c2df889302707b9df102e8031249d1bae036eb4fc019c2a5124655682fbc5652d9337cb21c5f2c
PastaPastaPasta pushed a commit to PastaPastaPasta/dash that referenced this pull request Sep 27, 2024
0388ad0 depends: switch zmq to CMake (Cory Fields)
fefb3bb depends: add zeromq no librt patch (fanquake)
a522ef1 depends: add zeromq cmake minimum patch (fanquake)
cbbc229 depends: add zeromq windows usage patch (fanquake)
2de68d6 depends: add zeromq builtin sha1 patch (fanquake)
0c86052 depends: add zeromq mktemp macos patch (fanquake)

Pull request description:

  This picks up a change, which is a switch to building zeromq with CMake. It includes a number of patches, some which have already been upstreamed (see each patch for details).

ACKs for top commit:
  hebasto:
    ACK 0388ad0.

Tree-SHA512: 5567e432b4e4e0446c41d502bd61810a80b329dea2399b5d9d9f6e79acc450d1c6ba861c8238ba895de98338cfc5dc44ad2bf86ee8c222ecb3fbf47d6eb60da4
PastaPastaPasta pushed a commit to PastaPastaPasta/dash that referenced this pull request Sep 27, 2024
371910a depends: Fix CMake-generated `libzmq.pc` file (Hennadii Stepanov)

Pull request description:

  This is a backport of: zeromq/libzmq#4706.

  Similar to bitcoin#30488.

  Addresses bitcoin#29723 (comment):
  > Looking at the mingw .pc generated by this PR:
  >
  > ```
  > Libs: -L${libdir} -lzmq
  > Libs.private:
  > Requires.private:
  > ```
  >
  > It looks like we'll need to take [zeromq/libzmq#4706](zeromq/libzmq#4706) as well for CMake. That can be done as a follow-up though, as it's not yet merged upstream.

ACKs for top commit:
  fanquake:
    ACK 371910a

Tree-SHA512: 6f9c2e32f83c0e629e32fd3e4c86712af00ffeaf0906bf85e5c2df889302707b9df102e8031249d1bae036eb4fc019c2a5124655682fbc5652d9337cb21c5f2c
PastaPastaPasta added a commit to dashpay/dash that referenced this pull request Oct 1, 2024
ae6e0ad Merge bitcoin#29725: depends: build libqrencode with CMake (fanquake)
1522896 fix mingw32 build (UdjinM6)
7bb1d0e Merge bitcoin#22724: windres: use PACKAGE_VERSION rather than building more version numbers (fanquake)
6bee8e2 Merge bitcoin#27496: depends: reuse _config_opts for CMake options (fanquake)
24973ee Merge bitcoin#30488: depends: Fix CMake-generated `libevent*.pc` files (merge-script)
a27b08e Merge bitcoin#29835: depends: build libevent with CMake (merge-script)
a204616 Merge bitcoin#30464: test, refactor: Fix MSVC warning C4101 "unreferenced local variable" (merge-script)
02aee12 Merge bitcoin#30508: depends: Fix CMake-generated `libzmq.pc` file (merge-script)
e2b2446 Merge bitcoin#29723: depends: build zeromq with CMake (merge-script)
685b7a7 Merge bitcoin#23611: build: add `LTO` option to depends (laanwj)
d2b8c6b Merge bitcoin#19952: build, ci: Add file-based logging for individual packages (laanwj)
fc1c29c partial Merge bitcoin#23478: build: Add support for Android NDK r23 LTS (fanquake)

Pull request description:

  ## Issue being fixed or feature implemented
  depends on #6293

  ## What was done?
    _Describe your changes in detail_

  ## How Has This Been Tested?
    _Please describe in detail how you tested your changes._

    _Include details of your testing environment, and the tests you ran
  to see how your change affects other areas of the code, etc._

  ## Breaking Changes
    _Please describe any breaking changes your code introduces_

  ## Checklist:
    _Go over all the following points, and put an `x` in all the boxes that apply._
  - [ ] I have performed a self-review of my own code
  - [ ] I have commented my code, particularly in hard-to-understand areas
  - [ ] I have added or updated relevant unit/integration/functional/e2e tests
  - [ ] I have made corresponding changes to the documentation
  - [ ] I have assigned this pull request to a milestone _(for repository code-owners and collaborators only)_

ACKs for top commit:
  UdjinM6:
    utACK ae6e0ad
  knst:
    utACK ae6e0ad
  knst:
    utACK ae6e0ad

Tree-SHA512: 0606c7596394155417ad0fea96ce7e1f905109ce2978987e1c4132e8b0f5a8593c5c62ea7217510169228e8238ba42b418a74635ded01f5d674f62495ad3b3a9
PastaPastaPasta pushed a commit to PastaPastaPasta/dash that referenced this pull request Oct 25, 2024
…ching to CMake

a0314c1 depends: cleanup after qrencode build (fanquake)
745bf0f depends: cleanup after miniupnpc build (fanquake)
06d4aab depends: Cleanup postprocess commands after switching to CMake (Hennadii Stepanov)

Pull request description:

  I overlooked this while reviewing bitcoin#29723, bitcoin#29835, and bitcoin#29880.

ACKs for top commit:
  fanquake:
    ACK a0314c1

Tree-SHA512: debeffa7027e6213cc25c0652660ff0f36f51e63f688041d1d6cd6323e2c6cb02936fa0ecea86455b8c9874d6ea665684085189cfa523ca084792c57b0fb7c4e
PastaPastaPasta pushed a commit to PastaPastaPasta/dash that referenced this pull request Oct 25, 2024
89b1d5c depends: Fix `zeromq` build on OpenBSD (Hennadii Stepanov)

Pull request description:

  On the master branch @ 66e82dc, the `zeromq` package fails to build on OpenBSD 7.5:
  ```
  [ 19%] Building CXX object CMakeFiles/objects.dir/src/io_thread.cpp.o
  /home/hebasto/bitcoin/depends/work/build/amd64-unknown-openbsd7.5/zeromq/4.3.5-df5b1b9f936/src/io_thread.cpp:14:22: error: static_cast from 'std::nullptr_t' to 'poller_t::handle_t' (aka 'int') is not allowed
      _mailbox_handle (static_cast<poller_t::handle_t> (NULL))
                       ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  1 error generated.
  ```

  This [regression](bitcoin#29723 (comment)) was overlooked by me in bitcoin#29723.

  This PR fixes the issue by backporting an upstream commit from zeromq/libzmq#4659.

ACKs for top commit:
  theStack:
    tACK 89b1d5c

Tree-SHA512: 48d22ea99dfd44c5adf858c74e64082390da27b8ccad8c0d5a91d4dabfa3d12267cef98e4bb8c088e4cd0ec477c242cb1d47aace5c88cd86f796715bba957ed8
PastaPastaPasta pushed a commit to PastaPastaPasta/dash that referenced this pull request Oct 27, 2024
…ching to CMake

a0314c1 depends: cleanup after qrencode build (fanquake)
745bf0f depends: cleanup after miniupnpc build (fanquake)
06d4aab depends: Cleanup postprocess commands after switching to CMake (Hennadii Stepanov)

Pull request description:

  I overlooked this while reviewing bitcoin#29723, bitcoin#29835, and bitcoin#29880.

ACKs for top commit:
  fanquake:
    ACK a0314c1

Tree-SHA512: debeffa7027e6213cc25c0652660ff0f36f51e63f688041d1d6cd6323e2c6cb02936fa0ecea86455b8c9874d6ea665684085189cfa523ca084792c57b0fb7c4e
PastaPastaPasta pushed a commit to PastaPastaPasta/dash that referenced this pull request Oct 27, 2024
89b1d5c depends: Fix `zeromq` build on OpenBSD (Hennadii Stepanov)

Pull request description:

  On the master branch @ 66e82dc, the `zeromq` package fails to build on OpenBSD 7.5:
  ```
  [ 19%] Building CXX object CMakeFiles/objects.dir/src/io_thread.cpp.o
  /home/hebasto/bitcoin/depends/work/build/amd64-unknown-openbsd7.5/zeromq/4.3.5-df5b1b9f936/src/io_thread.cpp:14:22: error: static_cast from 'std::nullptr_t' to 'poller_t::handle_t' (aka 'int') is not allowed
      _mailbox_handle (static_cast<poller_t::handle_t> (NULL))
                       ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  1 error generated.
  ```

  This [regression](bitcoin#29723 (comment)) was overlooked by me in bitcoin#29723.

  This PR fixes the issue by backporting an upstream commit from zeromq/libzmq#4659.

ACKs for top commit:
  theStack:
    tACK 89b1d5c

Tree-SHA512: 48d22ea99dfd44c5adf858c74e64082390da27b8ccad8c0d5a91d4dabfa3d12267cef98e4bb8c088e4cd0ec477c242cb1d47aace5c88cd86f796715bba957ed8
@bitcoin bitcoin locked and limited conversation to collaborators Jul 31, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants