From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtp.gentoo.org (woodpecker.gentoo.org [140.211.166.183]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id A8FB61584AD for ; Mon, 05 May 2025 05:10:25 +0000 (UTC) Received: from lists.gentoo.org (bobolink.gentoo.org [140.211.166.189]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) (Authenticated sender: relay-lists.gentoo.org@gentoo.org) by smtp.gentoo.org (Postfix) with ESMTPSA id 9287C343169 for ; Mon, 05 May 2025 05:10:25 +0000 (UTC) Received: from bobolink.gentoo.org (localhost [127.0.0.1]) by bobolink.gentoo.org (Postfix) with ESMTP id EC4CC1103BD; Mon, 05 May 2025 05:10:18 +0000 (UTC) Received: from smtp.gentoo.org (dev.gentoo.org [IPv6:2001:470:ea4a:1:5054:ff:fec7:86e4]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by bobolink.gentoo.org (Postfix) with ESMTPS id D97A21103BD for ; Mon, 05 May 2025 05:10:18 +0000 (UTC) Received: from oystercatcher.gentoo.org (oystercatcher.gentoo.org [148.251.78.52]) (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) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 85D67343138 for ; Mon, 05 May 2025 05:10:18 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id DD88D2774 for ; Mon, 05 May 2025 05:10:16 +0000 (UTC) From: "Michał Górny" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Michał Górny" Message-ID: <1746421542.7162eddddc424024d808f45c64c50b90126ec8e1.mgorny@gentoo> Subject: [gentoo-commits] repo/gentoo:master commit in: dev-python/cython/files/, dev-python/cython/ X-VCS-Repository: repo/gentoo X-VCS-Files: dev-python/cython/cython-3.1.0_rc1-r1.ebuild dev-python/cython/files/cython-3.1.0_rc1-rdma-core-hang.patch X-VCS-Directories: dev-python/cython/ dev-python/cython/files/ X-VCS-Committer: mgorny X-VCS-Committer-Name: Michał Górny X-VCS-Revision: 7162eddddc424024d808f45c64c50b90126ec8e1 X-VCS-Branch: master Date: Mon, 05 May 2025 05:10:16 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply X-Archives-Salt: 4bd1049a-280e-44be-a28f-e02ea9b02c39 X-Archives-Hash: 6bf09e3e19628c3dd9e2b5dce9e953b5 commit: 7162eddddc424024d808f45c64c50b90126ec8e1 Author: Michał Górny gentoo org> AuthorDate: Mon May 5 04:25:44 2025 +0000 Commit: Michał Górny gentoo org> CommitDate: Mon May 5 05:05:42 2025 +0000 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=7162eddd dev-python/cython: Backport a fix for rdma-core hang Closes: https://bugs.gentoo.org/955375 Signed-off-by: Michał Górny gentoo.org> dev-python/cython/cython-3.1.0_rc1-r1.ebuild | 86 ++++++++++++++++++++++ .../files/cython-3.1.0_rc1-rdma-core-hang.patch | 54 ++++++++++++++ 2 files changed, 140 insertions(+) diff --git a/dev-python/cython/cython-3.1.0_rc1-r1.ebuild b/dev-python/cython/cython-3.1.0_rc1-r1.ebuild new file mode 100644 index 000000000000..561a1b8a077f --- /dev/null +++ b/dev-python/cython/cython-3.1.0_rc1-r1.ebuild @@ -0,0 +1,86 @@ +# Copyright 1999-2025 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=8 + +DISTUTILS_EXT=1 +DISTUTILS_USE_PEP517=setuptools +PYTHON_TESTED=( python3_{10..12} ) +PYTHON_COMPAT=( "${PYTHON_TESTED[@]}" pypy3 pypy3_11 python3_13{,t} ) +PYTHON_REQ_USE="threads(+)" + +inherit distutils-r1 multiprocessing pypi toolchain-funcs + +DESCRIPTION="A Python to C compiler" +HOMEPAGE=" + https://cython.org/ + https://github.com/cython/cython/ + https://pypi.org/project/Cython/ +" + +LICENSE="Apache-2.0" +SLOT="0" +KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~loong ~m68k ~mips ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86 ~amd64-linux ~x86-linux ~arm64-macos ~ppc-macos ~x64-macos ~x64-solaris" +IUSE="test" +RESTRICT="!test? ( test )" + +BDEPEND=" + ${RDEPEND} + test? ( + $(python_gen_cond_dep ' + +Date: Sun, 4 May 2025 21:48:27 +0200 +Subject: [PATCH] Prevent infinite loop in type inference when a variable is + named like the type of its value (e.g. list += []). + +Closes https://github.com/cython/cython/issues/6835 +--- + Cython/Compiler/ExprNodes.py | 2 +- + tests/run/type_inference.pyx | 24 ++++++++++++++++++++++++ + 2 files changed, 25 insertions(+), 1 deletion(-) + +diff --git a/Cython/Compiler/ExprNodes.py b/Cython/Compiler/ExprNodes.py +index a0413ab8d62..b02154a0b30 100644 +--- a/Cython/Compiler/ExprNodes.py ++++ b/Cython/Compiler/ExprNodes.py +@@ -2042,7 +2042,7 @@ def infer_type(self, env): + return self.inferred_type + return py_object_type + elif (self.entry.type.is_extension_type or self.entry.type.is_builtin_type) and \ +- self.name == self.entry.type.name: ++ not self.is_target and self.name == self.entry.type.name: + # Unfortunately the type attribute of type objects + # is used for the pointer to the type they represent. + return type_type +diff --git a/tests/run/type_inference.pyx b/tests/run/type_inference.pyx +index b746d05d9f3..226455dae0d 100644 +--- a/tests/run/type_inference.pyx ++++ b/tests/run/type_inference.pyx +@@ -883,3 +886,24 @@ def test_builtin_max(): + a = max(self.a, self.a) + assert typeof(a) == "Python object", typeof(a) + C().get_max() ++ ++ ++def variable_with_name_of_type(): ++ """ ++ >>> variable_with_name_of_type() ++ ([], 'abc') ++ """ ++ # Names like 'list.append' refer to the type and must be inferred as such, ++ # but a simple variable called 'list' is not the same and used to break type inference. ++ # See https://github.com/cython/cython/issues/6835 ++ rest_list = [] ++ list = [] # note: same name as type of value ++ list += rest_list ++ assert typeof(list) == 'list object', typeof(list) ++ ++ rest_str = "abc" ++ str = "" ++ str += rest_str ++ assert typeof(str) == 'str object', typeof(str) ++ ++ return list, str