这是indexloc提供的服务,不要输入任何密码
Skip to content

pypy3: bump to 7.3.17 #21297

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jul 27, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 7 additions & 4 deletions packages/pypy3/0005-fix-unavailable-functions.patch
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@

--- a/rpython/rlib/rvmprof/cintf.py
+++ b/rpython/rlib/rvmprof/cintf.py
@@ -16,14 +16,14 @@
@@ -18,16 +18,16 @@
class VMProfPlatformUnsupported(Exception):
pass

Expand All @@ -165,19 +165,22 @@
-if sys.platform in ('darwin', 'linux', 'linux2') or sys.platform.startswith('freebsd'):
- try:
- proc = detect_cpu.autodetect()
- IS_SUPPORTED = proc.startswith('x86') or proc == 'aarch64'
- IS_SUPPORTED = (proc.startswith('x86')
- or proc == 'aarch64'
- or proc == 'riscv64')
- except detect_cpu.ProcessorAutodetectError:
- print("PROCESSOR NOT DETECTED, SKIPPING VMPROF")
+# if sys.platform in ('darwin', 'linux', 'linux2') or sys.platform.startswith('freebsd'):
+# try:
+# proc = detect_cpu.autodetect()
+# IS_SUPPORTED = proc.startswith('x86') or proc == 'aarch64'
+# IS_SUPPORTED = (proc.startswith('x86')
+# or proc == 'aarch64'
+# or proc == 'riscv64')
+# except detect_cpu.ProcessorAutodetectError:
+# print("PROCESSOR NOT DETECTED, SKIPPING VMPROF")

ROOT = py.path.local(rpythonroot).join('rpython', 'rlib', 'rvmprof')
SRC = ROOT.join('src')

--- a/pypy/module/posix/moduledef.py
+++ b/pypy/module/posix/moduledef.py
@@ -140,12 +140,12 @@
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
--- a/lib_pypy/_posixshmem_build.py
+++ b/lib_pypy/_posixshmem_build.py
@@ -12,15 +12,75 @@
""")

SOURCE = """
-#include <sys/mman.h>
-#include <sys/stat.h> /* For mode constants */
-#include <fcntl.h> /* For O_* constants */
+#include <alloca.h>
+#include <fcntl.h>
+#include <stdlib.h>
+#include <string.h>
+#include <unistd.h>
+static int shm_unlink(const char *name) {
+ size_t namelen;
+ char *fname;
+
+ /* Construct the filename. */
+ while (name[0] == '/') ++name;
+
+ if (name[0] == '\0') {
+ /* The name "/" is not supported. */
+ errno = EINVAL;
+ return -1;
+ }
+
+ namelen = strlen(name);
+ fname = (char *) alloca(sizeof("@TERMUX_PREFIX@/tmp/") - 1 + namelen + 1);
+ memcpy(fname, "@TERMUX_PREFIX@/tmp/", sizeof("@TERMUX_PREFIX@/tmp/") - 1);
+ memcpy(fname + sizeof("@TERMUX_PREFIX@/tmp/") - 1, name, namelen + 1);
+
+ return unlink(fname);
+}
+
+static int shm_open(const char *name, int oflag, mode_t mode) {
+ size_t namelen;
+ char *fname;
+ int fd;
+
+ /* Construct the filename. */
+ while (name[0] == '/') ++name;
+
+ if (name[0] == '\0') {
+ /* The name "/" is not supported. */
+ errno = EINVAL;
+ return -1;
+ }
+
+ namelen = strlen(name);
+ fname = (char *) alloca(sizeof("@TERMUX_PREFIX@/tmp/") - 1 + namelen + 1);
+ memcpy(fname, "@TERMUX_PREFIX@/tmp/", sizeof("@TERMUX_PREFIX@/tmp/") - 1);
+ memcpy(fname + sizeof("@TERMUX_PREFIX@/tmp/") - 1, name, namelen + 1);
+
+ fd = open(fname, oflag, mode);
+ if (fd != -1) {
+ /* We got a descriptor. Now set the FD_CLOEXEC bit. */
+ int flags = fcntl(fd, F_GETFD, 0);
+ flags |= FD_CLOEXEC;
+ flags = fcntl(fd, F_SETFD, flags);
+
+ if (flags == -1) {
+ /* Something went wrong. We cannot return the descriptor. */
+ int save_errno = errno;
+ close(fd);
+ fd = -1;
+ errno = save_errno;
+ }
+ }
+
+ return fd;
+}
"""

if sys.platform == 'darwin':
libraries = []
else:
- libraries=['rt']
+ libraries=['c']
_ffi.set_source("_posixshmem_cffi", SOURCE, libraries=libraries)


This file was deleted.

This file was deleted.

11 changes: 11 additions & 0 deletions packages/pypy3/0010-do-not-try-to-get-L2-cache-on-Android.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
--- a/rpython/memory/gc/env.py
+++ b/rpython/memory/gc/env.py
@@ -140,7 +140,7 @@
return get_L2cache_linux2_cpuinfo(label='L2 cache')
#if arch == 's390x': untested
# return get_L2cache_linux2_cpuinfo_s390x()
- if arch in ('ia64', 'aarch64'):
+ if arch in ('ia64'):
return get_L2cache_linux2_system_cpu_index()
if arch in ('parisc', 'parisc64'):
return get_L2cache_linux2_cpuinfo(label='D-cache')
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
--- a/lib_pypy/_sqlite3_build.py
+++ b/lib_pypy/_sqlite3_build.py
@@ -248,6 +248,7 @@

def _has_load_extension():
"""Only available since 3.3.6"""
+ return @SQLITE_HAS_LOAD_EXTENSION@
unverified_ffi = _FFI()
unverified_ffi.cdef("""
typedef ... sqlite3;
@@ -264,6 +265,7 @@

