build: Fix zeromq package when cross-compiling #24134

pull hebasto wants to merge 3 commits into bitcoin:master from hebasto:220123-zmq changing 2 files +3 −2
  1. hebasto commented at 11:34 PM on January 23, 2022: member

    Since v4.3.3 (https://github.com/zeromq/libzmq/commit/068385c951c0608edec6264d55ba9c4c923acccc) libzmq uses libbsd by default.

    This PR disables libbsd explicitly, as it's not a part of our depends. Zeromq will fallback to its internal strlcpy implementation.

    Otherwise, on systems with installed libbsd-dev package the zeromq package build system erroneously detects libbsd package from the host system:

    --- a/libzmq.pc
    +++ b/libzmq.pc
    @@ -8,5 +8,5 @@
     Version: 4.3.4
     Libs: -L${libdir} -lzmq
     Libs.private:  -lpthread
    -Requires.private: 
    +Requires.private:  libbsd
     Cflags: -I${includedir} 
    

    This causes the configure fails to detect the zeromq package:

    configure: WARNING: libzmq version 4.x or greater not found, disabling
    

    Other minor improvements:

    • fixed netbsd_kevent_void.patch offset
    • disabled valgrind as it's used in unit tests which we do not run:
    --- a/zmq-configure-output
    +++ b/zmq-configure-output
    @@ -119,11 +119,6 @@
     checking whether the g++ -m64 linker (/usr/bin/ld -m elf_x86_64) supports shared libraries... yes
     checking dynamic linker characteristics... (cached) GNU/Linux ld.so
     checking how to hardcode library paths into programs... immediate
    -checking for valgrind... valgrind
    -checking for Valgrind tool memcheck... memcheck
    -checking for Valgrind tool helgrind... helgrind
    -checking for Valgrind tool drd... drd
    -checking for Valgrind tool exp-sgcheck... exp-sgcheck
     checking linker version script flag... --version-script
     checking if version scripts can use complex wildcards... yes
     checking for working posix_memalign... yes
    
  2. DrahtBot added the label Build system on Jan 24, 2022
  3. hebasto commented at 7:43 AM on January 24, 2022: member

    Assign "23.0" milestone?

  4. fanquake commented at 4:39 AM on January 25, 2022: member

    Approach NACK. Why not just pass --disable-libbsd? Would be good to update the PR description to actually explain what this is used for, and why it's ok to avoid.

    on some systems (impish, jammy)

    Isn't it just any system with libbsd available?

  5. hebasto commented at 9:41 AM on January 25, 2022: member

    on some systems (impish, jammy)

    Isn't it just any system with libbsd available?

    Correct. The PR description updated.

  6. hebasto commented at 9:51 AM on January 25, 2022: member

    Approach NACK. Why not just pass --disable-libbsd? Would be good to update the PR description to actually explain what this is used for, and why it's ok to avoid.

    1. It is wrong when a package build system searches for its dependencies among host's packages instead of strictly relying on $(package)_dependencies.
    2. This PR is not about "build with libbsd or avoid it". It restores behavior that was before #23956. Including libbsd in our depends build system as a zeromq package dependency is out of this PR scope.
  7. fanquake commented at 10:21 AM on January 25, 2022: member

    It is wrong when a package build system searches for its dependencies among host's packages instead of strictly relying on $(package)_dependencies.

    I agree, but that's also something that should be solved at a higher level in the build system, rather than ad-hoc on a per-package basis. Otherwise we should just go ahead and add the same change to all other packages that use pkg-config.

    This PR is not about "build with libbsd or avoid it". It restores behavior that was before

    If this PR makes a change that will ensure zeromqs build system doesn't find libbsd, how is it not about avoiding it? I'm not sure what you mean by restoring the previous behaviour (other than make things work), but I don't necessarily think that is the right goal. We're building a newer version of the package, that has a different build system and new (optional) dependencies.

    Including libbsd in our depends build system as a zeromq package dependency

    I'm not suggesting we do that, especially if we end up passing --disable-libbsd. If we pass that flag to zeromqs config opts, it will just use it's internal strlcpy implementation, and libbsd will no-longer a dependency.

  8. build: Update netbsd_kevent_void.patch
    This change fixes "Hunk #1 succeeded at 307 (offset -1 lines)."
    77899991b1
  9. build: Disable libbsd when building zeromq package in depends
    Since v4.3.3 (068385c951c0608edec6264d55ba9c4c923acccc) libbsd is used
    by default. As we have no libbsd package in our depends, disable it
    explicitly. Zeromq will fallback to its internal strlcpy implementation.
    b970f03bea
  10. build: Disable valgrind when building zeromq package in depends
    We are not running unit tests, therefore it is not required.
    f13e642c83
  11. hebasto force-pushed on Jan 25, 2022
  12. hebasto commented at 1:03 PM on January 25, 2022: member

    Updated c0f664cde99f524852b8b1fbcb7b1a938d9e2e1a -> f13e642c831c5689cb2bb7f5c4f9cb4c0c03ef21 (pr24134.01 -> pr24134.02):

    • addressed @fanquake's comments
    • additionally disabled valgrind which is used in unit tests

    PR description has been updated.

  13. fanquake approved
  14. fanquake commented at 2:44 AM on January 27, 2022: member

    ACK f13e642c831c5689cb2bb7f5c4f9cb4c0c03ef21

  15. fanquake merged this on Jan 27, 2022
  16. fanquake closed this on Jan 27, 2022

  17. laanwj added this to the milestone 23.0 on Jan 27, 2022
  18. sidhujag referenced this in commit bfe2d32348 on Jan 28, 2022
  19. hebasto deleted the branch on Feb 2, 2022
  20. hebasto referenced this in commit 3e418e8983 on Feb 6, 2022
  21. hebasto referenced this in commit 9ce5fcb4d2 on Feb 6, 2022
  22. fanquake referenced this in commit 3eaf7be6ad on Dec 8, 2022
  23. sidhujag referenced this in commit 5dde8cb2a6 on Dec 8, 2022
  24. DrahtBot locked this on Feb 2, 2023

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: 2026-04-24 21:14 UTC

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