Bug 271850

Summary: net/libzmq4: fix build with libc++ 16
Product: Ports & Packages Reporter: Dimitry Andric <dim>
Component: Individual Port(s)Assignee: Muhammad Moinur Rahman <bofh>
Status: Closed FIXED    
Severity: Affects Some People Flags: bugzilla: maintainer-feedback? (bofh)
Priority: ---    
Version: Latest   
Hardware: Any   
OS: Any   
Bug Depends on:    
Bug Blocks: 271047    
Attachments:
Description Flags
net/libzmq4: fix build with libc++ 16 none

Description Dimitry Andric freebsd_committer freebsd_triage 2023-06-05 20:37:22 UTC
Like recent versions of GNU libstdc++, libc++ 16 now has a static
assertion to ensure that custom allocators have the correct rebind
member, and this assertion fires when building libzmq4:

  In file included from src/curve_client.cpp:35:
  In file included from ./src/msg.hpp:40:
  In file included from ./src/metadata.hpp:33:
  In file included from /usr/include/c++/v1/map:2356:
  In file included from /usr/include/c++/v1/functional:515:
  In file included from /usr/include/c++/v1/__functional/boyer_moore_searcher.h:26:
  /usr/include/c++/v1/vector:372:5: error: static assertion failed due to requirement 'is_same<zmq::secure_allocator_t<unsigned char>, std::allocator<unsigned char>>::value': [allocator.requirements] states that rebinding an allocator to the same type should result in the original allocator
      static_assert(is_same<allocator_type, __rebind_alloc<__alloc_traits, value_type> >::value,
      ^             ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Upstream fixed this in
<https://github.com/zeromq/libzmq/commit/438d5d88>, so apply that patch.
Comment 1 Dimitry Andric freebsd_committer freebsd_triage 2023-06-05 20:38:51 UTC
Created attachment 242624 [details]
net/libzmq4: fix build with libc++ 16
Comment 2 commit-hook freebsd_committer freebsd_triage 2023-06-06 17:49:34 UTC
A commit in branch main references this bug:

URL: https://cgit.FreeBSD.org/ports/commit/?id=6b379f1b6bbf8967800fa9e2b164e2a9b58f6778

commit 6b379f1b6bbf8967800fa9e2b164e2a9b58f6778
Author:     Dimitry Andric <dim@FreeBSD.org>
AuthorDate: 2023-06-06 14:45:29 +0000
Commit:     Muhammad Moinur Rahman <bofh@FreeBSD.org>
CommitDate: 2023-06-06 17:47:37 +0000

    net/libzmq4: Fix build with libc++ 16

    Like recent versions of GNU libstdc++, libc++ 16 now has a static
    assertion to ensure that custom allocators have the correct rebind
    member, and this assertion fires error when building.

    Upstream fixed this in
    <https://github.com/zeromq/libzmq/commit/438d5d88>, so apply that patch.

    PR:             271850

 net/libzmq4/Makefile | 3 +++
 net/libzmq4/distinfo | 4 +++-
 2 files changed, 6 insertions(+), 1 deletion(-)
Comment 3 Muhammad Moinur Rahman freebsd_committer freebsd_triage 2023-06-06 17:51:34 UTC
Committed with changes in commit log.