GeezerVisonThe World Wide Web, restored to 800 pixels of glory. | ||||||||||||||||||||||||||||||||||||
| Home|About|Gaming cabinet|Archives|How it works|Starter sites | ||||||||||||||||||||||||||||||||||||
GeezerVison is showing github.com — gh-146636: Improve ABI/feature selection, add new header for it by encukou · Pull Request #148302 · python/cpython Conversation
Member
Feature/ABI selection headers (Py_BUILD_CORE, Py_LIMITED_API, Py_GIL_DISABLED) need to be defined early (so they affect all definitions), but after the version ( Add a test that Python headers themselves don't use Py_GIL_DISABLED, since abi3 and abi3t ought to be identical except for the _Py_OPAQUE_PYOBJECT differences. This should fix gh-148267, but I'm attaching the PR to the abi3t issue, gh-146636, as it continues that effort (GH-148142 specifically).
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page. All reactions…ABLED Add a test that Python headers themselves don't use Py_GIL_DISABLED in abi3t: abi3 and abi3t ought to be the same except the _Py_OPAQUE_PYOBJECT differences. This is done using the GCC-only poison pragma.
encukou
requested review from
a team,
AA-Turner,
emmatyping and
erlend-aasland
as code owners
8 of 9 tasks
vstinner
reviewed
Uh oh!
There was an error while loading. Please reload this page.
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. You may move
Suggested change
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page. All reactions
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This subtle style detail is intentional: I'm inviting
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page. All reactionsUh oh!
There was an error while loading. Please reload this page.
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It's surprising that _PyEXPORTS_CORE and _PyEXPORTS_CORE_MODULE are defined even if Py_LIMITED_API is defined. I tried to undefine Py_BUILD_CORE if Py_LIMITED_API is defined before _PyEXPORTS_CORE code, but I got linker errors on Windows. Examples:
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page. All reactions
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes; these select whether (This is currently done by including
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page. All reactionsCo-authored-by: Victor Stinner <[email protected]>
All reactions
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page.
|
There was an error while loading. Please reload this page.
|
I ran into an issue similar to gh-148267 while working on CFFI (see https://github.com/python-cffi/cffi/actions/runs/24516133542/job/71660551119?pr=232) and was curious if this PR fixes it. It doesn't. The compiler error I see on this branch is: I think this is happening because my CFFI branch was using |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
Looking again, maybe it's because CFFI's headers define Py_LIMITED_API but don't set a value: |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
test_cext.test_build_abi3t() failed. All of these buildbot workers use I suppose that the issue can be reproduced with Example on "buildbot/AMD64 FreeBSD PR": I can reproduce the issue on Fedora with Clang on this short program: #define Py_TARGET_ABI3T 0x30f00a8 #pragma GCC poison Py_GIL_DISABLED #ifdef Py_TARGET_ABI3T # define _Py_OPAQUE_PYOBJECT #endif int main() { #ifdef _Py_OPAQUE_PYOBJECT // All good return 0; #elif defined(Py_GIL_DISABLED) // Not good return 1; #endif return 0; } Clang output: The workaround is to write: #ifdef _Py_OPAQUE_PYOBJECT // All good return 0; #else # if defined(Py_GIL_DISABLED) // Not good return 1; # endif #endif
test.test_io.test_fileio failed: waiting for #148648 fix. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
Oh, maybe we can set the #if Py_LIMITED_API+0 < 3 # warning "Py_LIMITED_API macro value must be at least 3" # undef Py_LIMITED_API # define Py_LIMITED_API 3 #endif |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
|
@mgorny and I were also looking at the stable-abi-testing repo and got into a situation where "weird" things happen if you define |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
🤖 New build scheduled with the buildbot fleet by @encukou for commit 72b1637 🤖 Results will be shown at: https://buildbot.python.org/all/#/grid?branch=refs%2Fpull%2F148302%2Fmerge If you want to schedule another build, you need to add the 🔨 test-with-buildbots label again. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
RHEL8 changes are unrelated. (I'll remove them from the I'm planning to merge this PR soon, and base Windows changes & further tests on it. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
…pythonGH-148302) Improve ABI/feature selection, add new header for it. Add a test that Python headers themselves don't use Py_GIL_DISABLED in abi3t: abi3 and abi3t ought to be the same except the _Py_OPAQUE_PYOBJECT differences. This is done using the GCC-only poison pragma. Co-authored-by: Victor Stinner <[email protected]>
There was an error while loading. Please reload this page.
Successfully merging this pull request may close these issues.
PEP 803:Py_GIL_DISABLED is tested prior to setting, in patchlevel.h
There was an error while loading. Please reload this page.