From nobody Mon Jun 10 04:25:27 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 4VyJd34Kd4z5NrYs; Mon, 10 Jun 2024 04:25:27 +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 4VyJd33Wz3z4fXG; Mon, 10 Jun 2024 04:25:27 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1717993527; 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=nQFVT825EKM5XaTjUfbEdimeq8vW+AIrnyCXwagpC6g=; b=D93vrusHT9FGvsyqqiLsu2YgOAWKbohmJ4I7JMTif17jBCNCEr9hsh6ckPvDXJxRoBYTWL VCXm4OQxvGhXBUxq/AD+On0OR3yYG7ZUAKCKM7kGt5m8vAc1YFwm8BlJ5lh+ESyq6bbGV1 Fntf6xHGJ1v9C2c63n9C+WD3bxdOvwTws5rcnKVnntS6o9GUDbi4ykGub5sFMM6IQiFg9E tcH93muv9gsCAxU1y844ZQQfFmZJLebvidSRxnAAltMPLjNzkfs4jUPgWUrA9+WZ+sBhLy s1+we/lcUl4SB3wKoEJFGaJTFQQmSkMbXW8tLdJ7t79XEm2R1W854SUcewf3yQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1717993527; a=rsa-sha256; cv=none; b=fpQ/DfKy79HZjUVzH6RDYQvYiTnhQz+wIC3tdRhCHNxJoOBaXycCZPrQSC100DlUB9FS0s gxnY5EY1rp6l9SHpbMWlEhq0NhmqSmgQkaC18b+y5qhl0SNf7NnJrpf4BdpkJbnk1y0nIr 0BRNde3/aiUoyvs4t3eOCAX7QgY2FRzKKFbbiXyprr7X4M+QoUg1ZhfuNZAGIwIWHU4PNy oQLeu+/0dCfAIFg8+KsexE+RBit0D35bkdHY5d38Uko3w2jwnduJSKwkVulrawr6LQa7dP pa9DFVTT8D3/uMt0XqUMG2Srbh1zJk2fPgFiggL87teUXhJjSMVQgYW/iH5xiQ== 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=1717993527; 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=nQFVT825EKM5XaTjUfbEdimeq8vW+AIrnyCXwagpC6g=; b=QE+kN09LH/a2y/gUIhrSIwBDkl5ydhhpUjtWGtpcyMQ9lKL3hpnCXGzvJAY3OHkRu+gk74 f8ttEYItweIGH1E04cXMdqbp4dGO7/7GffCBhPx8H/FYNVdMjzzstcWlvr/RcLUbFSy7ts tK6sA48C+NJE3DrznPelufk4lidJz5fgaT6I5HjeGcGHk+jopJ8HLHREs9q8eTKQFHJbnN 86/2uuwVTIkIx1p8eDZkJqHe8LR/B8TzwQdh2RjHf8Ag2/U/bwQtXST9Ss607GlMWpkr5L Ab+pVMZ4x6npLCuaE69mj9yr3By5URxiG5DAwIfCMaUyA9gGlRyVD/+ZlNIpzg== 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 4VyJd32xzrz1B6K; Mon, 10 Jun 2024 04:25:27 +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 45A4PRo9022523; Mon, 10 Jun 2024 04:25:27 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 45A4PR3S022520; Mon, 10 Jun 2024 04:25:27 GMT (envelope-from git) Date: Mon, 10 Jun 2024 04:25:27 GMT Message-Id: <202406100425.45A4PR3S022520@gitrepo.freebsd.org> To: ports-committers@FreeBSD.org, dev-commits-ports-all@FreeBSD.org, dev-commits-ports-main@FreeBSD.org From: Cy Schubert Subject: git: 2d21f87b49ab - main - devel/brz: Unbreak with newer python. 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: cy X-Git-Repository: ports X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 2d21f87b49abefa0d565e4c439b59df24edfb8aa Auto-Submitted: auto-generated The branch main has been updated by cy: URL: https://cgit.FreeBSD.org/ports/commit/?id=2d21f87b49abefa0d565e4c439b59df24edfb8aa commit 2d21f87b49abefa0d565e4c439b59df24edfb8aa Author: Matthew D. Fuller AuthorDate: 2024-06-02 20:55:40 +0000 Commit: Cy Schubert CommitDate: 2024-06-10 04:25:05 +0000 devel/brz: Unbreak with newer python. This forces a cython run and brings in the patch from upstream revision the_breezy_bot-20221107175157-t17wpc8hfcwsmsa0 on the brz 3.3 branch. The 3.3 releases have significant differences in build dependancy, so are currently being held off on. --- devel/brz/Makefile | 3 +- devel/brz/files/patch-breezy___rio__py.py | 35 ++++++++++++ devel/brz/files/patch-breezy___rio__pyx.pyx | 82 +++++++++++++++++++++++++++++ 3 files changed, 119 insertions(+), 1 deletion(-) diff --git a/devel/brz/Makefile b/devel/brz/Makefile index 45968f523a59..f1df281ea870 100644 --- a/devel/brz/Makefile +++ b/devel/brz/Makefile @@ -22,7 +22,7 @@ RUN_DEPENDS= ${PYTHON_PKGNAMEPREFIX}configobj>=0:devel/py-configobj@${PY_FLAVOR} TEST_DEPENDS= ${PYTHON_PKGNAMEPREFIX}testtools>=0:devel/py-testtools@${PY_FLAVOR} USES= gettext python shebangfix -USE_PYTHON= autoplist concurrent distutils +USE_PYTHON= autoplist cython concurrent distutils SHEBANG_FILES= brz MAKE_ENV= BRZ_LOG=/dev/null @@ -42,6 +42,7 @@ SFTP_RUN_DEPENDS= ${PYTHON_PKGNAMEPREFIX}paramiko>=0:security/py-paramiko@${PY_F post-patch: @${REINPLACE_CMD} -e 's|man/man1|share/man/man1|' ${WRKSRC}/setup.py + @${RM} ${WRKSRC}/breezy/*_pyx.c ${WRKSRC}/breezy/bzr/*_pyx.c post-install: ${INSTALL_MAN} ${WRKSRC}/brz.1 ${STAGEDIR}${PREFIX}/share/man/man1 diff --git a/devel/brz/files/patch-breezy___rio__py.py b/devel/brz/files/patch-breezy___rio__py.py new file mode 100644 index 000000000000..faaad2274ed2 --- /dev/null +++ b/devel/brz/files/patch-breezy___rio__py.py @@ -0,0 +1,35 @@ +--- breezy/_rio_py.py.orig 2021-12-07 02:24:26 UTC ++++ breezy/_rio_py.py +@@ -17,6 +17,7 @@ import re + """Python implementation of _read_stanza_*.""" + + import re ++from typing import Iterator, Optional + + from .rio import ( + Stanza, +@@ -25,13 +26,13 @@ _tag_re = re.compile(r'^[-a-zA-Z0-9_]+$') + _tag_re = re.compile(r'^[-a-zA-Z0-9_]+$') + + +-def _valid_tag(tag): ++def _valid_tag(tag: str) -> bool: + if not isinstance(tag, str): + raise TypeError(tag) + return bool(_tag_re.match(tag)) + + +-def _read_stanza_utf8(line_iter): ++def _read_stanza_utf8(line_iter: Iterator[bytes]) -> Optional[Stanza]: + stanza = Stanza() + tag = None + accum_value = None +@@ -67,7 +68,7 @@ def _read_stanza_utf8(line_iter): + accum_value = [line[colon_index + 2:-1]] + + if tag is not None: # add last tag-value +- stanza.add(tag, u''.join(accum_value)) ++ stanza.add(tag, u''.join(accum_value)) # type: ignore + return stanza + else: # didn't see any content + return None diff --git a/devel/brz/files/patch-breezy___rio__pyx.pyx b/devel/brz/files/patch-breezy___rio__pyx.pyx new file mode 100644 index 000000000000..125603cb2660 --- /dev/null +++ b/devel/brz/files/patch-breezy___rio__pyx.pyx @@ -0,0 +1,82 @@ +--- breezy/_rio_pyx.pyx.orig 2021-12-07 02:24:26 UTC ++++ breezy/_rio_pyx.pyx +@@ -31,10 +31,6 @@ from cpython.unicode cimport ( + from cpython.unicode cimport ( + PyUnicode_CheckExact, + PyUnicode_DecodeUTF8, +- # Deprecated after PEP 393 changes +- PyUnicode_AS_UNICODE, +- PyUnicode_FromUnicode, +- PyUnicode_GET_SIZE, + ) + from cpython.list cimport ( + PyList_Append, +@@ -44,15 +40,9 @@ from cpython.mem cimport ( + PyMem_Malloc, + PyMem_Realloc, + ) +-from cpython.version cimport ( +- PY_MAJOR_VERSION, +- ) + + cdef extern from "Python.h": + ctypedef int Py_UNICODE +- object PyUnicode_EncodeASCII(Py_UNICODE *, int, char *) +- int Py_UNICODE_ISLINEBREAK(Py_UNICODE) +- + # GZ 2017-09-11: Not sure why cython unicode module lacks this? + object PyUnicode_FromStringAndSize(const char *u, Py_ssize_t size) + +@@ -74,19 +64,13 @@ def _valid_tag(tag): + + + def _valid_tag(tag): +- cdef char *c_tag ++ cdef const char *c_tag + cdef Py_ssize_t c_len + cdef int i + # GZ 2017-09-11: Encapsulate native string as ascii tag somewhere neater +- if PY_MAJOR_VERSION >= 3: +- if not PyUnicode_CheckExact(tag): +- raise TypeError(tag) +- c_tag = PyUnicode_AsUTF8AndSize(tag, &c_len) +- else: +- if not PyBytes_CheckExact(tag): +- raise TypeError(tag) +- c_tag = PyBytes_AS_STRING(tag) +- c_len = PyBytes_GET_SIZE(tag) ++ if not PyUnicode_CheckExact(tag): ++ raise TypeError(tag) ++ c_tag = PyUnicode_AsUTF8AndSize(tag, &c_len) + if c_len < 1: + return False + for i from 0 <= i < c_len: +@@ -104,27 +88,8 @@ cdef object _split_first_line_utf8(char *line, int len + raise ValueError("invalid tag in line %r" % line) + memcpy(value, line+i+2, len-i-2) + value_len[0] = len-i-2 +- if PY_MAJOR_VERSION >= 3: +- return PyUnicode_FromStringAndSize(line, i) +- return PyBytes_FromStringAndSize(line, i) ++ return PyUnicode_DecodeUTF8(line, i, "strict") + raise ValueError('tag/value separator not found in line %r' % line) +- +- +-cdef object _split_first_line_unicode(Py_UNICODE *line, int len, +- Py_UNICODE *value, Py_ssize_t *value_len): +- cdef int i +- for i from 0 <= i < len: +- if line[i] == c':': +- if line[i+1] != c' ': +- raise ValueError("invalid tag in line %r" % +- PyUnicode_FromUnicode(line, len)) +- memcpy(value, &line[i+2], (len-i-2) * sizeof(Py_UNICODE)) +- value_len[0] = len-i-2 +- if PY_MAJOR_VERSION >= 3: +- return PyUnicode_FromUnicode(line, i) +- return PyUnicode_EncodeASCII(line, i, "strict") +- raise ValueError("tag/value separator not found in line %r" % +- PyUnicode_FromUnicode(line, len)) + + + def _read_stanza_utf8(line_iter):