def _has_backup():
"""Only available since 3.6.11"""
+ return @SQLITE_HAS_BACKUP@
unverified_ffi = _FFI()
unverified_ffi.cdef("""
typedef ... sqlite3;
@@ -280,6 +282,7 @@
return hasattr(unverified_lib, 'sqlite3_backup_init')

def _get_version():
+ return @SQLITE_VERSION_NUMBER@
unverified_ffi = _FFI()
unverified_ffi.cdef("""
int sqlite3_libversion_number(void);
33 changes: 20 additions & 13 deletions packages/pypy3/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,32 @@ TERMUX_PKG_HOMEPAGE=https://pypy.org
TERMUX_PKG_DESCRIPTION="A fast, compliant alternative implementation of Python 3"
TERMUX_PKG_LICENSE="MIT"
TERMUX_PKG_MAINTAINER="@licy183"
_MAJOR_VERSION=3.9
TERMUX_PKG_VERSION=7.3.15
TERMUX_PKG_REVISION=4
_MAJOR_VERSION=3.10
TERMUX_PKG_VERSION=7.3.17
TERMUX_PKG_SRCURL=https://downloads.python.org/pypy/pypy$_MAJOR_VERSION-v$TERMUX_PKG_VERSION-src.tar.bz2
TERMUX_PKG_SHA256=6bb9537d85aa7ad13c0aad2e41ff7fd55080bc9b4d1361b8f502df51db816e18
TERMUX_PKG_SHA256=6ad74bc578e9c6d3a8a1c51503313058e3c58c35df86f7485453c4be6ab24bf7
TERMUX_PKG_DEPENDS="gdbm, libandroid-posix-semaphore, libandroid-support, libbz2, libcrypt, libexpat, libffi, liblzma, libsqlite, ncurses, ncurses-ui-libs, openssl, zlib"
TERMUX_PKG_BUILD_DEPENDS="aosp-libs, coreutils, clang, make, pkg-config, python2, tk, xorgproto"
TERMUX_PKG_RECOMMENDS="clang, make, pkg-config"
TERMUX_PKG_SUGGESTS="pypy3-tkinter"
TERMUX_PKG_BUILD_IN_SRC=true
TERMUX_PKG_ON_DEVICE_BUILD_NOT_SUPPORTED=true

termux_step_post_get_source() {
local p="$TERMUX_PKG_BUILDER_DIR/9998-link-against-pypy3-on-testcapi.diff"
local sqlite_version=$(. $TERMUX_SCRIPTDIR/packages/libsqlite/build.sh; echo $TERMUX_PKG_VERSION)
local sqlite_version_X=$(cut -d"." -f1 <<< "$sqlite_version")
local sqlite_version_Y=$(cut -d"." -f2 <<< "$sqlite_version")
local sqlite_version_Z=$(cut -d"." -f3 <<< "$sqlite_version")
local SQLITE_VERSION_NUMBER=$(bc <<< "($sqlite_version_X) * 1000000 + ($sqlite_version_Y) * 1000 + ($sqlite_version_Z)")
local p="$TERMUX_PKG_BUILDER_DIR/9997-do-not-cffi-dlopen-when-compiling-sqlite3.diff"
echo "Applying $(basename "${p}")"
sed \
's|@SQLITE_HAS_LOAD_EXTENSION@|True|g
s|@SQLITE_HAS_BACKUP@|True|g
s|@SQLITE_VERSION_NUMBER@|'"${SQLITE_VERSION_NUMBER}"'|g' \
"${p}" | patch --silent -p1

p="$TERMUX_PKG_BUILDER_DIR/9998-link-against-pypy3-on-testcapi.diff"
echo "Applying $(basename "${p}")"
sed 's|@TERMUX_PYPY_MAJOR_VERSION@|'"${_MAJOR_VERSION}"'|g' "${p}" \
| patch --silent -p1
Expand All @@ -29,12 +42,6 @@ termux_step_post_get_source() {
"$TERMUX_PKG_SRCDIR"/rpython/translator/platform/termux.py
}

termux_step_pre_configure() {
if $TERMUX_ON_DEVICE_BUILD; then
termux_error_exit "Package '$TERMUX_PKG_NAME' is not safe for on-device builds."
fi
}

__setup_proot() {
mkdir -p "$TERMUX_PKG_CACHEDIR"/proot-bin
termux_download \
Expand Down Expand Up @@ -297,7 +304,7 @@ termux_step_make() {
--archive-name=pypy$_MAJOR_VERSION-v$TERMUX_PKG_VERSION \
--targetdir=$TERMUX_PKG_SRCDIR \
--no-embedded-dependencies \
--no-keep-debug || bash
--no-keep-debug

rm -f "$TERMUX_PREFIX"/lib/libpypy$_MAJOR_VERSION-c.so
}
Expand All @@ -315,7 +322,7 @@ termux_step_create_debscripts() {
cat <<- PRERM_EOF > ./prerm
#!$TERMUX_PREFIX/bin/sh

if [ "$TERMUX_PACKAGE_FORMAT" != "pacman" ] && [ "\$1" != "remove" ]; then
if [ "$TERMUX_PACKAGE_FORMAT" = "debian" ] && [ "\$1" != "remove" ]; then
exit 0
fi

Expand Down