-
Notifications
You must be signed in to change notification settings - Fork 133
Fix build on Python 3.14 by isolating internal C headers and removing inline specifiers #412
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
base: main
Are you sure you want to change the base?
Conversation
Python 3.14 introduces C++ templates in `dynamic_annotations.h` (included via `internal/pycore_interp.h`). This caused compilation errors ("template with C linkage") because these headers were included inside `extern "C"` blocks in `c_trace_callbacks.h`, which is required for Cython/C++ compatibility.
This commit refactors the code to separate the interface from the implementation details:
- Moved internal Python header includes and compatibility macros (for `_PyGC_FINALIZED`, `HAVE_STD_ATOMIC`, etc.) from `c_trace_callbacks.h` to `c_trace_callbacks.c`.
- `c_trace_callbacks.c` is now compiled asFix build on Python 3.14 by isolating internal C headers
Python 3.14 introduces C++ templates in `dynamic_annotations.h` (included via `internal/pycore_interp.h`). This caused compilation errors ("template with C linkage") because these headers were included inside `extern "C"` blocks in `c_trace_callbacks.h`, which is required for Cython/C++ compatibility.
This commit refactors the code to separate the interface from the implementation details:
- Moved internal Python header includes and compatibility macros (for `_PyGC_FINALIZED`, `HAVE_STD_ATOMIC`, etc.) from `c_trace_callbacks.h` to `c_trace_callbacks.c`.
- `c_trace_callbacks.c` is now compiled as
Signed-off-by: Jérôme Benoit <jerome.benoit@piment-noir.org>
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #412 +/- ##
==========================================
+ Coverage 87.56% 90.28% +2.71%
==========================================
Files 18 20 +2
Lines 1641 2080 +439
Branches 348 447 +99
==========================================
+ Hits 1437 1878 +441
- Misses 149 151 +2
+ Partials 55 51 -4 see 4 files with indirect coverage changes Continue to review full report in Codecov by Sentry.
🚀 New features to boost your workflow:
|
|
Failure on 3.14 is unrelated. There's already an open issue tracking it on #411. |
|
@Erotemic: It would be great to have a release with that PR in. Currently |
|
The failing test on main is blocking any release. I'm limited on time, if someone can propose of plan of merges that gets to a passing main brain, I'll make time to review it and push out a release. Otherwise, I'll have to build that plan, and I can't make promises on my schedule there. |
|
Can we maybe merge this nevertheless so that |
Supersedes #408.