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
gh-95991: Add some infrastructure for testing Limited API in _testcapi #95992
gh-95991: Add some infrastructure for testing Limited API in _testcapi #95992
Conversation
…estcapi - Limited API needs to be enabled per source file - Some builds don't support Limited API, so Limited API tests must be skipped on those builds (currently this is `Py_TRACE_REFS`, but that may change.) - `Py_LIMITED_API` must be defined before `<Python.h>` is included. This puts the hoop-jumping in `testcapi/parts.h`, so individual test files can be relatively simple. (Currently that's only `vectorcall_limited.c`, imagine more.)
|
I'm not sure about best practices for |
|
I also plan to add some instructions for the devguide, mentioning the structure for a #define Py_LIMITED_API 0x03...
#include "parts.h"
#ifdef LIMITED_API_AVAILABLE
(all content goes here)
#endifand |
Co-authored-by: Erlend E. Aasland <erlend.aasland@protonmail.com>
|
This happens to move |
|
I don't understand the failure on the Windows buildbot: |
|
@python/windows-team, do you know what's wrong here, by any chance? |
|
It's probably getting built before the limited API DLL ( Add the below to |
|
When Py_TRACE_REFS is defined, it was discussed once to move the double linked list of objects out of PyObject, to keep the ABI compatiiblity. It shouldn't be hard to store it somewhere else. But so far, nobody proposed a concrete implementation of this idea. |
(currently this is
Py_TRACE_REFS, but that may change.)Py_LIMITED_APImust be defined before<Python.h>is included.This puts the hoop-jumping in
testcapi/parts.h, so individualtest files can be relatively simple. (Currently that's only
vectorcall_limited.c, imagine more.)