Title: PEP 803: `Py_GIL_DISABLED` is tested prior to setting, in `patchlevel.h` · Issue #148267 · python/cpython · GitHub
Open Graph Title: PEP 803: `Py_GIL_DISABLED` is tested prior to setting, in `patchlevel.h` · Issue #148267 · python/cpython
X Title: PEP 803: `Py_GIL_DISABLED` is tested prior to setting, in `patchlevel.h` · Issue #148267 · python/cpython
Description: Bug report Bug description: I've been trying the PEP 803 changes in 3.15.0a8 with Meson, and I've hit the following build failure: $ cc -I/usr/include/python3.15t -DPy_LIMITED_API=0x030f0000 limited.c In file included from /usr/include/p...
Open Graph Description: Bug report Bug description: I've been trying the PEP 803 changes in 3.15.0a8 with Meson, and I've hit the following build failure: $ cc -I/usr/include/python3.15t -DPy_LIMITED_API=0x030f0000 limite...
X Description: Bug report Bug description: I've been trying the PEP 803 changes in 3.15.0a8 with Meson, and I've hit the following build failure: $ cc -I/usr/include/python3.15t -DPy_LIMITED_API=0x030f000...
Opengraph URL: https://github.com/python/cpython/issues/148267
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"PEP 803: `Py_GIL_DISABLED` is tested prior to setting, in `patchlevel.h`","articleBody":"# Bug report\n\n### Bug description:\n\nI've been trying the PEP 803 changes in 3.15.0a8 with Meson, and I've hit the following build failure:\n\n```\n$ cc -I/usr/include/python3.15t -DPy_LIMITED_API=0x030f0000 limited.c \nIn file included from /usr/include/python3.15t/Python.h:79,\n from limited.c:1:\n/usr/include/python3.15t/object.h:162:5: error: unknown type name ‘PyMutex’\n 162 | PyMutex ob_mutex; // per-object lock\n | ^~~~~~~\n/usr/include/python3.15t/object.h: In function ‘_Py_SET_SIZE_impl’:\n/usr/include/python3.15t/object.h:258:5: error: implicit declaration of function ‘_Py_atomic_store_ssize_relaxed’ [-Wimplicit-function-declaration]\n 258 | _Py_atomic_store_ssize_relaxed(&ob->ob_size, size);\n | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\nIn file included from /usr/include/python3.15t/Python.h:80:\n/usr/include/python3.15t/refcount.h: In function ‘_Py_IsImmortal’:\n/usr/include/python3.15t/refcount.h:129:13: error: implicit declaration of function ‘_Py_atomic_load_uint32_relaxed’ [-Wimplicit-function-declaration]\n 129 | return (_Py_atomic_load_uint32_relaxed(&op->ob_ref_local) ==\n | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n```\n\nPer the description, setting `Py_LIMITED_API=0x030f0000` when building with 3.15t should be sufficient to trigger abi3t build. However, the logic resides in `patchlevel.h`:\n\nhttps://github.com/python/cpython/blob/eab7dbda3b7502f0a952901a80fb5e628ccd7a28/Include/patchlevel.h#L76-L79\n\nwhich is included before `pyconfig.h`:\n\nhttps://github.com/python/cpython/blob/eab7dbda3b7502f0a952901a80fb5e628ccd7a28/Include/Python.h#L13-L14\n\nwhere `Py_GIL_DISABLED` is declared. As a result, the condition isn't true unless the user explicitly passes `-DPy_GIL_DISABLED=1`.\n\nCC @encukou @ngoldbaum \n\n### CPython versions tested on:\n\n3.15, CPython main branch\n\n### Operating systems tested on:\n\nLinux","author":{"url":"https://github.com/mgorny","@type":"Person","name":"mgorny"},"datePublished":"2026-04-08T18:30:12Z","url":"https://github.com/python/cpython/issues/148267"}
| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322 |
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:1a988365-de07-f556-7d8b-177ca609f9c1 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | 834C:1F2B:158236A:1C9FFCD:6B020869 |
| html-safe-nonce | f4a235ae8f39077e7ef34618bab555dbdb843883192046365ce8c5f3707ca9d5 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI4MzRDOjFGMkI6MTU4MjM2QToxQzlGRkNEOjZCMDIwODY5IiwidmlzaXRvcl9pZCI6IjQ4ODg0ODM0MzM5NTA2MTE1NjIiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | 4d85d8f5086fdf04855ba4b2d49307c8ffa16b3d2bc17437d82296c95e3e9ca6 |
| hovercard-subject-tag | issue:4226749457 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/python/cpython/148267/issue_layout |
| twitter:image | https://opengraph.githubassets.com/a7b97731bea3c8d36058700b13cc2599d2da37cb10b700f5d37256574e9811d5/python/cpython/issues/148267 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/a7b97731bea3c8d36058700b13cc2599d2da37cb10b700f5d37256574e9811d5/python/cpython/issues/148267 |
| og:image:alt | Bug report Bug description: I've been trying the PEP 803 changes in 3.15.0a8 with Meson, and I've hit the following build failure: $ cc -I/usr/include/python3.15t -DPy_LIMITED_API=0x030f0000 limite... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | mgorny |
| hostname | github.com |
| expected-hostname | github.com |
| None | 87e774ee7c6b3bee0490394e4d3e57ec9dbc956f74b87ea685dc8996c1676456 |
| turbo-cache-control | no-preview |
| go-import | github.com/python/cpython git https://github.com/python/cpython.git |
| octolytics-dimension-user_id | 1525981 |
| octolytics-dimension-user_login | python |
| octolytics-dimension-repository_id | 81598961 |
| octolytics-dimension-repository_nwo | python/cpython |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 81598961 |
| octolytics-dimension-repository_network_root_nwo | python/cpython |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 423dbb54c5e7bfecc838eb387c1435eb3d0e760d |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
Viewport: width=device-width