public inbox for git-commits@fedoraproject.org
help / color / mirror / Atom feed
From: Lumir Balhar <lbalhar@redhat.com>
To: git-commits@fedoraproject.org
Subject: [rpms/pypy3.11] f43: Update to 7.3.23 (rhbz#2481414)
Date: Thu, 30 Jul 2026 13:53:20 GMT	[thread overview]
Message-ID: <178541960009.1.13979884169939413332.rpms-pypy3.11-8d5d72562e0b@fedoraproject.org> (raw)

A new commit has been pushed.

Repo   : rpms/pypy3.11
Branch : f43
Commit : 8d5d72562e0b322b7ccb36846588950db3cfae49
Author : Lumir Balhar <lbalhar@redhat.com>
Date   : 2026-07-23T10:29:10+00:00
Stats  : +207/-2 in 5 file(s)
URL    : https://src.fedoraproject.org/rpms/pypy3.11/c/8d5d72562e0b322b7ccb36846588950db3cfae49?branch=f43

Log:
Update to 7.3.23 (rhbz#2481414)

---
diff --git a/.gitignore b/.gitignore
index db91b1a..cb2aad6 100644
--- a/.gitignore
+++ b/.gitignore
@@ -34,3 +34,4 @@
 /pypy3.11-v7.3.20-src.tar.bz2
 /pypy3.11-v7.3.21-src.tar.bz2
 /pypy3.11-v7.3.22-src.tar.bz2
+/pypy3.11-v7.3.23-src.tar.bz2

diff --git a/9e483cf9.patch b/9e483cf9.patch
new file mode 100644
index 0000000..e52e7ee
--- /dev/null
+++ b/9e483cf9.patch
@@ -0,0 +1,162 @@
+From 9e483cf9e16b11aab0c3fe86e3ff93d963b9323b Mon Sep 17 00:00:00 2001
+From: mattip <matti.picus@gmail.com>
+Date: Thu, 9 Jul 2026 15:29:30 +0300
+Subject: [PATCH] lazily load locks to avoid 'seeing a prebuilt rthread.Lock
+ instance' during annotation
+
+---
+ pypy/module/thread/os_lock.py | 81 +++++++++++++++++++++++++----------
+ 1 file changed, 58 insertions(+), 23 deletions(-)
+
+diff --git a/pypy/module/thread/os_lock.py b/pypy/module/thread/os_lock.py
+index bf6295272a4..b474be6d34b 100644
+--- a/pypy/module/thread/os_lock.py
++++ b/pypy/module/thread/os_lock.py
+@@ -63,14 +63,25 @@ def acquire_timed(space, lock, microseconds):
+ class Lock(W_Root):
+     "A wrappable box around an interp-level lock object."
+ 
+-    _immutable_fields_ = ["lock"]
++    # allocated lazily by _get_lock(): a Lock that is only constructed but
++    # never acquired holds no interp-level lock, so it can be created safely
++    # at translation time (e.g. during the frozen importlib bootstrap) without
++    # freezing a prebuilt rthread.Lock.
++    _immutable_fields_ = ["lock?"]
+ 
+     def __init__(self, space):
+         self.space = space
+-        try:
+-            self.lock = rthread.allocate_lock()
+-        except rthread.error:
+-            raise wrap_thread_error(space, "out of resources")
++        self.lock = None
++
++    def _get_lock(self, space):
++        lock = self.lock
++        if lock is None:
++            try:
++                lock = rthread.allocate_lock()
++            except rthread.error:
++                raise wrap_thread_error(space, "out of resources")
++            self.lock = lock
++        return lock
+ 
+     @unwrap_spec(blocking=int, timeout=float)
+     def descr_lock_acquire(self, space, blocking=1, timeout=-1.0):
+@@ -81,22 +92,28 @@ def descr_lock_acquire(self, space, blocking=1, timeout=-1.0):
+ and the return value reflects whether the lock is acquired.
+ The blocking operation is interruptible."""
+         microseconds = parse_acquire_args(space, blocking, timeout)
+-        result = acquire_timed(space, self.lock, microseconds)
++        result = acquire_timed(space, self._get_lock(space), microseconds)
+         return space.newbool(result == RPY_LOCK_ACQUIRED)
+ 
+     def descr_lock_release(self, space):
+         """Release the lock, allowing another thread that is blocked waiting for
+ the lock to acquire the lock.  The lock must be in the locked state,
+ but it needn't be locked by the same thread that unlocks it."""
+-        try:
+-            self.lock.release()
+-        except rthread.error:
+-            raise oefmt(space.w_RuntimeError,
+-                        "cannot release un-acquired lock")
++        lock = self.lock
++        if lock is not None:
++            try:
++                lock.release()
++                return
++            except rthread.error:
++                pass
++        raise oefmt(space.w_RuntimeError, "cannot release un-acquired lock")
+ 
+     def _is_locked(self):
+-        if self.lock.acquire(False):
+-            self.lock.release()
++        lock = self.lock
++        if lock is None:
++            return False
++        if lock.acquire(False):
++            lock.release()
+             return False
+         else:
+             return True
+@@ -181,13 +198,25 @@ def _set_sentinel(space):
+     return lock
+ 
+ class W_RLock(W_Root):
++    # see the comment on Lock: allocate the interp-level lock lazily so an
++    # RLock constructed but never acquired (e.g. a module lock created during
++    # the frozen importlib bootstrap) does not freeze a prebuilt rthread.Lock.
++    _immutable_fields_ = ["lock?"]
++
+     def __init__(self, space):
+         self.rlock_count = 0
+         self.rlock_owner = 0
+-        try:
+-            self.lock = rthread.allocate_lock()
+-        except rthread.error:
+-            raise wrap_thread_error(space, "cannot allocate lock")
++        self.lock = None
++
++    def _get_lock(self, space):
++        lock = self.lock
++        if lock is None:
++            try:
++                lock = rthread.allocate_lock()
++            except rthread.error:
++                raise wrap_thread_error(space, "cannot allocate lock")
++            self.lock = lock
++        return lock
+ 
+     def descr__new__(space, w_subtype):
+         self = space.allocate_instance(W_RLock, w_subtype)
+@@ -227,11 +256,12 @@ def acquire_w(self, space, blocking=True, timeout=-1.0):
+                             "internal lock count overflowed")
+             return space.w_True
+ 
++        lock = self._get_lock(space)
+         r = True
+-        if self.rlock_count > 0 or not self.lock.acquire(False):
++        if self.rlock_count > 0 or not lock.acquire(False):
+             if not blocking:
+                 return space.w_False
+-            r = acquire_timed(space, self.lock, microseconds)
++            r = acquire_timed(space, lock, microseconds)
+             r = (r == RPY_LOCK_ACQUIRED)
+         if r:
+             assert self.rlock_count == 0
+@@ -256,7 +286,9 @@ def release_w(self, space):
+         self.rlock_count -= 1
+         if self.rlock_count == 0:
+             self.rlock_owner = 0
+-            self.lock.release()
++            lock = self.lock
++            assert lock is not None   # held, so allocated
++            lock.release()
+ 
+     def recursion_count(self, space):
+         """_recursion_count() -> int
+@@ -282,9 +314,10 @@ def acquire_restore_w(self, space, w_saved_state):
+         w_count, w_owner = space.unpackiterable(w_saved_state, 2)
+         count = space.int_w(w_count)
+         owner = space.int_w(w_owner)
++        lock = self._get_lock(space)
+         r = True
+-        if not self.lock.acquire(False):
+-            r = self.lock.acquire(True)
++        if not lock.acquire(False):
++            r = lock.acquire(True)
+         if not r:
+             raise wrap_thread_error(space, "could not acquire lock")
+         assert self.rlock_count == 0
+@@ -298,7 +331,9 @@ def release_save_w(self, space):
+                         "cannot release un-acquired lock")
+         count, self.rlock_count = self.rlock_count, 0
+         owner, self.rlock_owner = self.rlock_owner, 0
+-        self.lock.release()
++        lock = self.lock
++        assert lock is not None   # held, so allocated
++        lock.release()
+         return space.newtuple2(space.newint(count), space.newint(owner))
+ 
+     def descr__enter__(self, space):

diff --git a/ea804f98.patch b/ea804f98.patch
new file mode 100644
index 0000000..3c1a7bd
--- /dev/null
+++ b/ea804f98.patch
@@ -0,0 +1,37 @@
+From ea804f98c62993fb4a34588bc27be5f6e29e0599 Mon Sep 17 00:00:00 2001
+From: mattip <matti.picus@gmail.com>
+Date: Fri, 10 Jul 2026 17:19:27 +0300
+Subject: [PATCH] add lock._cleanup_ for annotation
+
+---
+ pypy/module/thread/os_lock.py | 10 ++++++++++
+ 1 file changed, 10 insertions(+)
+
+diff --git a/pypy/module/thread/os_lock.py b/pypy/module/thread/os_lock.py
+index b474be6d34b..d1ac2254e3f 100644
+--- a/pypy/module/thread/os_lock.py
++++ b/pypy/module/thread/os_lock.py
+@@ -73,6 +73,12 @@ def __init__(self, space):
+         self.space = space
+         self.lock = None
+ 
++    def _cleanup_(self):
++        # drop a lock that got allocated during a frozen bootstrap so the
++        # annotator never sees a prebuilt rthread.Lock; _get_lock() re-creates
++        # it lazily at runtime.
++        self.lock = None
++
+     def _get_lock(self, space):
+         lock = self.lock
+         if lock is None:
+@@ -208,6 +214,10 @@ def __init__(self, space):
+         self.rlock_owner = 0
+         self.lock = None
+ 
++    def _cleanup_(self):
++        # see the comment on Lock._cleanup_
++        self.lock = None
++
+     def _get_lock(self, space):
+         lock = self.lock
+         if lock is None:

diff --git a/pypy3.11.spec b/pypy3.11.spec
index b85c40f..9f44217 100644
--- a/pypy3.11.spec
+++ b/pypy3.11.spec
@@ -1,5 +1,5 @@
 %global basever 7.3
-%global micro 22
+%global micro 23
 #global pre ...
 %global pyversion 3.11
 Name:           pypy%{pyversion}
@@ -104,6 +104,11 @@ Patch7: 007-remove-startup-message.patch
 # to be added to privent compilation error.
 # https://fedoraproject.org/wiki/Changes/Replace_glibc_libcrypt_with_libxcrypt
 Patch9: 009-add-libxcrypt-support.patch
+# Fix "seeing a prebuilt rpython.rlib.rthread.Lock instance" during translation
+# caused by 7.3.23's exception table changes exposing Lock objects as prebuilt constants
+# https://github.com/pypy/pypy/issues/5527
+Patch10: https://github.com/pypy/pypy/commit/9e483cf9.patch
+Patch11: https://github.com/pypy/pypy/commit/ea804f98.patch
 
 # Build-time requirements:
 

diff --git a/sources b/sources
index bcc7d18..b6dcd98 100644
--- a/sources
+++ b/sources
@@ -1 +1 @@
-SHA512 (pypy3.11-v7.3.22-src.tar.bz2) = 578273a92723d6ba105a3014acca68c92ab928c46f8f487e8d179c02daa05f76b08278cf27ed5b302e38ffb3d6aea1ce3c0be9a8acf35ad5d2576b2d577b92c9
+SHA512 (pypy3.11-v7.3.23-src.tar.bz2) = 4351cf30227af06ece5d69fe86a17355eadf2dcdbddf8119c04a720a4f9f388c6ae45a3496feb623950fb4a4a9f70c1910502adb325a12b1b0e34a7ba35563c2

                 reply	other threads:[~2026-07-30 13:53 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=178541960009.1.13979884169939413332.rpms-pypy3.11-8d5d72562e0b@fedoraproject.org \
    --to=lbalhar@redhat.com \
    --cc=git-commits@fedoraproject.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox