Title: Guard against non-free-threaded extensions in free-threaded builds · Issue #137956 · python/cpython · GitHub
Open Graph Title: Guard against non-free-threaded extensions in free-threaded builds · Issue #137956 · python/cpython
X Title: Guard against non-free-threaded extensions in free-threaded builds · Issue #137956 · python/cpython
Description: Extensions that use the non-free-threaded ABI are incompatible with free-threaded builds (and vice versa). Loading incompatible extenstions is currently prevented by: filename tags including a t, or not build/install tools not installing...
Open Graph Description: Extensions that use the non-free-threaded ABI are incompatible with free-threaded builds (and vice versa). Loading incompatible extenstions is currently prevented by: filename tags including a t, o...
X Description: Extensions that use the non-free-threaded ABI are incompatible with free-threaded builds (and vice versa). Loading incompatible extenstions is currently prevented by: filename tags including a t, o...
Opengraph URL: https://github.com/python/cpython/issues/137956
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Guard against non-free-threaded extensions in free-threaded builds","articleBody":"Extensions that use the non-free-threaded ABI are incompatible with free-threaded builds (and vice versa).\nLoading incompatible extenstions is currently prevented by:\n- filename tags including a `t`, or not\n- build/install tools not installing incompatible extensions in `sys.path`\n\nI'd like to add an extra last layer of defense for cases where these mechanisms fail (as they did in [this report](https://discuss.python.org/t/96443/5)), giving users a clear error message instead of a crash. (Or *just before* a crash, alas.)\n\nIt turns out that static `PyModuleDef` includes bit-pattern(s) in the “GIL-enabled ABI” that cannot not appear in free-threaded `PyModuleDef`'s `ob_flags`. We can detect this and raise an error.\n\nMy implementation reserves a bit in `ob_flags` that needs to stay zero. When the GIL/FT schism is over (or even earlier if needed), the bit can be reused for something else.\n\nThis only goes one way for now: detecting FT extensions loaded in GIL-ful builds is not a priority for me. My motivation is related to stable ABI: if things go wrong, *existing* `abi3` extensions end up installed in the wrong place. (For *new* extensions I plan a better way.)\n\nI'd like to get this in `main` now, even though we don't have the “abi3t” story fully planned, to get as much cross-platform buildbot testing as possible.\nIt should be easy to remove if it's superfluous or doesn't work as expected, or if we need to restructure the internals.\n\n\u003c!-- gh-linked-prs -->\n### Linked PRs\n* gh-137957\n\u003c!-- /gh-linked-prs -->\n","author":{"url":"https://github.com/encukou","@type":"Person","name":"encukou"},"datePublished":"2025-08-19T13:29:57Z","url":"https://github.com/python/cpython/issues/137956"}
| 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:476ed330-9318-8286-87cf-4909691fb86b |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | AF76:3F8AB1:4200C88:53C4BE0:6B020ADD |
| html-safe-nonce | 4c02152c7a1969e70c2d890e745b71df82f4f1398e1f8c92e3bca1a6208e8c1a |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJBRjc2OjNGOEFCMTo0MjAwQzg4OjUzQzRCRTA6NkIwMjBBREQiLCJ2aXNpdG9yX2lkIjoiNTE5NjYwMzMyNjkwODczMDA3NyIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | 195e110aa599ce79ae9c179301a925ff39c6239ed1308f04280e01acf9576f8f |
| hovercard-subject-tag | issue:3334402593 |
| 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/137956/issue_layout |
| twitter:image | https://opengraph.githubassets.com/f15082f1c9b6f54bb0838728dc0a87f682f3b79a695dbde8df181e632adbd838/python/cpython/issues/137956 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/f15082f1c9b6f54bb0838728dc0a87f682f3b79a695dbde8df181e632adbd838/python/cpython/issues/137956 |
| og:image:alt | Extensions that use the non-free-threaded ABI are incompatible with free-threaded builds (and vice versa). Loading incompatible extenstions is currently prevented by: filename tags including a t, o... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | encukou |
| 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