Skip to content

GH-47329: [Packaging][Python][C++] Build and test PyArrow against Pyodide 314 (2026_0 ABI) - #47330

Open
agriyakhetarpal wants to merge 20 commits into
apache:mainfrom
agriyakhetarpal:feat/pyodide-0.28-builds
Open

GH-47329: [Packaging][Python][C++] Build and test PyArrow against Pyodide 314 (2026_0 ABI)#47330
agriyakhetarpal wants to merge 20 commits into
apache:mainfrom
agriyakhetarpal:feat/pyodide-0.28-builds

Conversation

@agriyakhetarpal

@agriyakhetarpal agriyakhetarpal commented Aug 13, 2025

Copy link
Copy Markdown
Contributor

Rationale for this change

This PR allows PyArrow to be built and tested against the new Pyodide 2026_0 ABI introduced with the Pyodide 314.0.0 release.

Closes #47329

What changes are included in this PR?

This PR updates the Pyodide version in the build scripts to 314.0.0 and the Emscripten version to 5.0.3, along with associated build-time changes to fix compilation issues.

Are these changes tested?

Are there any user-facing changes?

Yes, downstream packagers trying to build a WASM wheel for Pyodide are now required to use newer Pyodide and Emscripten versions, and the latest stable version of pyodide-build.

cc: @hoodmane @ryanking13

@github-actions

Copy link
Copy Markdown

⚠️ GitHub issue #47329 has been automatically assigned in GitHub to PR creator.

@agriyakhetarpal

Copy link
Copy Markdown
Contributor Author

@github-actions crossbow submit test-conda-python-emscripten

@github-actions

Copy link
Copy Markdown
Only contributors can submit requests to this bot. Please ask someone from the community for help with getting the first commit in.
The Archery job run can be found at: https://github.com/apache/arrow/actions/runs/16950058312

@agriyakhetarpal

Copy link
Copy Markdown
Contributor Author

Hello, could the maintainers with the necessary permissions please trigger an Emscripten build on this PR? Thank you!

I thought I could do this, as I previously submitted a PR that was accepted and merged: #45072, so I'm not sure if I understand the bot's message above. Is it that the word "contributors" here actually means those with a commit bit? 🤔

@agriyakhetarpal

Copy link
Copy Markdown
Contributor Author

It looks like the actual error is something else, though, which gets masked by the error message: https://github.com/apache/arrow/actions/runs/16950058312/job/48040535515?pr=47330#step:5:16

fatal: not a git repository (or any of the parent directories): .git

@kou

kou commented Aug 14, 2025

Copy link
Copy Markdown
Member

@github-actions crossbow submit test-conda-python-emscripten

@github-actions

Copy link
Copy Markdown

Revision: 9d4bf5a

Submitted crossbow builds: ursacomputing/crossbow @ actions-e6f3074ad3

Task Status
test-conda-python-emscripten GitHub Actions

@agriyakhetarpal

agriyakhetarpal commented Aug 14, 2025

Copy link
Copy Markdown
Contributor Author

Thanks. We'll need a docker.io/apache/arrow-dev:amd64-conda-python-3.13 image for this, as the required Python version for Pyodide 0.28 builds is 3.13.

@agriyakhetarpal

Copy link
Copy Markdown
Contributor Author

Could you please submit another build? Thanks!

@kou

kou commented Aug 14, 2025

Copy link
Copy Markdown
Member

@github-actions crossbow submit test-conda-python-emscripten

@github-actions

Copy link
Copy Markdown

Revision: 16f90d9

Submitted crossbow builds: ursacomputing/crossbow @ actions-c232acf2ff

Task Status
test-conda-python-emscripten GitHub Actions

@agriyakhetarpal

Copy link
Copy Markdown
Contributor Author

I am trying to find out the correct place to install libatomic1; it's required by the Brotli and Protocol Buffers Emscripten builds. In the meantime; I changed -fexceptions to -fwasm-exceptions in eebb7a8.

