Commit 9c1783d
chore(native): declare PyContextVar_* locally for limited-API builds
pyo3-ffi gates its entire `context` module behind `not(Py_LIMITED_API)`
(pyo3-ffi 0.28.3 `src/lib.rs` lines 436 and 503), so `ffi::PyContextVar_New`,
`ffi::PyContextVar_Get` and `ffi::PyContextVar_Set` disappear whenever the
extension is built against the stable ABI. On CPython 3.15 that happens via
`PYO3_USE_ABI3_FORWARD_COMPATIBILITY=1`, since pyo3-build-config 0.28.3 caps
`ABI3_MAX_MINOR` at 14. The build then fails with three E0425 "cannot find
function ... in module `ffi`" errors on this file.
Declare the three stable C API entry points locally so the module compiles in
both configurations. Context variables date to Python 3.7, so the symbols are
present on every interpreter ddtrace supports; verified to compile clean on
3.9, 3.13 and 3.15 with and without the stable-ABI path.
Same class of fix as #18429, which closed the sibling `PyFrame_GetBack` gap for
the crashtracker.
Extracted from fc09033 on #19833, which
bundled it with three unrelated formatting fixes. The code is unchanged from
that commit; only the explanatory comment above the declarations was reworded.
Co-authored-by: Vlad Scherbich <vlad.scherbich@datadoghq.com>1 parent f668305 commit 9c1783d
1 file changed
Lines changed: 21 additions & 6 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
5 | 22 | | |
6 | 23 | | |
7 | 24 | | |
| |||
13 | 30 | | |
14 | 31 | | |
15 | 32 | | |
16 | | - | |
17 | | - | |
18 | | - | |
| 33 | + | |
19 | 34 | | |
20 | 35 | | |
21 | 36 | | |
| |||
28 | 43 | | |
29 | 44 | | |
30 | 45 | | |
31 | | - | |
| 46 | + | |
32 | 47 | | |
33 | 48 | | |
34 | 49 | | |
| |||
80 | 95 | | |
81 | 96 | | |
82 | 97 | | |
83 | | - | |
| 98 | + | |
84 | 99 | | |
85 | 100 | | |
86 | 101 | | |
| |||
113 | 128 | | |
114 | 129 | | |
115 | 130 | | |
116 | | - | |
| 131 | + | |
117 | 132 | | |
118 | 133 | | |
119 | 134 | | |
| |||
0 commit comments