From nobody Fri Jul 26 13:49:45 2024 X-Original-To: dev-commits-ports-all@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 4WVpyx4HJqz5S8dN; Fri, 26 Jul 2024 13:49:45 +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 4WVpyx3DKFz4nY9; Fri, 26 Jul 2024 13:49:45 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1722001785; 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=1iLWGkcBMyvLLNFSH7ld+hCS0Xw2O22Za+MqlAC6DZg=; b=MzH5YFg33SRSkPdDxI0c6r7DVtBoPSRQvbNVLOBeEt/UHhHR25+3uCJvFNzrsrg+DyhL+y Fu6jBeRoBPmj34F6i9oHq1APHb4Ncw5HXzWETzDJhwSXLSzNmz0SXYQAtxUx1cf4Sm0+3G 3j6EO85rhHK6I6qf+w6Pij4QXhVzBYqwEc1aKc9GZoY0ir4ZOrXeHmxUkkxOekqAaHrxIQ UU5Oc8mP19Wo8rRNG0p0jLnv4fOfB73bZ6o8Qx+LXZolV10zqBNGKZ9iiTpPIwExdqtMI6 9Q1ScxGrdD5X9VuwtNZYd4DGTlO2SwXjzAnIsmyoIFSlCElg5jGm8OxUssHPRA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1722001785; a=rsa-sha256; cv=none; b=WfXob8Z405OT0Sp1h18+IeN5a66NZIqrJSztIbs/bnUWsRb4HQLzkjRMbTomw0z+AFscF0 B3yQvsn2plyHD2n4XmgFINO2Rmvw9NCngpVdjiMTnn60ax0LwEoPWg3MVf5q04qlxO23pi ZQP8WaVikmYAqJvTcnXHmaHooJl/+ZJbnwzFXHd2n9+Je56w2WIfkNwTu6E2WeBqDLxbzt 6kW36XCSTgcFls77ObtOeopb1PjY2z4FzZWDBvqR3BGgOIPEKjM+ZD2XCfOpk3uHgH9G0v hJvGO0aIK/pjjFz1EzQh3nBAA7TcRq5yAng0zGDocC8LScOnGZDrMDc9xJ50LA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1722001785; 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=1iLWGkcBMyvLLNFSH7ld+hCS0Xw2O22Za+MqlAC6DZg=; b=G7RauiTvUHdCN/3YUJeAfz1RFUVxfPzQjYj3HT72N/WgLIOFDY2tSMwzbVK7/0d+wWRRhp PDVbN07zQx8lUUix2V1+EFdN26XNM4hv6uBh97iQIG+PRPyDCbb3XU5AS7Ju/JFo7/w256 KregbaRwqU3QcPLRPOIImdA449pApPcozDrZqHEo8w/bGLpQ6WIsErpjiYiRLmsWUnCh+o cQSAmcrL77H5NYlpdy5Dm34kyo/IlgDVeO0gWcwl7D9PC32hluzOwqLXyuTmaEJdtNjt4B fY9fAa4bMJWAjznvqwNoas+wqL6kSvYbI9ZhGFgbsVojqvhT/A0aTOp5XHU0Og== 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 4WVpyx2mR6zQZ5; Fri, 26 Jul 2024 13:49:45 +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 46QDnj9i090381; Fri, 26 Jul 2024 13:49:45 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 46QDnjON090378; Fri, 26 Jul 2024 13:49:45 GMT (envelope-from git) Date: Fri, 26 Jul 2024 13:49:45 GMT Message-Id: <202407261349.46QDnjON090378@gitrepo.freebsd.org> To: ports-committers@FreeBSD.org, dev-commits-ports-all@FreeBSD.org, dev-commits-ports-main@FreeBSD.org From: Matthias Andree Subject: git: bd04537abb28 - main - archivers/py-borgbackup: unbreak on FreeBSD 13 List-Id: Commit messages for all branches of the ports repository List-Archive: https://lists.freebsd.org/archives/dev-commits-ports-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-ports-all@freebsd.org Sender: owner-dev-commits-ports-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mandree X-Git-Repository: ports X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: bd04537abb28059580c84440c56a952d76067bd1 Auto-Submitted: auto-generated The branch main has been updated by mandree: URL: https://cgit.FreeBSD.org/ports/commit/?id=bd04537abb28059580c84440c56a952d76067bd1 commit bd04537abb28059580c84440c56a952d76067bd1 Author: Matthias Andree AuthorDate: 2024-07-26 13:23:06 +0000 Commit: Matthias Andree CommitDate: 2024-07-26 13:43:31 +0000 archivers/py-borgbackup: unbreak on FreeBSD 13 import acl_extended_file_np.c from src/lib/libc/posix1e, taken from FreeBSD src branch as of 559a218c9b25, 2023-11-01T16:43:37Z and tell Cython to include it on FreeBSD before 1400033, i. e., before FreeBSD's libc had it. This fixes https://github.com/borgbackup/borg/issues/8269 and makes it unnecessary to look into PR: 280453 --- UPDATING | 10 +-- archivers/py-borgbackup/Makefile | 21 ++++-- .../py-borgbackup/files/acl_extended_file_np.c | 83 ++++++++++++++++++++++ archivers/py-borgbackup/files/extrapatch-setup.py | 11 +++ 4 files changed, 116 insertions(+), 9 deletions(-) diff --git a/UPDATING b/UPDATING index b7a2281d0b74..79e0ecf9a398 100644 --- a/UPDATING +++ b/UPDATING @@ -5,15 +5,15 @@ they are unavoidable. You should get into the habit of checking this file for changes each time you update your ports collection, before attempting any port upgrades. -20240724: +20240726: AFFECTS: users of archivers/py-borgbackup AUTHOR: mandree@FreeBSD.org - Borgbackup has been upgraded to version 1.4.0, which does not yet - support FreeBSD 13.x, see https://github.com/borgbackup/borg/issues/8269 + Borgbackup has been upgraded to version 1.4.0. + The FreeBSD port as of 2024-07-26 reinstates FreeBSD 13 compatibility. - For users who are on FreeBSD 13, or who wish to continue using - version 1.2, use either of these commands for upgrading: + For users who wish to continue using version 1.2, + use either of these commands for upgrading: With binary packages through pkg: pkg set -o archivers/py-borgbackup:archivers/py-borgbackup12 diff --git a/archivers/py-borgbackup/Makefile b/archivers/py-borgbackup/Makefile index 774f1033d9cf..054fa3ee234d 100644 --- a/archivers/py-borgbackup/Makefile +++ b/archivers/py-borgbackup/Makefile @@ -1,6 +1,6 @@ PORTNAME= borgbackup DISTVERSION= 1.4.0 -PORTREVISION= 0 +PORTREVISION= 1 CATEGORIES= archivers python MASTER_SITES= PYPI PKGNAMEPREFIX= ${PYTHON_PKGNAMEPREFIX} @@ -12,8 +12,6 @@ WWW= https://pypi.org/project/borgbackup/ LICENSE= BSD3CLAUSE LICENSE_FILE= ${WRKSRC}/LICENSE -BROKEN_FreeBSD_13= uses acl_extended_link_np, see https://github.com/borgbackup/borg/issues/8269 - # note that borgbackup pins the msgpack version range per patchlevel version! _BB_DEPENDS= ${PYTHON_PKGNAMEPREFIX}msgpack>=1.0.2<1.1.0:devel/py-msgpack@${PY_FLAVOR} BUILD_DEPENDS= ${PYTHON_PKGNAMEPREFIX}pkgconfig>=0:devel/py-pkgconfig@${PY_FLAVOR} \ @@ -39,6 +37,21 @@ OPTIONS_DEFAULT= FUSE FUSE_DESC= Support to mount locally borg backup files FUSE_RUN_DEPENDS= ${PYTHON_PKGNAMEPREFIX}llfuse>0:devel/py-llfuse@${PY_FLAVOR} +.include + +.if (${OPSYS} == FreeBSD) && ${OSVERSION} < 1400033 # why 1400033? +# 1. check for the OLDEST (last in list) history entry on the file, when it was added: +# git -C /usr/src hist lib/libc/posix1e/acl_extended_file_np.c +# 2. check for the version you have obtained what __FreeBSD_version was +# and increment by one. This is inaccurate for the interim between file addition +# and __FreeBSD_version bump back then, but those versions were no releases and +# should no longer be in the field. +EXTRA_PATCHES += ${FILESDIR}/extrapatch-setup.py +post-patch: + ${CP} ${FILESDIR}/acl_extended_file_np.c ${WRKSRC}/src/borg/platform/ +.endif + + _BORGHOME=${WRKDIR}/testhome _BORGENV=-i BORG_PASSPHRASE=secret123 PYTHONPATH=${STAGEDIR}${PYTHON_SITELIBDIR} HOME=${_BORGHOME} post-install: @@ -71,4 +84,4 @@ post-install: do-test: cd ${WRKSRC} && ${SETENV} ${_BORGENV} ${TEST_ENV} tox-${PYTHON_VER} -e ${PY_FLAVOR} -vv -.include +.include diff --git a/archivers/py-borgbackup/files/acl_extended_file_np.c b/archivers/py-borgbackup/files/acl_extended_file_np.c new file mode 100644 index 000000000000..269ceeb56fe7 --- /dev/null +++ b/archivers/py-borgbackup/files/acl_extended_file_np.c @@ -0,0 +1,83 @@ +/*- + * SPDX-License-Identifier: BSD-2-Clause + * + * Copyright (c) 2021 Gleb Popov + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ +/* taken from FreeBSD src branch as of 559a218c9b25 Wed Nov 1 16:43:37 2023 -0600 */ +/* + * acl_extended_file_np: Check if the file has extended ACLs set. + */ + +#include +#include +#include + +#include + +typedef acl_t (*acl_get_func)(const char *, acl_type_t); +typedef long (*pathconf_func)(const char *, int); + +static int +_acl_extended_file(acl_get_func f, pathconf_func pathconf_f, const char* path_p); + +int +acl_extended_file_np(const char *path_p) +{ + return (_acl_extended_file(acl_get_file, pathconf, path_p)); +} + +int +acl_extended_file_nofollow_np(const char *path_p) +{ + return (_acl_extended_file(acl_get_link_np, lpathconf, path_p)); +} + +int +acl_extended_link_np(const char *path_p) +{ + return (_acl_extended_file(acl_get_link_np, lpathconf, path_p)); +} + +int +_acl_extended_file(acl_get_func acl_get, pathconf_func pathconf_f, const char* path_p) +{ + acl_t acl; + int retval, istrivial, acltype = ACL_TYPE_ACCESS; + + retval = pathconf_f(path_p, _PC_ACL_NFS4); + if (retval > 0) + acltype = ACL_TYPE_NFS4; + + acl = acl_get(path_p, acltype); + if (acl == NULL) + return (-1); + + retval = acl_is_trivial_np(acl, &istrivial); + acl_free(acl); + if (retval == -1) + return (-1); + + return (!istrivial); +} diff --git a/archivers/py-borgbackup/files/extrapatch-setup.py b/archivers/py-borgbackup/files/extrapatch-setup.py new file mode 100644 index 000000000000..f0128d2bb589 --- /dev/null +++ b/archivers/py-borgbackup/files/extrapatch-setup.py @@ -0,0 +1,11 @@ +--- setup.py.orig 2024-07-02 22:06:38 UTC ++++ setup.py +@@ -181,7 +181,7 @@ if not on_rtd: + syncfilerange_ext = Extension( + "borg.platform.syncfilerange", [platform_syncfilerange_source], extra_compile_args=cflags + ) +- freebsd_ext = Extension("borg.platform.freebsd", [platform_freebsd_source], extra_compile_args=cflags) ++ freebsd_ext = Extension("borg.platform.freebsd", [platform_freebsd_source, 'src/borg/platform/acl_extended_file_np.c'], extra_compile_args=cflags) + darwin_ext = Extension("borg.platform.darwin", [platform_darwin_source], extra_compile_args=cflags) + windows_ext = Extension("borg.platform.windows", [platform_windows_source], extra_compile_args=cflags) +