@agriyakhetarpal agriyakhetarpal changed the title GH-47329: [Packaging][Python] Build and test PyArrow against the pyodide_2025_0 ABI GH-47329: [Packaging][Python][C++] Build and test PyArrow against the pyodide_2025_0 ABI Aug 14, 2025
@agriyakhetarpal

agriyakhetarpal commented Aug 14, 2025

Copy link
Copy Markdown
Contributor Author

I am trying to find out the correct place to install libatomic1; it's required by the Brotli and Protocol Buffers Emscripten builds.

I added this in af2e18d, but I'm not sure if this is the right approach. Could you please verify this commit, and also submit another build? Thanks!

@kou

kou commented Aug 14, 2025

Copy link
Copy Markdown
Member

@github-actions crossbow submit test-conda-python-emscripten

@kou

kou commented Aug 14, 2025

Copy link
Copy Markdown
Member

FYI: You can use UBUNTU=22.04 archery docker run ubuntu-cpp-emscripten on local.

See https://arrow.apache.org/docs/developers/continuous_integration/archery.html how to setup Archery.

@github-actions

Copy link
Copy Markdown

Revision: af2e18d

Submitted crossbow builds: ursacomputing/crossbow @ actions-5d3d1c591a

Task Status
test-conda-python-emscripten GitHub Actions

@github-actions

Copy link
Copy Markdown

Revision: eae25be

Submitted crossbow builds: ursacomputing/crossbow @ actions-49d30e1fce

Task Status
test-conda-python-emscripten GitHub Actions

@joewalp

joewalp commented Dec 9, 2025

Copy link
Copy Markdown

@agriyakhetarpal Are you still on this PR? If not, perhaps you can propose next steps for whomever may pick up the task?

@agriyakhetarpal

Copy link
Copy Markdown
Contributor Author

