-
-
Notifications
You must be signed in to change notification settings - Fork 31.9k
Python fails to build on WASM: _testcapi/vectorcall_limited.c is built with Py_BUILD_CORE_BUILTIN #109723
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
Labels
build
The build process and cross-build
Comments
vstinner
added a commit
to vstinner/cpython
that referenced
this issue
Sep 22, 2023
Undefine Py_BUILD_CORE_BUILTIN and Py_BUILD_CORE_MODULE in Modules/_testcapi/parts.h to make sure that _testcapi does not test the internal C API by mistake. Move code which was only in Modules/_testcapimodule.c before. Moreover, heaptype_relative.c and vectorcall_limited.c use the limited C API which is incompatible with the internal C API. Move test_long_numbits() from _testcapi to _testinternalcapi since it uses the internal C API "pycore_long.h". Fix Modules/_testcapi/pyatomic.c: don't include Python.h directly, just include _testcapi/parts.h.
vstinner
added a commit
to vstinner/cpython
that referenced
this issue
Sep 22, 2023
Make sure that the internal C API is not tested by mistake by _testcapi. Undefine Py_BUILD_CORE_BUILTIN and Py_BUILD_CORE_MODULE macros in Modules/_testcapi/parts.h: move code from _testcapimodule.c. heaptype_relative.c and vectorcall_limited.c are using the limited C API which is incompatible with the internal C API. Move test_long_numbits() from _testcapi to _testinternalcapi since it uses the internal C API "pycore_long.h". Fix Modules/_testcapi/pyatomic.c: don't include Python.h directly, just include _testcapi/parts.h.
vstinner
added a commit
to vstinner/cpython
that referenced
this issue
Sep 22, 2023
Make sure that the internal C API is not tested by mistake by _testcapi. Undefine Py_BUILD_CORE_BUILTIN and Py_BUILD_CORE_MODULE macros in Modules/_testcapi/parts.h: move code from _testcapimodule.c. heaptype_relative.c and vectorcall_limited.c are using the limited C API which is incompatible with the internal C API. Move test_long_numbits() from _testcapi to _testinternalcapi since it uses the internal C API "pycore_long.h". Fix Modules/_testcapi/pyatomic.c: don't include Python.h directly, just include _testcapi/parts.h.
vstinner
added a commit
to vstinner/cpython
that referenced
this issue
Sep 22, 2023
Make sure that the internal C API is not tested by mistake by _testcapi. Undefine Py_BUILD_CORE_BUILTIN and Py_BUILD_CORE_MODULE macros in Modules/_testcapi/parts.h: move code from _testcapimodule.c. heaptype_relative.c and vectorcall_limited.c are using the limited C API which is incompatible with the internal C API. Move test_long_numbits() from _testcapi to _testinternalcapi since it uses the internal C API "pycore_long.h". Fix Modules/_testcapi/pyatomic.c: don't include Python.h directly, just include _testcapi/parts.h.
vstinner
added a commit
that referenced
this issue
Sep 22, 2023
Make sure that the internal C API is not tested by mistake by _testcapi. Undefine Py_BUILD_CORE_BUILTIN and Py_BUILD_CORE_MODULE macros in Modules/_testcapi/parts.h: move code from _testcapimodule.c. heaptype_relative.c and vectorcall_limited.c are using the limited C API which is incompatible with the internal C API. Move test_long_numbits() from _testcapi to _testinternalcapi since it uses the internal C API "pycore_long.h". Fix Modules/_testcapi/pyatomic.c: don't include Python.h directly, just include _testcapi/parts.h. Ajust "make check-c-globals" for these changes.
vstinner
added a commit
to vstinner/cpython
that referenced
this issue
Sep 25, 2023
Make sure that the Py_BUILD_CORE macro is not defined.
vstinner
added a commit
that referenced
this issue
Sep 25, 2023
Make sure that the Py_BUILD_CORE macro is not defined.
csm10495
pushed a commit
to csm10495/cpython
that referenced
this issue
Sep 28, 2023
Make sure that the internal C API is not tested by mistake by _testcapi. Undefine Py_BUILD_CORE_BUILTIN and Py_BUILD_CORE_MODULE macros in Modules/_testcapi/parts.h: move code from _testcapimodule.c. heaptype_relative.c and vectorcall_limited.c are using the limited C API which is incompatible with the internal C API. Move test_long_numbits() from _testcapi to _testinternalcapi since it uses the internal C API "pycore_long.h". Fix Modules/_testcapi/pyatomic.c: don't include Python.h directly, just include _testcapi/parts.h. Ajust "make check-c-globals" for these changes.
Glyphack
pushed a commit
to Glyphack/cpython
that referenced
this issue
Sep 2, 2024
Make sure that the internal C API is not tested by mistake by _testcapi. Undefine Py_BUILD_CORE_BUILTIN and Py_BUILD_CORE_MODULE macros in Modules/_testcapi/parts.h: move code from _testcapimodule.c. heaptype_relative.c and vectorcall_limited.c are using the limited C API which is incompatible with the internal C API. Move test_long_numbits() from _testcapi to _testinternalcapi since it uses the internal C API "pycore_long.h". Fix Modules/_testcapi/pyatomic.c: don't include Python.h directly, just include _testcapi/parts.h. Ajust "make check-c-globals" for these changes.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
My PR #109690 broke WASM buildbots.
Example with wasm32-emscripten node (dynamic linking) 3.x: https://buildbot.python.org/all/#/builders/1056/builds/3142
I'm not sure how
-DPy_BUILD_CORE_BUILTIN
landed in the command buildingModules/_testcapi/vectorcall_limited.c
.I don't think that it's correct that
vectorcall_limited.c
which tests the limited C API on purpose it built withPy_BUILD_CORE
.On my Linux machine, Makefile contains:
So it gets two groups of compiler flags:
MODULE__TESTCAPI_CFLAGS
: not defined (empty)PY_STDMODULE_CFLAGS
:-fno-strict-overflow -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -g -Og -Wall -O0 -std=c11 -Werror=implicit-function-declaration -fvisibility=hidden -I./Include/internal -I. -I./Include
I don't see
-DPy_BUILD_CORE_BUILTIN
here.I can reproduce the issue locally with this custom
Modules/Setup.local
:make fails with:
Modules/makesetup
uses$(PY_STDMODULE_CFLAGS)
if$doconfig
is no, but uses$(PY_BUILTIN_MODULE_CFLAGS)
otherwise. In the second case, $(PY_BUILTIN_MODULE_CFLAGS) adds-DPy_BUILD_CORE_BUILTIN
to compiler command used to build_testcapi
C files.Linked PRs
The text was updated successfully, but these errors were encountered: