Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Compiling Modules/_testexternalinspection.c failing due to PTHREADS_KEYS_MAX not being defined #116226

Closed
brettcannon opened this issue Mar 1, 2024 · 3 comments
Labels
build The build process and cross-build OS-wasi type-bug An unexpected behavior, bug, or error

Comments

@brettcannon
Copy link
Member

brettcannon commented Mar 1, 2024

Bug report

Bug description:

On my local machine, I'm getting this compile error:

In file included from ../../Modules/_testexternalinspection.c:47:
In file included from ../../Include/internal/pycore_runtime.h:12:
In file included from ../../Include/internal/pycore_ceval_state.h:12:
In file included from ../../Include/internal/pycore_gil.h:11:
In file included from ../../Include/internal/pycore_condvar.h:8:
../../Include/internal/pycore_pythread.h:76:46: error: use of undeclared identifier 'PTHREAD_KEYS_MAX'
        struct py_stub_tls_entry tls_entries[PTHREAD_KEYS_MAX];
                                             ^
In file included from ../../Modules/_testexternalinspection.c:47:
In file included from ../../Include/internal/pycore_runtime.h:12:
In file included from ../../Include/internal/pycore_ceval_state.h:12:
../../Include/internal/pycore_gil.h:14:4: error: You need either a POSIX-compatible or a Windows system!
#  error You need either a POSIX-compatible or a Windows system!
   ^
../../Include/internal/pycore_gil.h:36:5: error: unknown type name 'PyCOND_T'
    PyCOND_T cond;
    ^
../../Include/internal/pycore_gil.h:37:5: error: unknown type name 'PyMUTEX_T'
    PyMUTEX_T mutex;
    ^
../../Include/internal/pycore_gil.h:41:5: error: unknown type name 'PyCOND_T'
    PyCOND_T switch_cond;
    ^
../../Include/internal/pycore_gil.h:42:5: error: unknown type name 'PyMUTEX_T'
    PyMUTEX_T switch_mutex;

CPython versions tested on:

CPython main branch

Operating systems tested on:

Other

Linked PRs

@brettcannon brettcannon added type-bug An unexpected behavior, bug, or error build The build process and cross-build OS-wasi labels Mar 1, 2024
@brettcannon
Copy link
Member Author

/cc @pablogsal in case he knows what's going on.

@brettcannon
Copy link
Member Author

I went ahead and manually included pthread_stubs.h and that seemed to resolve the issue.

@pablogsal
Copy link
Member

Thanks for taking care of this @brettcannon ❤️

woodruffw pushed a commit to woodruffw-forks/cpython that referenced this issue Mar 4, 2024
adorilson pushed a commit to adorilson/cpython that referenced this issue Mar 25, 2024
diegorusso pushed a commit to diegorusso/cpython that referenced this issue Apr 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
build The build process and cross-build OS-wasi type-bug An unexpected behavior, bug, or error
Projects
None yet
Development

No branches or pull requests

2 participants