Bug 2325169

Summary: python-msgspec fails to build with Python 3.14: error: ‘_Py_IMMORTAL_REFCNT’ undeclared here
Product: [Fedora] Fedora Reporter: Karolina Surma <ksurma>
Component: python-msgspecAssignee: a.tritas
Status: CLOSED ERRATA QA Contact:
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 42CC: a.tritas, ksurma, mhroncok
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: python-msgspec-0.19.0-2.fc43 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2025-04-24 18:46:09 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: 2322407    

Description Karolina Surma 2024-11-11 11:37:45 UTC
python-msgspec fails to build with Python 3.14.0a1.

  gcc -fno-strict-overflow -Wsign-compare -DDYNAMIC_ANNOTATIONS_ENABLED=1 -DNDEBUG -fexceptions -fcf-protection -fexceptions -fcf-protection -fexceptions -fcf-protection -O3 -O2 -flto=auto -ffat-lto-objects -fexceptions -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-U_FORTIFY_SOURCE,-D_FORTIFY_SOURCE=3 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -march=x86-64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -mtls-dialect=gnu2 -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -fPIC -I/usr/include/python3.14 -c msgspec/_core.c -o build/temp.linux-x86_64-cpython-314/msgspec/_core.o
  msgspec/_core.c:2142:7: error: ‘_Py_IMMORTAL_REFCNT’ undeclared here (not in a function)
   2142 |     { _Py_IMMORTAL_REFCNT },
        |       ^~~~~~~~~~~~~~~~~~~
  error: command '/usr/bin/gcc' failed with exit code 1
  error: subprocess-exited-with-error

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

For the build logs, see:
https://copr-be.cloud.fedoraproject.org/results/@python/python3.14/fedora-rawhide-x86_64/08189210-python-msgspec/

For all our attempts to build python-msgspec with Python 3.14, see:
https://copr.fedorainfracloud.org/coprs/g/python/python3.14/package/python-msgspec/

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.14:
https://copr.fedorainfracloud.org/coprs/g/python/python3.14/

Let us know here if you have any questions.

Python 3.14 is planned to be included in Fedora 43.
To make that update smoother, we're building Fedora packages with all pre-releases of Python 3.14.
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 Miro Hrončok 2025-01-06 19:31:15 UTC
Backporting that PR gives:

+ /usr/bin/pytest
============================= test session starts ==============================
platform linux -- Python 3.14.0a3, pytest-8.3.4, pluggy-1.5.0
rootdir: /builddir/build/BUILD/python-msgspec-0.18.6-build/msgspec-0.18.6
configfile: setup.cfg
collected 5652 items / 3 errors / 2 skipped

==================================== ERRORS ====================================
____________________ ERROR collecting tests/test_struct.py _____________________
tests/test_struct.py:828: in <module>
    FrozenPoint(1, 2),
E   TypeError: Extra positional arguments provided
_____________________ ERROR collecting tests/test_toml.py ______________________
tests/test_toml.py:125: in <module>
    (ExStruct(1, "two"), ExStruct),
E   TypeError: Extra positional arguments provided
_____________________ ERROR collecting tests/test_yaml.py ______________________
tests/test_yaml.py:105: in <module>
    (ExStruct(1, "two"), ExStruct),
E   TypeError: Extra positional arguments provided
=========================== short test summary info ============================
ERROR tests/test_struct.py - TypeError: Extra positional arguments provided
ERROR tests/test_toml.py - TypeError: Extra positional arguments provided
ERROR tests/test_yaml.py - TypeError: Extra positional arguments provided
!!!!!!!!!!!!!!!!!!! Interrupted: 3 errors during collection !!!!!!!!!!!!!!!!!!!!
========================= 2 skipped, 3 errors in 1.16s =========================

Comment 2 Miro Hrončok 2025-01-06 19:32:36 UTC
So does updating to 0.19.0. Perhaps this needs to be reported upstream.

Comment 3 Miro Hrončok 2025-01-06 19:36:40 UTC
Reported as https://github.com/jcrist/msgspec/issues/795

Comment 4 Aoife Moloney 2025-02-26 13:15:37 UTC
This bug appears to have been reported against 'rawhide' during the Fedora Linux 42 development cycle.
Changing version to 42.

Comment 5 Fedora Update System 2025-04-24 15:40:30 UTC
FEDORA-2025-021924116d (python-msgspec-0.19.0-2.fc43) has been submitted as an update to Fedora 43.
https://bodhi.fedoraproject.org/updates/FEDORA-2025-021924116d

Comment 6 Fedora Update System 2025-04-24 18:46:09 UTC
FEDORA-2025-021924116d (python-msgspec-0.19.0-2.fc43) has been pushed to the Fedora 43 stable repository.
If problem still persists, please make note of it in this bug report.