Skip to content

[Packaging][Docs] Pyodide builds have incorrect NumPy 2.0 header location and assume pyodide-build to be the same version as Pyodide #45071

@agriyakhetarpal

Description

@agriyakhetarpal

Describe the bug, including details regarding any error messages, version, and platform.

Hi there, we're trying to build PyArrow against NumPy v2 as a part of pyodide/pyodide#4925 and we are targeting an imminent 0.27 release soon after. I've opened this issue to put to light, that:

  • the Pyodide builds are against NumPy 1.X right now, but building against 2.X has a problem because the NumPy headers were moved from numpy/core/include to numpy/_core/include/:

    arrow/python/CMakeLists.txt

    Lines 163 to 177 in b655852

    if($ENV{PYODIDE})
    # These variables are needed for building PyArrow on Emscripten.
    # If they aren't set, CMake cross compiling fails for Python
    # modules (at least under Pyodide it does).
    set(Python3_INCLUDE_DIR $ENV{PYTHONINCLUDE})
    set(Python3_LIBRARY $ENV{CPYTHONLIB})
    set(Python3_NumPy_INCLUDE_DIR $ENV{NUMPY_LIB}/core/include)
    set(Python3_EXECUTABLE)
    set(ENV{_PYTHON_SYSCONFIGDATA_NAME} $ENV{SYSCONFIG_NAME})
    # we set the c and cxx compiler manually to bypass pywasmcross
    # which is pyodide's way of messing with C++ build parameters.
    set(CMAKE_C_COMPILER emcc)
    set(CMAKE_CXX_COMPILER em++)
    endif()

  • the documentation mentions in a few places that the version of pyodide-build must match the Pyodide version – this is no longer the case, since, we have unvendored pyodide-build to a separate repository and now maintain a list of compatible versions against Pyodide.

  • the Pyodide and Emscripten versions are slightly out of date in a few places

I already have a pull request coming for addressing these changes, but since this was also concerning CI/packaging and not just documentation, the Contributing guide suggested that I should open an issue first before opening a pull request.

Thanks for your time!

Component(s)

Python

Metadata

Metadata

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions