From nobody Sun Jul 16 13:05:53 2023 X-Original-To: dev-commits-ports-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4R3lns2jd7z4msb7; Sun, 16 Jul 2023 13:05:53 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4R3lns1vKPz3kDs; Sun, 16 Jul 2023 13:05:53 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1689512753; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=MYqRZa1+JSyaFoq8sTGlb5OgzupcJVvrWT16+KlyQpc=; b=kbFC7pGjV8JCGkx8CzSfz0zgOunckPGjzIU/71THdmZbGyRAhGpZfF08x1oBWXcbggvTBd Dxc3byar12dpEDQNwok6zLoxJsLgBZrUvssTJgfPdaiH3OsqUSJdWyC+NIAt4bz00OXG6C Xvlz3R5ZWIQwe/8aowBkv0cbukp/TryyfatH3qMS2zxFrTAAupypwHpo/BzyTQ+JfzKTF9 aDyRuxDx37SnLY2AEyPzZFilUBJkI1Zm9VTChO7ucm0tCXSRG8hz5c2OTmqTbObg4+NRUi 7VXXxQKKOw+ytx4o4lPhTc8EVOu4rv0DrjiDt5KCrJhRy7xJosq92M7ryXmBXQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1689512753; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=MYqRZa1+JSyaFoq8sTGlb5OgzupcJVvrWT16+KlyQpc=; b=LAcCP/Osa/9EkC3cWmNsxdgHipxI1oimfyypJMHrC84GKJ8+svFHQPrN8YaxwDPhJTbVIV yJ5DbZvj41ahtUQW2XTbDiuGoqrO6DRQsUPFECnTRacskAkmT+sk6LannPCidvc1scziTv VGaXELpgSjcujOMp0yC8xhNuBW0YOHRg1LkU3kwDJmqUy++p2RX5pWP+lb6aOqbV+jjjPZ s8aWagJ1ZmStWd8wMzYXfgRxgGHlpA7J197FMQ6E/tMGAYJWoSoz1765NvXsftNUViD/Do OmFPYSpNjmY4D358JHE714J42V7UhK7fFc1BmypoTuKIAvzNZ6eI94mrLrWOHg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1689512753; a=rsa-sha256; cv=none; b=ZZ8Q+j4B4fpILM2Ac6VObSD4mcQ9C2geJE2cykixpYyqUnsfH2luv6YNBb3Yey8eHpN8ZT 70uqfJEEg+jA0tuhSZlwdP1VtcS43P9Gw49fmuotw2PUx4vR5GWc9lMOh22JVMWUzmQx7o oltdue09wqvUAJ5F11hXSGMrD2PnrWu09XEawX2pJspwMITF27gg6RplzqYVzEW4GYbDE2 6ezuh1W2w0lV3xE2rbGtA+trA8yzPnHM5YLtj8yngMD0p7gJv/X9z9IPUqztktNWMhXSuG 4jRcVER+z1z6u6SY2dML917w5zxvNpXxELRtMU52R+T2Zx0NDMiLjr1l3PlLEw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4R3lns109hzjQK; Sun, 16 Jul 2023 13:05:53 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 36GD5r2a033030; Sun, 16 Jul 2023 13:05:53 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 36GD5r9N033029; Sun, 16 Jul 2023 13:05:53 GMT (envelope-from git) Date: Sun, 16 Jul 2023 13:05:53 GMT Message-Id: <202307161305.36GD5r9N033029@gitrepo.freebsd.org> To: ports-committers@FreeBSD.org, dev-commits-ports-all@FreeBSD.org, dev-commits-ports-main@FreeBSD.org From: Raphael Kubo da Costa Subject: git: e7f65a58f219 - main - net-im/libquotient: Fix the build on FreeBSD releases with LLVM < 14 List-Id: Commits to the main branch of the FreeBSD ports repository List-Archive: https://lists.freebsd.org/archives/dev-commits-ports-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-ports-main@freebsd.org X-BeenThere: dev-commits-ports-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: rakuco X-Git-Repository: ports X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: e7f65a58f219d0f6f4e2d3b48e4ee431081ef92b Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by rakuco: URL: https://cgit.FreeBSD.org/ports/commit/?id=e7f65a58f219d0f6f4e2d3b48e4ee431081ef92b commit e7f65a58f219d0f6f4e2d3b48e4ee431081ef92b Author: Raphael Kubo da Costa AuthorDate: 2023-07-16 12:56:40 +0000 Commit: Raphael Kubo da Costa CommitDate: 2023-07-16 13:05:22 +0000 net-im/libquotient: Fix the build on FreeBSD releases with LLVM < 14 Older libc++ releases have a bug, https://reviews.llvm.org/D107199, that prevents `connectSingleShot()` in this port from working in certain cases. The current workaround was to just avoid compiling the test that caused the build to fail, but it does not fix the problem for consumer ports like net-im/neochat. The easiest solution in this case is to make the port fall back to a code path that does not use `std::bind_front()` on FreeBSD versions with older LLVM releases. Test Plan: The port built fine on 12.4-i386 (LLVM 13.0.0), 13.2-amd64 (LLVM 14.0.3) and 14-amd64 (LLVM 16). I didn't bother to test 13.1 because it's going EOL at the end of the month anyway. Approved by: kde (arrowd) MFH: 2023Q3 Differential Revision: https://reviews.freebsd.org/D41044 --- net-im/libquotient/Makefile | 10 +---- .../files/patch-lib_qt__connection__util.h | 52 ++++++++++++++++++++++ 2 files changed, 54 insertions(+), 8 deletions(-) diff --git a/net-im/libquotient/Makefile b/net-im/libquotient/Makefile index 5f797562c844..a7baa9492b5b 100644 --- a/net-im/libquotient/Makefile +++ b/net-im/libquotient/Makefile @@ -1,5 +1,6 @@ PORTNAME= libquotient DISTVERSION= 0.7.1 +PORTREVISION= 1 CATEGORIES= net-im MAINTAINER= adridg@FreeBSD.org @@ -29,11 +30,4 @@ CC= ${LLVM_PREFIX}/bin/clang CPP= ${LLVM_PREFIX}/bin/clang-cpp CXX= ${LLVM_PREFIX}/bin/clang++ - -.include - -.if ${OPSYS} == FreeBSD && ${OSVERSION} < 1301507 -CMAKE_ARGS+= -DBUILD_TESTING=OFF -.endif - -.include +.include diff --git a/net-im/libquotient/files/patch-lib_qt__connection__util.h b/net-im/libquotient/files/patch-lib_qt__connection__util.h new file mode 100644 index 000000000000..e180df41eedd --- /dev/null +++ b/net-im/libquotient/files/patch-lib_qt__connection__util.h @@ -0,0 +1,52 @@ +The call std::bind_front() below only works from LLVM 14 on because libc++ +needs https://reviews.llvm.org/D107199 to work correctly, otherwise uses of +connectSingleShot() fail. See net-im/neochat for example [1]: + +In file included from /wrkdirs/usr/ports/net-im/neochat/work/neochat-23.04.2/src/controller.cpp:5: +In file included from /wrkdirs/usr/ports/net-im/neochat/work/neochat-23.04.2/src/controller.h:6: +In file included from /usr/local/include/qt5/QtCore/QObject:1: +In file included from /usr/local/include/qt5/QtCore/qobject.h:46: +In file included from /usr/local/include/qt5/QtCore/qobjectdefs.h:48: +In file included from /usr/local/include/qt5/QtCore/qnamespace.h:43: +In file included from /usr/local/include/qt5/QtCore/qglobal.h:142: +In file included from /usr/include/c++/v1/algorithm:653: +In file included from /usr/include/c++/v1/functional:495: +In file included from /usr/include/c++/v1/__functional/bind_front.h:14: +/usr/include/c++/v1/__functional/perfect_forward.h:77:9: error: no matching constructor for initialization of 'tuple' + __bound_(_VSTD::forward<_BoundArgs>(__bound)...) { } + ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +/usr/local/include/Quotient/qt_connection_util.h:22:14: note: in instantiation of function template specialization 'std::__perfect_forward_impl, std::__tuple_indices<0, 1>>::__perfect_forward_impl, std::__tuple_indices<0, 1>> &>' requested here + [slotLike, pConn = std::move(pConn)](const auto&... args) + ^ +/usr/local/include/Quotient/qt_connection_util.h:93:23: note: in instantiation of function template specialization 'Quotient::_impl::connect, std::__tuple_indices<0, 1>>>' requested here + return _impl::connect<_impl::SingleShot>( + ^ +/wrkdirs/usr/ports/net-im/neochat/work/neochat-23.04.2/src/controller.cpp:372:25: note: in instantiation of function template specialization 'Quotient::connectSingleShot' requested here + connectSingleShot(connection, &Connection::syncDone, this, &Controller::initiated); + ^ + +[1] https://pkg-status.freebsd.org/beefy2/data/124amd64-quarterly/8898bf465b47/logs/neochat-23.04.2.log + +--- lib/qt_connection_util.h ++++ lib/qt_connection_util.h +@@ -3,6 +3,8 @@ + + #pragma once + ++#include // For __FreeBSD_version ++ + #include "function_traits.h" + + #include +@@ -81,7 +83,10 @@ inline auto connectSingleShot(auto* sender, auto signal, ContextT* context, + // object has to be pre-bound to the slot to make it self-contained + if constexpr (_impl::PmfSlot) { + auto&& boundSlot = +-# if __cpp_lib_bind_front // Needs Apple Clang 13 (other platforms are fine) ++# if __cpp_lib_bind_front && \ ++ !defined(__FreeBSD_version) || __FreeBSD_version >= 1301504 ++ // This requires LLVM >= 14, this only works with libc++ commit ++ // https://reviews.llvm.org/D107199. + std::bind_front(slot, context); + # else + [context, slot](const auto&... args)