Skip to content

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

Merged
raulcd merged 27 commits into
apache:mainfrom
agriyakhetarpal:feat/pyodide-0.28-builds
Nov 13, 2026
Merged

raulcd merged 27 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 our 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.7 and the Emscripten version to 5.0.3, along with associated build-time changes to fix compilation issues.

This PR updates the conda-python-emscripten job to Pyodide 314.0.7, Python 3.14, Node 24, and pyodide-build 0.39.2 and later. The Emscripten version for this job is gathered from the Pyodide distribution, which renders it to be 5.0.3. That matches the version the C++ job uses, since #55417.

The build changes are as follows:

  • Emscripten builds now use native WebAssembly exceptions and WebAssembly-based setjmp/longjmp (-fwasm-exceptions -sSUPPORT_LONGJMP=wasm), as our 2026_0 ABI requires.
  • libarrow_python.so and the Cython extension modules are linked with an $ORIGIN RPATH, in order for us to find libarrow_python.so next to the modules that need it.
  • The host Protobuf build is given the C++ standard explicitly, which fixes an Abseil ABI mismatch when linking with AppleClang on my machine.

Are these changes tested?

Yes, these changes are (to be) tested by the test-conda-python-emscripten and test-ubuntu-22.04-cpp-emscripten jobs on Crossbow.

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

@agriyakhetarpal

Copy link
Copy Markdown
Contributor Author

