Bug 2325194

Summary: libnvme fails to build with Python 3.14: /usr/include/python3.14/pyport.h:629:35: error: missing ')' after "__has_attribute"
Product: [Fedora] Fedora Reporter: Karolina Surma <ksurma>
Component: libnvmeAssignee: Tomáš Bžatek <tbzatek>
Status: CLOSED RAWHIDE QA Contact:
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: rawhideCC: ksurma, mhroncok, tbzatek, vstinner
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: libnvme-1.11.1-3.fc43 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2025-03-03 14:34:17 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 14:04:02 UTC
libnvme fails to build with Python 3.14.0a1.

In file included from /usr/include/python3.14/Python.h:63,
                 from libnvme/nvme_wrap.c:203:
/usr/include/python3.14/pyport.h:629:35: error: missing ')' after "__has_attribute"
  629 | #if _Py__has_attribute(fallthrough)
      |                                   ^
/builddir/build/BUILD/libnvme-1.11-build/libnvme-1.11/redhat-linux-build/internal/config.h:62:35: error: missing binary operator before token "("
   62 | #define fallthrough __attribute__((__fallthrough__))
      |                                   ^

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/08195515-libnvme/

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

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 Tomáš Bžatek 2024-11-28 13:03:37 UTC
Uhm, yes please, a patch would be welcome to move forward. I'm kinda overwhelmed by the amount of work at the moment (although still NVMe, different area).

Comment 2 Miro Hrončok 2024-11-29 15:16:16 UTC
libnvme has #define fallthrough, Python 3.14 uses __attribute__((fallthrough)) now https://github.com/python/cpython/commit/12af8ec864225248c3d2916cb142a5e7ee36cbe2

Victor, does this create an incompatibility of the two codebases?

Comment 3 Victor Stinner 2024-12-02 15:38:27 UTC
> Victor, does this create an incompatibility of the two codebases?

Correct. If libnvme defines a "fallthrough" macro, the "#if _Py__has_attribute(fallthrough)" test in Python cannot work.

libnvme should undefine the "fallthrough" macro before including <Python.h>.

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

Comment 5 Tomáš Bžatek 2025-03-03 14:34:17 UTC
Fix available as libnvme-1.11.1-3.fc43
Feel free to reopen in case of any related issues.