GeezerVison is showing github.com — gh-140544: fix build for including `pycore_pystate.h` when `HAVE_THREAD_LOCAL` is not defined by kumaraditya303 · Pull Request #140623 · python/cpython
Conversation
kumaraditya303
commented
Oct 26, 2025
•
edited by bedevere-app
Bot
Loading
Uh oh!
There was an error while loading. Please reload this page.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
|
Unfortunately it seems the last change broke it again.
/.../cpython/Include/internal/pycore_pystate.h:93:8: error: unknown type name '_Py_thread_local'
extern _Py_thread_local PyThreadState *_Py_tss_tstate;
/.../cpython/Include/internal/pycore_pystate.h:93:38: error: expected ';' after top level declarator
extern _Py_thread_local PyThreadState *_Py_tss_tstate;
^
;
It looks like _Py_thread_local only works for defined(HAVE_THREAD_LOCAL). So 34a2688 should probably be reverted.
|
# define HAVE_THREAD_LOCAL 1 |
|
# ifdef thread_local |
|
# define _Py_thread_local thread_local |
|
# elif __STDC_VERSION__ >= 201112L && !defined(__STDC_NO_THREADS__) |
|
# define _Py_thread_local _Thread_local |
|
# elif defined(_MSC_VER) /* AKA NT_THREADS */ |
|
# define _Py_thread_local __declspec(thread) |
|
# elif defined(__GNUC__) /* includes clang */ |
|
# define _Py_thread_local __thread |
|
# else |
|
// fall back to the PyThread_tss_*() API, or ignore. |
|
# undef HAVE_THREAD_LOCAL |
|
# endif |
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
|
No, this is all just HAVE_THREAD_LOCAL being messy. We should remove that all throughout the codebase and assume that thread locals are always available. mypyc will get some speedups from using the thread local directly. I'll put up a PR.
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
|
Sounds good. Happy to test it, just let me know.
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
Reviewers
ericsnowcurrently
Awaiting requested review from ericsnowcurrently
ericsnowcurrently is a code owner
+1 more reviewer
cdce8p
cdce8p approved these changes
Reviewers whose approvals may not affect merge requirements
Uh oh!
There was an error while loading. Please reload this page.
Assignees
No one assigned
Milestone
No milestone
Development
Successfully merging this pull request may close these issues.
Uh oh!
There was an error while loading. Please reload this page.
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.
|