Unfortunately, Archery was not helpful for me, as I am on an M-series macOS machine, and that means Docker runtimes under linux/arm64 emulation are irritably slow. :(

I'll try to get access to a Linux-amd64 machine for this. In the meantime, could you please submit another build? I'd like to try out the libatomic1 addition. The -fwasm-exceptions flag was apparently not needed, so I've reverted it.

@kou

kou commented Aug 14, 2025

Copy link
Copy Markdown
Member

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

@hoodmane

Copy link
Copy Markdown

The -fwasm-exceptions flag was apparently not needed, so I've reverted it.

You sure about this? I think it's definitely wrong to pass -fexceptions....

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.

🔵 Needs a closer look

Human assessment is needed because the change may discard caller-provided linker flags and appears to leave the Node test runner incompatible with the migrated ESM loader.

No open issues 🎉

Review effort: Lite

@tadeja

This comment was marked as outdated.

@github-actions

This comment was marked as outdated.

@github-actions

Copy link
Copy Markdown

Revision: 3c80ba4

Submitted crossbow builds: ursacomputing/crossbow @ actions-457023a373

Task Status
test-conda-python-emscripten GitHub Actions
test-ubuntu-22.04-cpp-emscripten GitHub Actions

@tadeja

tadeja commented Nov 12, 2026

Copy link
Copy Markdown
Member

@github-actions crossbow submit emscripten

@github-actions

Copy link
Copy Markdown

Revision: 3c80ba4

Submitted crossbow builds: ursacomputing/crossbow @ actions-0f15cbd5a3

Task Status
test-conda-python-emscripten GitHub Actions
test-ubuntu-22.04-cpp-emscripten GitHub Actions

@tadeja

tadeja commented Nov 12, 2026

Copy link
Copy Markdown
Member

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

@github-actions

Copy link
Copy Markdown

Revision: 3c80ba4

Submitted crossbow builds: ursacomputing/crossbow @ actions-f18f77b7a1

Task Status
test-conda-python-emscripten GitHub Actions

@tadeja

tadeja commented Nov 12, 2026

Copy link
Copy Markdown
Member

The previous two runs of test-conda-python-emscripten failed just because of a time limit: The job has exceeded the maximum execution time of 1h0m0s
The last run of test-conda-python-emscripten is now passing! https://github.com/ursacomputing/crossbow/actions/runs/43195482865/job/131105226434

Copilot AI lite review requested due to automatic review settings November 12, 2026 12:45

@tadeja tadeja left a comment •

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I've just updated unneeded testing submodule change on this PR (so it no longer moves backward from Nov 5a26d35 to June 9ff285c).
LGTM!

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.

🔵 Needs a closer look

The Pyodide 2026_0 upgrade requires unavailable Crossbow Emscripten and browser/Node validation to confirm WASM exceptions, linker RPATH, ABI, and module-worker runtime behavior.

No open issues 🎉

Review effort: Lite

@tadeja

tadeja commented Nov 12, 2026

Copy link
Copy Markdown
Member

cc @raulcd, @kou for another review

@agriyakhetarpal

Copy link
Copy Markdown
Contributor Author

I've just updated unneeded testing submodule change on this PR (so it no longer moves backward from Nov 5a26d35 to June 9ff285c). LGTM!

Ah, thanks a lot @tadeja! 🙈


I have two follow-ups here:

  • I found a bug on the Pyodide side that I am working to prepare a non-arrow reproducer on, which came from investigating test_read_csv_gil_deadlock, which is that a side module's weak symbols crash when running time.sleep(), when switching stacks with stubs generated from them beneath them.
  • The testing infrastructure here can rely on pyodide venv, which is much simpler. That makes things more developer-friendly; the NodeDriver can be removed entirely, since the interpreter itself uses Node.js. I tested it locally, and we can enable the ORC tests that have been skipped, since we can access the timezone database dir through the venv.

@tadeja

tadeja commented Nov 12, 2026

Copy link
Copy Markdown
Member

Ah!

  • I found a bug on the Pyodide side that I am working to prepare a non-arrow reproducer on, which came from investigating test_read_csv_gil_deadlock, which is that a side module's weak symbols crash when running time.sleep(), when switching stacks with stubs generated from them beneath them.

Does it crash only for a time.sleep() call or can other operations trigger it as well ? Once you have an upstream issue, could you link it here? Perhaps also a short comment for pytest.mark.threading on def test_read_csv_gil_deadlock()

  • The testing infrastructure here can rely on pyodide venv, which is much simpler.

Sounds like the pyodide venv migration can be done separately. Would you like to open a follow-up issue/PR?

@agriyakhetarpal

Copy link
Copy Markdown
Contributor Author

Ah!

  • I found a bug on the Pyodide side that I am working to prepare a non-arrow reproducer on, which came from investigating test_read_csv_gil_deadlock, which is that a side module's weak symbols crash when running time.sleep(), when switching stacks with stubs generated from them beneath them.

Does it crash only for a time.sleep() call or can other operations trigger it as well ? Once you have an upstream issue, could you link it here? Perhaps also a short comment for pytest.mark.threading on def test_read_csv_gil_deadlock()

It can be anything that uses pyodide.ffi.run_sync(), like time.sleep() here, or asyncio.run() or synchronous HTTP with JSPI (which we have enabled). I think Node sockets too. I think it's a bit orthogonal to the test itself, so maybe not worth an inline comment, but I can link it here :) I opened pyodide/pyodide#6551.

  • The testing infrastructure here can rely on pyodide venv, which is much simpler.

Sounds like the pyodide venv migration can be done separately. Would you like to open a follow-up issue/PR?

Oh, yes, I indeed meant a follow-up PR :) I'm on it and will open one once this one is merged!

Copilot AI lite review requested due to automatic review settings November 12, 2026 14:09

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.

🔵 Needs a closer look

The review spans tightly coupled ABI, compiler, linker, and loader changes, and its correctness cannot be established until the Crossbow Pyodide 314 build and both runtime test jobs complete.

No open issues 🎉

Review effort: Lite

@kou kou left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

+1

@raulcd
raulcd merged commit 48e4abf into apache:main Nov 13, 2026
56 of 59 checks passed
@agriyakhetarpal
agriyakhetarpal deleted the feat/pyodide-0.28-builds branch November 13, 2026 12:01
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)

8 participants