From nobody Wed Oct 02 13:34:16 2024 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 4XJbPj0JGKz5YXD9; Wed, 02 Oct 2024 13:34:17 +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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4XJbPh6ld8z4hFf; Wed, 2 Oct 2024 13:34:16 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1727876056; 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=xa7X3GONQ+8payIqjm8I+jG+0evoz30mM/e6Y1KlyqM=; b=x6VEd297pNBl2W3puo28fmsCT1niXwtW0r3q1cPtTlj6hE3r37dN9k6Ejr2vS8kQSJ9F2Q ChpRiPLIUO4+pnNnMExNmy9T4y8VwFh0o1wg1rYRPE7SFSZhrOcOtIl+xvLrk3mQ4caIap cYkAsoHAdS8NtSRiyYZvhDaZUJi+wrxDUo0NCMnO8ETSB/nufvKim11zcxDWzmJE1ACd36 Rk+pYHR+t1DVjjZ/L6/xmWwuxnx66YO0iDWllH7VbR2A1TsYtmNSQ4C+qTdtZIWlRPdsvg wamHYaUtZqQf9Yiqa7XbTcgibZ5bV+yMLC+uJwU+6M5X5FxgInIk0NKjK15vmg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1727876056; 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=xa7X3GONQ+8payIqjm8I+jG+0evoz30mM/e6Y1KlyqM=; b=cFYbrdjtLy5Ag9fe8oBCVMnVTG6hUOZoVAEnCjUevoPpzwurwVIIRZLFGHe9grqI7Bgzz/ 3O8CL//UphVW+wObSGZ5aL8Z6XtsGosEX0rP2EW4rpAvVBdvkqnrFfenUkroCo2iEMHgaP uzBArwYVOcCNySEnApaxWVoFjc1ulVdPCSKLAAhcvn9k5R6tbdtkvYEaWwziIWpluSsx3Q 5WdzWLraExLs4bYKjS6wd/5m5or9ulwrp5cX3CN7SSLGBlKgF9/WTOwrR0bqayq16VgyPZ h5hQSwoG2KkZWPFedUipPQw2i9FQ3x17y2h/yTkzxrD8qx/JQXK649hY4MgOyg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1727876056; a=rsa-sha256; cv=none; b=SMqZb3SBI6P5XekSPUxBUEfuOBvbRIQGDNWZnlth5hDk/totTnJjyWqVZtP3XPWSEm+kHQ DkRX2qM7fah92l21XMh/buS1jHh3geozCchKDg3/9RvzQtl3rNqPZYlbL14IkR7a8Ekvwh 8JVM2KW0bntpz4T3jqnu/wnQi3krcnuorgLuUa+LFombFYVM7UrwcozFhFqnMgMQ4cISoM hAT8HUkU9i4J17AM59NrsWTA8DS9l0rqtK9CH57bL9EDvJrm3KrrbTKPwoDDkCESTRBcaB j8blrvi0k53AoZbrXnRB/IbuFmoFyMU4bC/PI4DTgYubjZBJvwVKzltnnn7/AA== 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 4XJbPh6MJBz1Mk1; Wed, 2 Oct 2024 13:34:16 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 492DYGUC013202; Wed, 2 Oct 2024 13:34:16 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 492DYGt0013199; Wed, 2 Oct 2024 13:34:16 GMT (envelope-from git) Date: Wed, 2 Oct 2024 13:34:16 GMT Message-Id: <202410021334.492DYGt0013199@gitrepo.freebsd.org> To: ports-committers@FreeBSD.org, dev-commits-ports-all@FreeBSD.org, dev-commits-ports-main@FreeBSD.org From: Dimitry Andric Subject: git: c81f658808ee - main - net/samba419: fix rl_completion_func_t detection and usage 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: X-BeenThere: dev-commits-ports-main@freebsd.org Sender: owner-dev-commits-ports-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: dim X-Git-Repository: ports X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: c81f658808ee608f60198584a870087946cefc98 Auto-Submitted: auto-generated The branch main has been updated by dim: URL: https://cgit.FreeBSD.org/ports/commit/?id=c81f658808ee608f60198584a870087946cefc98 commit c81f658808ee608f60198584a870087946cefc98 Author: Dimitry Andric AuthorDate: 2024-10-02 12:38:03 +0000 Commit: Dimitry Andric CommitDate: 2024-10-02 13:32:18 +0000 net/samba419: fix rl_completion_func_t detection and usage After a recent devel/readline update, net/samba419 fails to compile with clang 19, resulting in errors similar to: ../../libcli/smbreadline/smbreadline.c:139:38: warning: 'CPPFunction' is deprecated [-Wdeprecated-declarations] 139 | rl_attempted_completion_function = RL_COMPLETION_CAST completion_fn; | ^ ../../lib/replace/system/readline.h:50:31: note: expanded from macro 'RL_COMPLETION_CAST' 50 | # define RL_COMPLETION_CAST (CPPFunction *) | ^ /usr/local/include/readline/rltypedefs.h:38:50: note: 'CPPFunction' has been explicitly marked deprecated here 38 | typedef char **CPPFunction (void) __attribute__((deprecated)); | ^ ../../libcli/smbreadline/smbreadline.c:139:36: error: incompatible function pointer types assigning to 'rl_completion_func_t *' (aka 'char **(*)(const char *, int, int)') from 'CPPFunction *' (aka 'char **(*)(void)') [-Wincompatible-function-pointer-types] 139 | rl_attempted_completion_function = RL_COMPLETION_CAST completion_fn; | ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ There are two reasons: samba checks for `rl_completion_t`, while the actual readline type is `rl_completion_func_t`, and samba's wrapper `readline.h` header prefers the `CPPFunction` type which is deprecated, while it should use `rl_completion_func_t` instead. Fix the `wscript_configure` check to detect `rl_completion_func_t`, and reverse the `HAVE_RL_COMPLETION_T` and `HAVE_CPPFUNCTION` checks in the wrapper header. PR: 281818 Reviewed by: 0mp Approved by: samba (0mp) MFH: 2024Q3 --- net/samba419/Makefile | 1 + .../files/0028-Fix-rl_completion_func_t.patch | 32 ++++++++++++++++++++++ 2 files changed, 33 insertions(+) diff --git a/net/samba419/Makefile b/net/samba419/Makefile index f52fb33035a9..9580d22e878e 100644 --- a/net/samba419/Makefile +++ b/net/samba419/Makefile @@ -44,6 +44,7 @@ EXTRA_PATCHES= \ ${PATCHDIR}/0025-From-d9b748869a8f4018ebee302aae8246bf29f60309-Mon-Se.patch:-p1 \ ${PATCHDIR}/0026-vfs-add-a-compatibility-option-to-the-vfs_streams_xa.patch:-p1 \ ${PATCHDIR}/0027-Add-VFS-module-vfs_freebsd-that-implements-FreeBSD-s.patch:-p1 \ + ${PATCHDIR}/0028-Fix-rl_completion_func_t.patch:-p1 \ ${PATCHDIR}/0100-Fix-pathref-handling-for-FreeBSD-13plus.patch SAMBA4_BASENAME= samba diff --git a/net/samba419/files/0028-Fix-rl_completion_func_t.patch b/net/samba419/files/0028-Fix-rl_completion_func_t.patch new file mode 100644 index 000000000000..33debfab76bc --- /dev/null +++ b/net/samba419/files/0028-Fix-rl_completion_func_t.patch @@ -0,0 +1,32 @@ +--- a/samba-4.19.8/lib/replace/system/readline.h 2023-07-18 10:14:54.478091000 +0200 ++++ b/lib/replace/system/readline.h 2024-10-02 13:47:48.773606000 +0200 +@@ -46,10 +46,10 @@ + #endif + + #ifdef HAVE_NEW_LIBREADLINE +-#ifdef HAVE_CPPFUNCTION ++#if defined(HAVE_RL_COMPLETION_FUNC_T) ++# define RL_COMPLETION_CAST (rl_completion_func_t *) ++#elif defined(HAVE_CPPFUNCTION) + # define RL_COMPLETION_CAST (CPPFunction *) +-#elif defined(HAVE_RL_COMPLETION_T) +-# define RL_COMPLETION_CAST (rl_completion_t *) + #else + # define RL_COMPLETION_CAST + #endif +diff -upr a/samba-4.19.8/libcli/smbreadline/wscript_configure b/libcli/smbreadline/wscript_configure +--- a/samba-4.19.8/libcli/smbreadline/wscript_configure 2023-07-18 10:14:54.558091600 +0200 ++++ b/libcli/smbreadline/wscript_configure 2024-10-02 13:47:48.774008000 +0200 +@@ -51,10 +51,10 @@ conf.CHECK_CODE(''' + # endif + # endif + #endif +-int main(void) {rl_completion_t f; return 0;} ++int main(void) {rl_completion_func_t f; return 0;} + ''', + 'HAVE_RL_COMPLETION_FUNC_T', execute=False, addmain=False, +-msg='Checking for rl_completion_t') ++msg='Checking for rl_completion_func_t') + + conf.CHECK_CODE(''' + #ifdef HAVE_READLINE_READLINE_H