Bug 2424565

Summary: pygame fails to build with Python 3.15: error: implicit declaration of function ‘PyWeakref_GetObject’; did you mean ‘PyWeakref_GetRef’
Product: [Fedora] Fedora Reporter: Karolina Surma <ksurma>
Component: pygameAssignee: Jaroslav Škarvada <jskarvad>
Status: CLOSED ERRATA QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: rawhideCC: gwync, jskarvad, ksurma, mhroncok
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: pygame-2.6.1-8.fc44 Doc Type: ---
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2026-01-05 17:02:43 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 2412434    

Description Karolina Surma 2025-12-23 10:58:53 UTC
pygame fails to build with Python 3.15.0a3.

  src_c/surface.c: In function ‘surf_get_locks’:
  src_c/surface.c:1023:15: error: implicit declaration of function ‘PyWeakref_GetObject’; did you mean ‘PyWeakref_GetRef’? [-Wimplicit-function-declaration]
   1023 |         tmp = PyWeakref_GetObject(PyList_GetItem(surf->locklist, i));
        |               ^~~~~~~~~~~~~~~~~~~
        |               PyWeakref_GetRef
  src_c/surface.c:1023:13: error: assignment to ‘PyObject *’ {aka ‘struct _object *’} from ‘int’ makes pointer from integer without a cast [-Wint-conversion]
   1023 |         tmp = PyWeakref_GetObject(PyList_GetItem(surf->locklist, i));
        |             ^
  src_c/surface.c: In function ‘surf_convert_alpha’:
  src_c/surface.c:1677: warning: ignoring ‘#pragma PG_WARN ’ [-Wunknown-pragmas]
   1677 | #pragma PG_WARN("srcsurf doesn't actually do anything?")
  src_c/surface.c: In function ‘_get_buffer_colorplane’:
  src_c/surface.c:3359:51: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
   3359 |                          (int)__LINE__, __FILE__, (void *)mask);
        |                                                   ^
  src_c/surface.c: In function ‘_release_buffer’:
  src_c/surface.c:3446:14: error: assignment to ‘PyObject *’ {aka ‘struct _object *’} from ‘int’ makes pointer from integer without a cast [-Wint-conversion]
   3446 |     consumer = PyWeakref_GetObject(consumer_ref);
        |              ^


https://docs.python.org/3.15/whatsnew/3.15.html

For the build logs, see:
https://copr-be.cloud.fedoraproject.org/results/@python/python3.15/fedora-rawhide-x86_64/09935259-pygame/

For all our attempts to build pygame with Python 3.15, see:
https://copr.fedorainfracloud.org/coprs/g/python/python3.15/package/pygame/

Testing and mass rebuild of packages is happening in copr.
You can follow these instructions to test locally in mock if your package builds with Python 3.15:
https://copr.fedorainfracloud.org/coprs/g/python/python3.15/

Let us know here if you have any questions.

Python 3.15 is planned to be included in Fedora 45.
To make that update smoother, we're building Fedora packages with all pre-releases of Python 3.15.
A build failure prevents us from testing all dependent packages (transitive [Build]Requires),
so if this package is required a lot, it's important for us to get it fixed soon.

We'd appreciate help from the people who know this package best,
but if you don't want to work on this now, let us know so we can try to work around it on our side.

Comment 1 Fedora Update System 2026-01-05 14:50:34 UTC
FEDORA-2026-768f8f3741 (pygame-2.6.1-8.fc44) has been submitted as an update to Fedora 44.
https://bodhi.fedoraproject.org/updates/FEDORA-2026-768f8f3741

Comment 2 Fedora Update System 2026-01-05 17:02:43 UTC
FEDORA-2026-768f8f3741 (pygame-2.6.1-8.fc44) has been pushed to the Fedora 44 stable repository.
If problem still persists, please make note of it in this bug report.