cmake: Add FindZeroMQ module #30903

pull hebasto wants to merge 2 commits into bitcoin:master from hebasto:240914-zeromq changing 6 files +47 −77
  1. hebasto commented at 3:06 pm on September 14, 2024: member

    This PR introduces the FindZeroMQ module, which first attempts to find the libzmq library using CMake’s find_package() and falls back to pkg_check_modules() if unsuccessful.

    Addresses #30876 for the ZeroMQ package.

  2. hebasto added the label Build system on Sep 14, 2024
  3. DrahtBot commented at 3:06 pm on September 14, 2024: contributor

    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 fanquake
    Concept ACK theuni

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

    Conflicts

    Reviewers, this pull request conflicts with the following ones:

    • #28676 ([WIP] Cluster mempool implementation by sdaftuar)

    If you consider this pull request important, please also help to review the conflicting pull requests. Ideally, start with the one that should be merged first.

  4. hebasto force-pushed on Sep 14, 2024
  5. hebasto marked this as ready for review on Sep 14, 2024
  6. maflcko added the label DrahtBot Guix build requested on Sep 16, 2024
  7. fanquake commented at 8:38 am on September 16, 2024: member

    Resolves #30876.

    Not sure it does, as that issue applies to all dependencies, not just ZMQ.

  8. hebasto commented at 9:00 am on September 16, 2024: member

    Resolves #30876.

    Not sure it does, as that issue applies to all dependencies, not just ZMQ.

    Clarified.

  9. DrahtBot commented at 3:05 pm on September 16, 2024: contributor

    Guix builds (on x86_64) [untrusted test-only build, possibly unsafe, not for production use]

    File commit 0c4ff18ee9ec91b424ad26d2643e42566aa45e40(master) commit 6972687ebcfc61a221abae353a9413ae05ab3de3(master and this pull)
    SHA256SUMS.part 79b358d3fd281b65... 86f6f29ffd363608...
    *-aarch64-linux-gnu-debug.tar.gz 4e496d0eb67133bf... 7f92803ccfe6a1e2...
    *-aarch64-linux-gnu.tar.gz 43490ff6ab9a74e2... f066709ba9c66da6...
    *-arm-linux-gnueabihf-debug.tar.gz 38c68631f041e4d8... 395049696fc5d551...
    *-arm-linux-gnueabihf.tar.gz a80c39716b285df7... 674a86bfd56a0615...
    *-arm64-apple-darwin-unsigned.tar.gz 59dce49b541dff6d... 39dba97c3baa0773...
    *-arm64-apple-darwin-unsigned.zip acb355306dcbd43c... 3a074d5d053ce375...
    *-arm64-apple-darwin.tar.gz b6fa18bedb7fe497... 72d0bc011537528d...
    *-powerpc64-linux-gnu-debug.tar.gz ab07199c08dcbf3d... 0fbb1334d6c6bfc9...
    *-powerpc64-linux-gnu.tar.gz c93841f69a8a21f2... e056685d63380755...
    *-riscv64-linux-gnu-debug.tar.gz fa11806d89e9abd7... 1774f714543645ee...
    *-riscv64-linux-gnu.tar.gz 379cad9361252115... 624cd436a31ea27d...
    *-x86_64-apple-darwin-unsigned.tar.gz 03fd8b75278b79c7... 802749a8076d8e00...
    *-x86_64-apple-darwin-unsigned.zip e7f5613fc474ffdb... efb528f448453e85...
    *-x86_64-apple-darwin.tar.gz 9c1621a91eba759d... 71d899e39b6db5f2...
    *-x86_64-linux-gnu-debug.tar.gz 0aaee8826bab2f2b... 64dc98411cb72edd...
    *-x86_64-linux-gnu.tar.gz 163cb7ffd9eec265... 9fb277b01f156259...
    *.tar.gz 73ef39f7a7c8ccd9... 4ea166af67ce27af...
    guix_build.log 2c42f4ee42e6a171... 1aad3f2e5974088a...
    guix_build.log.diff 204f122ba10d1b04...
  10. DrahtBot removed the label DrahtBot Guix build requested on Sep 16, 2024
  11. DrahtBot added the label CI failed on Oct 22, 2024
  12. DrahtBot removed the label CI failed on Oct 25, 2024
  13. fanquake added this to the milestone 29.0 on Oct 25, 2024
  14. fanquake commented at 1:30 pm on October 25, 2024: member

    Concept ACK - Tested this (rebased) branch on Alpine, which ships pkg-config files and CMake config files for ZeroMQ.

    0cmake -B build -DWITH_ZMQ=ON
    1-- Found ZeroMQ: /usr/lib/cmake/ZeroMQ (found suitable version "4.3.5", minimum required is "4.0.0")
    2
    3# hide cmake config file
    4mv /usr/lib/cmake/ZeroMQ/ZeroMQConfig.cmake /usr/lib/cmake/ZeroMQ/ZeroMQConfig.cmake.bk
    5
    6# cmake -B build -DWITH_ZMQ=ON
    7-- Found PkgConfig: /usr/bin/pkg-config (found version "2.2.0")
    8-- Found ZeroMQ: /usr/lib (found suitable version "4.3.5", minimum required is "4.0.0")
    
  15. theuni approved
  16. theuni commented at 4:31 pm on October 25, 2024: member

    Concept ACK and quick review ACK.

    Tested with depends and verified that the fallback isn’t used: https://github.com/theuni/bitcoin/commit/d98c76c69e01ddacc79974fef6f7fd0f9df5ddcc @hebasto want to pull that in here?

  17. cmake: Add `FindZeroMQ` module 6b8a74463b
  18. depends: zeromq: don't install .pc files and remove patches for them 915640e191
  19. in src/zmq/CMakeLists.txt:19 in 7f67ed7a1e outdated
    16-    $<$<AND:$<PLATFORM_ID:Windows>,$<CXX_COMPILER_ID:GNU>>:ZMQ_STATIC>
    17 )
    18 target_link_libraries(bitcoin_zmq
    19   PRIVATE
    20     core_interface
    21+    zeromq
    


    theuni commented at 4:33 pm on October 25, 2024:
    Doubtful it matters here, but external libs after internal libs please.

    hebasto commented at 5:13 pm on October 25, 2024:
    Sure. Reordered.
  20. hebasto force-pushed on Oct 25, 2024
  21. hebasto commented at 5:13 pm on October 25, 2024: member

    Concept ACK and quick review ACK.

    Tested with depends and verified that the fallback isn’t used: theuni@d98c76c

    @hebasto want to pull that in here?

    Thanks! Pulled in.

  22. fanquake added the label DrahtBot Guix build requested on Oct 26, 2024
  23. DrahtBot commented at 6:54 pm on October 26, 2024: contributor

    Guix builds (on x86_64) [untrusted test-only build, possibly unsafe, not for production use]

    File commit 25dacae9c7feb31308271e2fd5a127c1fc230c2f(master) commit 9f8780af2787fa04343a7e030fb1f2c7b30a3f14(master and this pull)
    SHA256SUMS.part 6041997bbc9648cf... 37d8900ea3418636...
    *-aarch64-linux-gnu-debug.tar.gz 7304b9aa230d76fe... 01a97d270c7f4cf1...
    *-aarch64-linux-gnu.tar.gz 1918e330fc2d1bde... d27c5a489be26bf3...
    *-arm-linux-gnueabihf-debug.tar.gz 703cb83d8df6a45a... ca0f1336451fcc00...
    *-arm-linux-gnueabihf.tar.gz 4697e9c98ee32036... e5df353b5e237b1e...
    *-arm64-apple-darwin-unsigned.tar.gz 36eba73d508d5052... e3de5183c0638bda...
    *-arm64-apple-darwin-unsigned.zip 4b6977270075d6f3... 7026c310657018cc...
    *-arm64-apple-darwin.tar.gz c8d152b6de64036b... 615336fba31e7b3d...
    *-powerpc64-linux-gnu-debug.tar.gz b3c4d8dbd5eab86d... 40b41ac42e183fab...
    *-powerpc64-linux-gnu.tar.gz 0f92af123f402198... 088dea17c7c703ea...
    *-riscv64-linux-gnu-debug.tar.gz 29f88d233e6db541... e47c1d79c10cec4a...
    *-riscv64-linux-gnu.tar.gz a020e875e3930e6a... b18599297833a6e1...
    *-x86_64-apple-darwin-unsigned.tar.gz 3d52ceb1df3686da... ab8854c5106900ff...
    *-x86_64-apple-darwin-unsigned.zip 36e470475b1465ea... 4b01d38bcdd4ec53...
    *-x86_64-apple-darwin.tar.gz 570ece0be9bd8b6e... 0ca586cf54e77c91...
    *-x86_64-linux-gnu-debug.tar.gz b9f81a134e954eef... a3ed0455b5923298...
    *-x86_64-linux-gnu.tar.gz b84dfd15bf8ff367... 7d2f1e0453b97e58...
    *.tar.gz c201dd8c4d071178... 4f410fbf85609449...
    guix_build.log 7eb2873f5063c0f7... 9820f4256088bcbe...
    guix_build.log.diff 70cd71a9b2d340d1...
  24. DrahtBot removed the label DrahtBot Guix build requested on Oct 26, 2024
  25. hebasto commented at 12:33 pm on October 28, 2024: member

    My Guix build:

     0aarch64
     1fba7e542bc6a35c65a179f9c8cd3ae2b0f8b12cd5895fa255a2d344d576d0215  guix-build-915640e191b6/output/aarch64-linux-gnu/SHA256SUMS.part
     2c9c1d47120de9a45aa5da1c17cc8f4860f2268bfe413d38e1b6f67ea96bd4f09  guix-build-915640e191b6/output/aarch64-linux-gnu/bitcoin-915640e191b6-aarch64-linux-gnu-debug.tar.gz
     3c1775debe30e5a28d981720582c5e6f36ea33939169a429edc48c4bb8ebc3688  guix-build-915640e191b6/output/aarch64-linux-gnu/bitcoin-915640e191b6-aarch64-linux-gnu.tar.gz
     4870a9d4f46ec2906a7d22d904eb53a8d372ce06fe727983a9aadcfe1dbdcc321  guix-build-915640e191b6/output/arm-linux-gnueabihf/SHA256SUMS.part
     5fb49bbbb404986f23ad231033c07588e2e612960da7da7dcdfcde9b21e3fb7b0  guix-build-915640e191b6/output/arm-linux-gnueabihf/bitcoin-915640e191b6-arm-linux-gnueabihf-debug.tar.gz
     607e03402e62f4b9684342563ce40508342c429c546aeecd805a2a1bf645af7a2  guix-build-915640e191b6/output/arm-linux-gnueabihf/bitcoin-915640e191b6-arm-linux-gnueabihf.tar.gz
     7bddeb0bbd99b437406092f4af1fa630740e20d5e6277982a7858fa22fd245c0a  guix-build-915640e191b6/output/arm64-apple-darwin/SHA256SUMS.part
     88ddb3b97ff42eecbe27339b1cd8b048273638958f2b68fea4dddff8d28755cd3  guix-build-915640e191b6/output/arm64-apple-darwin/bitcoin-915640e191b6-arm64-apple-darwin-unsigned.tar.gz
     978768d58a16d254b27921c4712ef810254bbc206eab72393e9f96661408bdd72  guix-build-915640e191b6/output/arm64-apple-darwin/bitcoin-915640e191b6-arm64-apple-darwin-unsigned.zip
    108849c895be879bc199f4f6a3a355e7fdddc67a58e7382c6e930efffb55a43bf8  guix-build-915640e191b6/output/arm64-apple-darwin/bitcoin-915640e191b6-arm64-apple-darwin.tar.gz
    1124f2fc6a1e2bea8f0ac8e0fe8d566432e7b45d2e26f7367c57ae4230f8fa50e5  guix-build-915640e191b6/output/dist-archive/bitcoin-915640e191b6.tar.gz
    12067b2cd3e9aaca53592fa87aff972b776d9cf86264cf0ed2dfa40b0fc79492ac  guix-build-915640e191b6/output/powerpc64-linux-gnu/SHA256SUMS.part
    137fb4f4b24affe6983da95c679ec457ba672e2761757e746eb62aa86dc11ba544  guix-build-915640e191b6/output/powerpc64-linux-gnu/bitcoin-915640e191b6-powerpc64-linux-gnu-debug.tar.gz
    143e18c073306b06706496ea61ef7d000b2d6ad4afdfb5d07f33420a68a1d32bf0  guix-build-915640e191b6/output/powerpc64-linux-gnu/bitcoin-915640e191b6-powerpc64-linux-gnu.tar.gz
    151fc9c8ce2be07a5a5fed9eaab77af34b4871ee9b89cb89736eea6c16298a1a94  guix-build-915640e191b6/output/riscv64-linux-gnu/SHA256SUMS.part
    16cf0cb19fe25db0f4112f3d101978fb300f6c81246e7478d42dd16f7dd40d1c88  guix-build-915640e191b6/output/riscv64-linux-gnu/bitcoin-915640e191b6-riscv64-linux-gnu-debug.tar.gz
    17df415b13cebe01cef4e103e3e2f61616857dcdd377e6e66cb869738e4ea4b564  guix-build-915640e191b6/output/riscv64-linux-gnu/bitcoin-915640e191b6-riscv64-linux-gnu.tar.gz
    18150cc9e7045b195a8c98de46ba4df3e58e6e2f50dbd1a5d20fc7177d31a3937f  guix-build-915640e191b6/output/x86_64-apple-darwin/SHA256SUMS.part
    199a788f205cb4dc7eb3dd2063e6370ff3a23eee6b5dfa6a7746d4440784346c2d  guix-build-915640e191b6/output/x86_64-apple-darwin/bitcoin-915640e191b6-x86_64-apple-darwin-unsigned.tar.gz
    20835cd0aba82e6da750e5fb57fb709af179837dd76d8a0e068c3f3138633ba028  guix-build-915640e191b6/output/x86_64-apple-darwin/bitcoin-915640e191b6-x86_64-apple-darwin-unsigned.zip
    2178d6df9a60ba2472550643b60bcb0195079c12c462311465f5de9705402007aa  guix-build-915640e191b6/output/x86_64-apple-darwin/bitcoin-915640e191b6-x86_64-apple-darwin.tar.gz
    22ab26fbea09dcb24903a477172df90f5ead8a86360d2f6a7cbe63c07e9d021c57  guix-build-915640e191b6/output/x86_64-linux-gnu/SHA256SUMS.part
    234b02520278258b4d5bc247e331b5c017dc50608bff99e34bde3436d46309bbb1  guix-build-915640e191b6/output/x86_64-linux-gnu/bitcoin-915640e191b6-x86_64-linux-gnu-debug.tar.gz
    24151fa5af3c41a3f96e229c8b6bfc040b231e0c88032187eb0ba0a35bb4333536  guix-build-915640e191b6/output/x86_64-linux-gnu/bitcoin-915640e191b6-x86_64-linux-gnu.tar.gz
    259e53b6427898c855ed0d62bbb0b183fc06aa2c93620a200dd972010b12343d2c  guix-build-915640e191b6/output/x86_64-w64-mingw32/SHA256SUMS.part
    269cc6b97058995039799bc7bd9b88418eecc7afc524f23c0595a80030456cb24c  guix-build-915640e191b6/output/x86_64-w64-mingw32/bitcoin-915640e191b6-win64-debug.zip
    2719aade43f2cace1c694f1116124c5b6ec99402d6ed2ac6f30d54dfe90722f85f  guix-build-915640e191b6/output/x86_64-w64-mingw32/bitcoin-915640e191b6-win64-setup-unsigned.exe
    287dd59a44e17ddf55b7006efc07c82934b5ff3c6ab0b51d451e2407e1e90e0172  guix-build-915640e191b6/output/x86_64-w64-mingw32/bitcoin-915640e191b6-win64-unsigned.tar.gz
    29e2335ee787414f0331ddd553aafa10107cea7abfb7a4450d396393596624a67e  guix-build-915640e191b6/output/x86_64-w64-mingw32/bitcoin-915640e191b6-win64.zip
    
  26. fanquake commented at 3:58 pm on October 29, 2024: member
    We should also follow up with refactoring the libevent module, to more generically use CMake/pkg-config, rather than restricting the CMake usage to vcpkg. At that point, we’d likely be able to dump pkg-config for the depends path entirely.
  27. fanquake approved
  28. fanquake commented at 3:59 pm on October 29, 2024: member
    ACK 915640e191b6a17a245f0502bc399d82a6502ccf
  29. DrahtBot requested review from theuni on Oct 29, 2024
  30. fanquake merged this on Oct 29, 2024
  31. fanquake closed this on Oct 29, 2024

  32. hebasto deleted the branch on Oct 29, 2024
  33. theuni commented at 6:24 pm on October 29, 2024: member
    Post-merge ACK 915640e191b6a17a245f0502bc399d82a6502ccf
  34. hebasto commented at 8:49 am on October 30, 2024: member

    We should also follow up with refactoring the libevent module, to more generically use CMake/pkg-config, rather than restricting the CMake usage to vcpkg. At that point, we’d likely be able to dump pkg-config for the depends path entirely.

    Done in #31181.


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: 2024-11-21 09:12 UTC

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