https://github.com/python/cpython/commit/fe78c1e749169946b43e93e0c605369cadb0c8f1
commit: fe78c1e749169946b43e93e0c605369cadb0c8f1
branch: main
author: Pablo Galindo Salgado <[email protected]>
committer: hugovk <[email protected]>
date: 2026-01-12T17:37:43+02:00
summary:

gh-143253: Add libabigail suppression file for internal types (#143254)

Co-authored-by: Petr Viktorin <[email protected]>

files:
A Misc/libabigail.abignore
M .github/CODEOWNERS
M Makefile.pre.in

diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS
index 4789cd2c59e6cb..79091e2d4f2f4f 100644
--- a/.github/CODEOWNERS
+++ b/.github/CODEOWNERS
@@ -143,6 +143,9 @@ Misc/externals.spdx.json      @sethmlarson
 Misc/sbom.spdx.json           @sethmlarson
 Tools/build/generate_sbom.py  @sethmlarson
 
+# ABI check
+Misc/libabigail.abignore      @encukou
+
 
 # ----------------------------------------------------------------------------
 # Platform Support
diff --git a/Makefile.pre.in b/Makefile.pre.in
index a6beb96d12a3f2..0b5aef5ee7e671 100644
--- a/Makefile.pre.in
+++ b/Makefile.pre.in
@@ -1883,7 +1883,7 @@ regen-abidump: all
 
 .PHONY: check-abidump
 check-abidump: all
-       abidiff $(srcdir)/Doc/data/python$(LDVERSION).abi 
"libpython$(LDVERSION).so" --drop-private-types --no-architecture 
--no-added-syms
+       abidiff $(srcdir)/Doc/data/python$(LDVERSION).abi 
"libpython$(LDVERSION).so" --drop-private-types --no-architecture 
--no-added-syms --suppressions $(srcdir)/Misc/libabigail.abignore
 
 .PHONY: regen-limited-abi
 regen-limited-abi: all
diff --git a/Misc/libabigail.abignore b/Misc/libabigail.abignore
new file mode 100644
index 00000000000000..369813021faa3d
--- /dev/null
+++ b/Misc/libabigail.abignore
@@ -0,0 +1,25 @@
+# libabigail suppression file for CPython ABI checks
+#
+# Suppress types defined directly in internal headers (pycore_*.h)
+# Regex matches filenames NOT starting with "pycore_", so pycore_* types are 
suppressed.
+[suppress_type]
+  source_location_not_regexp = 
^([^p]|p[^y]|py[^c]|pyc[^o]|pyco[^r]|pycor[^e]|pycore[^_])
+  accessed_through = pointer
+
+# Suppress public typedefs that alias internal structs.
+# These are public names but their underlying struct layout is internal.
+[suppress_type]
+  name = PyInterpreterState
+  accessed_through = pointer
+
+[suppress_type]
+  name = _PyRuntimeState
+  accessed_through = pointer
+
+[suppress_type]
+  name = PyThreadState
+  accessed_through = pointer
+
+[suppress_variable]
+  name = _PyRuntime
+  type_name = _PyRuntimeState

_______________________________________________
Python-checkins mailing list -- [email protected]
To unsubscribe send an email to [email protected]
https://mail.python.org/mailman3//lists/python-checkins.python.org
Member address: [email protected]

Reply via email to