GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — gh-91325: Skip Stable ABI checks with Py_TRACE_REFS special build by encukou · Pull Request #92046 · python/cpython

gh-91325: Skip Stable ABI checks with Py_TRACE_REFS special build #92046

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.

Sign up for GitHub

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

Merged
encukou merged 2 commits into python:main from encukou:stable-abi-trace-refs
Jan 29, 2024

Uh oh!

There was an error while loading. Please reload this page.

Merged

gh-91325: Skip Stable ABI checks with Py_TRACE_REFS special build #92046

Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
2 commits
Select commit Hold shift + click to select a range
0fa4e68
Skip Stable ABI checks with Py_TRACE_REFS special build
encukou Apr 29, 2022
1adabea
Merge branch 'main' of github.com:python/cpython into stable-abi-trac…
encukou Jan 16, 2024
File filter
Filter by extension

Clear filters
Conversations
Failed to load comments.
Loading

Uh oh!

There was an error while loading. Please reload this page.

Jump to
Jump to file
Failed to load files.
Loading

Uh oh!

There was an error while loading. Please reload this page.

Diff view
Diff view

There are no files selected for viewing

36 changes: 25 additions & 11 deletions 36 Lib/test/test_stable_abi_ctypes.py
Show comments
View file
Open in desktop

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Oops, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

4 changes: 4 additions & 0 deletions 4 Misc/stable_abi.toml
Show comments
View file
Open in desktop
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,10 @@
[feature_macro.Py_REF_DEBUG]
doc = 'when Python is compiled in debug mode (with Py_REF_DEBUG)'
windows = 'maybe'
[feature_macro.Py_TRACE_REFS]
# nb. This mode is not compatible with Stable ABI/Limited API.
doc = 'when Python is compiled with Py_TRACE_REFS'
windows = 'maybe'


# Mentioned in PEP 384:
Expand Down
9 changes: 9 additions & 0 deletions 9 Modules/_testcapi_feature_macros.inc
Show comments
View file
Open in desktop
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,15 @@ if (res) {
Py_DECREF(result); return NULL;
}

#ifdef Py_TRACE_REFS
res = PyDict_SetItemString(result, "Py_TRACE_REFS", Py_True);
#else
res = PyDict_SetItemString(result, "Py_TRACE_REFS", Py_False);
#endif
if (res) {
Py_DECREF(result); return NULL;
}

#ifdef USE_STACKCHECK
res = PyDict_SetItemString(result, "USE_STACKCHECK", Py_True);
#else
Expand Down
19 changes: 10 additions & 9 deletions 19 Tools/scripts/stable_abi.py
Show comments
View file
Open in desktop
Original file line number Diff line number Diff line change
Expand Up @@ -277,6 +277,13 @@ def gen_ctypes_test(manifest, args, outfile):
from _testcapi import get_feature_macros

feature_macros = get_feature_macros()

# Stable ABI is incompatible with Py_TRACE_REFS builds due to PyObject
# layout differences.
# See https://github.com/python/cpython/issues/88299#issuecomment-1113366226
if feature_macros['Py_TRACE_REFS']:
raise unittest.SkipTest("incompatible with Py_TRACE_REFS.")

ctypes_test = import_module('ctypes')

class TestStableABIAvailability(unittest.TestCase):
Expand Down Expand Up @@ -307,16 +314,11 @@ def test_windows_feature_macros(self):
{'function', 'data'},
include_abi_only=True,
)
optional_items = {}
feature_macros = list(manifest.select({'feature_macro'}))
optional_items = {m.name: [] for m in feature_macros}
for item in items:
if item.name in (
# Some symbols aren't exported on all platforms.
# This is a bug: https://bugs.python.org/issue44133
'PyModule_Create2', 'PyModule_FromDefAndSpec2',
):
continue
if item.ifdef:
optional_items.setdefault(item.ifdef, []).append(item.name)
optional_items[item.ifdef].append(item.name)
else:
write(f' "{item.name}",')
write(")")
Expand All @@ -327,7 +329,6 @@ def test_windows_feature_macros(self):
write(f" {name!r},")
write(" )")
write("")
feature_macros = list(manifest.select({'feature_macro'}))
feature_names = sorted(m.name for m in feature_macros)
write(f"EXPECTED_FEATURE_MACROS = set({pprint.pformat(feature_names)})")

Expand Down
Add this suggestion to a batch that can be applied as a single commit. This suggestion is invalid because no changes were made to the code. Suggestions cannot be applied while the pull request is closed. Suggestions cannot be applied while viewing a subset of changes. Only one suggestion per line can be applied in a batch. Add this suggestion to a batch that can be applied as a single commit. Applying suggestions on deleted lines is not supported. You must change the existing code in this line in order to create a valid suggestion. Outdated suggestions cannot be applied. This suggestion has been applied or marked resolved. Suggestions cannot be applied from pending reviews. Suggestions cannot be applied on multi-line comments. Suggestions cannot be applied while the pull request is queued to merge. Suggestion cannot be applied right now. Please check back later.
You are visitor 01402520 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.