Skip to content

Conversation

@kumaraditya303
Copy link
Contributor

@kumaraditya303 kumaraditya303 commented Oct 25, 2025

Copy link
Member

@ZeroIntensity ZeroIntensity left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The core change looks good. Mostly nitpicks from me.

Copy link
Member

@ZeroIntensity ZeroIntensity left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@kumaraditya303 kumaraditya303 merged commit ef4665f into python:main Oct 25, 2025
48 of 49 checks passed
@kumaraditya303 kumaraditya303 deleted the interp-tls branch October 25, 2025 14:26
_Py_EnsureTstateNotNULL(tstate);
#endif
return tstate->interp;
#if !defined(Py_BUILD_CORE_MODULE)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should this be

#if defined(HAVE_THREAD_LOCAL) && !defined(Py_BUILD_CORE_MODULE)

instead?

When testing the current main against mypyc, I'm seeing a new error message

In file included from /.../mypy/mypyc/lib-rt/misc_ops.c:1137:
In file included from /.../cpython/Include/internal/pycore_object.h:12:
In file included from /.../cpython/Include/internal/pycore_gc.h:12:
/.../cpython/Include/internal/pycore_pystate.h:213:12: error: use of undeclared identifier '_Py_tss_interp'
    return _Py_tss_interp;
           ^
1 error generated.

Mypyc does use some of the internal headers. In particular

#define Py_BUILD_CORE
...
#include "internal/pycore_object.h"

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess it is because mypyc doesn't define HAVE_THREAD_LOCAL which is defined when python is built, does #140623 fixes it for you?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we should just remove the check for HAVE_THREAD_LOCAL on line 92.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess it is because mypyc doesn't define HAVE_THREAD_LOCAL which is defined when python is built, does #140623 fixes it for you?

Yes, that works.

I think we should just remove the check for HAVE_THREAD_LOCAL on line 92.

Guess, this would work too.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants