GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Python fails to build on WASM: _testcapi/vectorcall_limited.c is built with Py_BUILD_CORE_BUILTIN · Issue #109723 · python/cpython

Python fails to build on WASM: _testcapi/vectorcall_limited.c is built with Py_BUILD_CORE_BUILTIN #109723

New issue
Copy link
New issue
Copy link
Closed
Closed
Python fails to build on WASM: _testcapi/vectorcall_limited.c is built with Py_BUILD_CORE_BUILTIN#109723
Copy link
Labels
buildThe build process and cross-buildThe build process and cross-build

Description

@vstinner
vstinner
opened on Sep 22, 2023
Issue body actions

My PR #109690 broke WASM buildbots.

Example with wasm32-emscripten node (dynamic linking) 3.x: https://buildbot.python.org/all/#/builders/1056/builds/3142

/opt/emsdk/upstream/emscripten/emcc  -DNDEBUG -g -O3 (...) -DPy_BUILD_CORE_BUILTIN -c ../../Modules/_testcapi/vectorcall_limited.c -o Modules/_testcapi/vectorcall_limited.o

In file included from ../../Modules/_testcapi/vectorcall_limited.c:2:
In file included from ../../Modules/_testcapi/parts.h:7:
In file included from ../../Include/Python.h:44:
../../Include/pyport.h:52:4: error: "Py_LIMITED_API is not compatible with Py_BUILD_CORE"
#  error "Py_LIMITED_API is not compatible with Py_BUILD_CORE"
   ^
1 error generated.

I'm not sure how -DPy_BUILD_CORE_BUILTIN landed in the command building Modules/_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 with Py_BUILD_CORE.

On my Linux machine, Makefile contains:

Modules/_testcapi/vectorcall_limited.o: $(srcdir)/Modules/_testcapi/vectorcall_limited.c $(MODULE__TESTCAPI_DEPS) $(MODULE_DEPS_SHARED) $(PYTHON_HEADERS); $(CC) $(MODULE__TESTCAPI_CFLAGS) $(PY_STDMODULE_CFLAGS) $(CCSHARED) -c $(srcdir)/Modules/_testcapi/vectorcall_limited.c -o Modules/_testcapi/vectorcall_limited.o

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:

*static*
_testcapi _testcapimodule.c _testcapi/vectorcall.c _testcapi/vectorcall_limited.c _testcapi/heaptype.c _testcapi/abstract.c _testcapi/unicode.c _testcapi/dict.c _testcapi/getargs.c _testcapi/datetime.c _testcapi/docstring.c _testcapi/mem.c _testcapi/watchers.c _testcapi/long.c _testcapi/float.c _testcapi/structmember.c _testcapi/exceptions.c _testcapi/code.c _testcapi/buffer.c _testcapi/pyatomic.c _testcapi/pyos.c _testcapi/immortal.c _testcapi/heaptype_relative.c _testcapi/gc.c

make fails with:

In file included from ./Include/Python.h:44,
                 from ./Modules/_testcapi/parts.h:7,
                 from ./Modules/_testcapi/vectorcall_limited.c:2:
./Include/pyport.h:52:4: error: #error "Py_LIMITED_API is not compatible with Py_BUILD_CORE"
   52 | #  error "Py_LIMITED_API is not compatible with Py_BUILD_CORE"
      |    ^~~~~
make: *** [Makefile:2982: Modules/_testcapi/vectorcall_limited.o] Error 1
make: *** Waiting for unfinished jobs....
In file included from ./Include/Python.h:44,
                 from ./Modules/_testcapi/parts.h:7,
                 from ./Modules/_testcapi/heaptype_relative.c:2:
./Include/pyport.h:52:4: error: #error "Py_LIMITED_API is not compatible with Py_BUILD_CORE"
   52 | #  error "Py_LIMITED_API is not compatible with Py_BUILD_CORE"
      |    ^~~~~
make: *** [Makefile:3001: Modules/_testcapi/heaptype_relative.o] Error 1

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

  • gh-109723: Disable Py_BUILD_CORE in _testcapi #109727
  • gh-109723: Fix build of _testclinic_limited on WASM #109842

Activity

  1. vstinner
    added
    buildThe build process and cross-buildThe build process and cross-build
    on Sep 22, 2023
  2. vstinner
    added 5 commits that reference this issue on Sep 22, 2023

    pythongh-109723: Disable Py_BUILD_CORE in _testcapi limited C API

    6930e43

    pythongh-109723: Disable Py_BUILD_CORE in _testcapi

    2cd0f0a

    pythongh-109723: Disable Py_BUILD_CORE in _testcapi

    2ce1e72

    pythongh-109723: Disable Py_BUILD_CORE in _testcapi

    225f076

    gh-109723: Disable Py_BUILD_CORE in _testcapi (#109727)

    09a2561
  3. vstinner
    closed this as completedon Sep 25, 2023
  4. vstinner
    added 2 commits that reference this issue on Sep 25, 2023

    pythongh-109723: Fix build of _testclinic_limited on WASM

    51b8b7b

    gh-109723: Fix build of _testclinic_limited on WASM (#109842)

    eeb9070
  5. csm10495
    added 2 commits that reference this issue on Sep 28, 2023

    pythongh-109723: Disable Py_BUILD_CORE in _testcapi (python#109727)

    118a20f

    pythongh-109723: Fix build of _testclinic_limited on WASM (python#109842

    4113684
  6. Glyphack
    added 2 commits that reference this issue on Sep 2, 2024

    pythongh-109723: Disable Py_BUILD_CORE in _testcapi (python#109727)

    1c4058c

    pythongh-109723: Fix build of _testclinic_limited on WASM (python#109842

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    buildThe build process and cross-buildThe build process and cross-build

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

      You are visitor 01402503 — GeezerVison does not store the pages you look up.
      Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.