Having been pinged by the bot on the corresponding issue I opened (#47329) (and having lost the ping on this PR in my notifications), yes, I'm looking at this now. I'm trying to update to our 2026_0 ABI, which arrived this year, instead of the 2025_0 ABI. This ABI corresponds to our Pyodide 314.0 release. I haven't been hit by the -shared flag issue that I encountered here previously, and I've made some progress on the builds up to the wheel. There are some changes needed for the wheel repair pipeline so that libarrow_python.so has the right RPATH, which I am trying to fix.

A follow-up could be to update the testing infrastructure to use a Pyodide virtual environment via pyodide venv instead of Arrow using its current hand-rolled python/scripts/run_emscripten_tests.py script.

@agriyakhetarpal agriyakhetarpal changed the title GH-47329: [Packaging][Python][C++] Build and test PyArrow against the pyodide_2025_0 ABI GH-47329: [Packaging][Python][C++] Build and test PyArrow against Pyodide 314 (2026_0 ABI) Aug 15, 2026
Comment thread ci/docker/conda-python-emscripten.dockerfile Outdated
Comment thread ci/docker/conda-python-emscripten.dockerfile Outdated
Comment on lines +2186 to +2189
# Explicitly set the C++ standard for the host build. Without this,
# Abseil may be compiled with the host compiler's default standard,
# which can be older than C++17.
"-DCMAKE_CXX_STANDARD=${CMAKE_CXX_STANDARD}"

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I hope this change is fine to keep here; this happened to me because I am using AppleClang 21 on my macOS machine to cross-compile for Emscripten.

The reason is that in the host protoc build, where CMAKE_CXX_FLAGS is blanked and no standard is set, absl compiles as C++14 and uses absl::string_view. That results in an ABI mismatch because Protobuf's targets reference the std::string_view signatures (since Protobuf compiles to C++17 or newer).

(I guess no one has hit this before, since the CI job exercises going from Linux to Emscripten, where gcc defaults to C++17)

@github-actions github-actions Bot added awaiting committer review Awaiting committer review and removed awaiting review Awaiting review labels Aug 15, 2026
Co-authored-by: Agriya Khetarpal <74401230+agriyakhetarpal@users.noreply.github.com>
@agriyakhetarpal

Copy link
Copy Markdown
Contributor Author

Could the maintainers with the necessary permissions please submit a test-conda-python-emscripten build on this PR? I was able to figure out the problem locally; I think this should be ready. Thank you!

@agriyakhetarpal
agriyakhetarpal marked this pull request as ready for review August 15, 2026 16:47
Copilot AI lite review requested due to automatic review settings August 15, 2026 16:47

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Updates Arrow’s Pyodide/Emscripten build + test tooling to target the Pyodide 314 (2026_0) ABI, aligning CI images, build flags, and runtime package setup needed to build/test PyArrow as a Pyodide WASM wheel.

Changes:

  • Bump Pyodide/Emscripten-related versions in CI/container tooling (Pyodide 314.0.4, Python 3.14, Node 24).
  • Adjust Emscripten compile/link flags for the Pyodide 2026_0 ABI (wasm exceptions, longjmp support, $ORIGIN/rpath handling for side modules).
  • Update Emscripten test runner behavior (macOS script invocation differences; ensure packaging is available in the Pyodide runner).

Reviewed changes

Copilot reviewed 8 out of 8 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
python/scripts/run_emscripten_tests.py Updates Node driver invocation for macOS script syntax; ensures extra Pyodide packages are loaded for test runtime.
python/CMakeLists.txt Avoids applying non-Emscripten UNIX RPATH install behavior; defers equivalent handling to Emscripten linker flags.
docs/source/developers/cpp/emscripten.rst Updates the documented EMSDK version/link reference for Pyodide 314.x.
dev/tasks/tasks.yml Moves the emscripten CI task to Python 3.14.
cpp/cmake_modules/ThirdpartyToolchain.cmake Forces host protobuf build to use the configured C++ standard during cross-compiles.
cpp/cmake_modules/SetupCxxFlags.cmake Updates Emscripten flags for the new ABI, including longjmp/exception handling and side-module linker flags.
compose.yaml Updates conda-python-emscripten service args (Pyodide version + minimum Python).
ci/docker/conda-python-emscripten.dockerfile Updates the emscripten CI image defaults (Python/Pyodide/Node) and dependencies required for Pyodide 314.x builds.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread ci/docker/conda-python-emscripten.dockerfile Outdated
Comment thread cpp/cmake_modules/SetupCxxFlags.cmake
Copilot AI review requested due to automatic review settings August 15, 2026 17:00

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 8 out of 8 changed files in this pull request and generated no new comments.

Suppressed comments (1)

cpp/cmake_modules/SetupCxxFlags.cmake:750

  • ARROW_EMSCRIPTEN_DYLIB_CREATE_FLAGS embeds '-Wl,-rpath,$ORIGIN' in single quotes. CMake does not perform shell-style quote parsing, so the quotes are likely passed through as literal characters in the linker argument, which can break linking or produce an incorrect rpath. Use the raw -Wl,-rpath,$ORIGIN argument (no surrounding quotes).
      "-sWASM_BIGINT=1 -fwasm-exceptions -sSUPPORT_LONGJMP=wasm -Wno-error=linkflags")
  set(ARROW_EMSCRIPTEN_DYLIB_CREATE_FLAGS
      "-sSIDE_MODULE=1 ${ARROW_EMSCRIPTEN_LINKER_FLAGS} '-Wl,-rpath,$ORIGIN'")
  set(CMAKE_SHARED_LINKER_FLAGS "${ARROW_EMSCRIPTEN_DYLIB_CREATE_FLAGS}")
  set(CMAKE_MODULE_LINKER_FLAGS "${ARROW_EMSCRIPTEN_DYLIB_CREATE_FLAGS}")

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Packaging][Python] Build and test against Pyodide 314.0 (2026_0 ABI)

7 participants