From 3c2526a2c319a3dcff1667cd5ea0d14bf2678e67 Mon Sep 17 00:00:00 2001 From: Copilot <198982749+Copilot@users.noreply.github.com> Date: Sat, 20 Jun 2026 12:14:29 -0600 Subject: [PATCH] Fix Pyodide workflow exception flag mismatch (#9909) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The Pyodide `build` job was passing legacy Emscripten exception flags that conflict with the wasm-exception ABI now used by the Python packaging configuration. This caused the wheel build to fail before compilation completed. - **Align Pyodide workflow flags** - Remove per-workflow `CFLAGS` / `CXXFLAGS` / `LDFLAGS` overrides from the Pyodide build step. - Let the build inherit the canonical wasm-exception / longjmp / bigint flags from `src/api/python/pyproject.toml`. - **Apply the fix consistently** - Update the standalone Pyodide workflow. - Update the matching Pyodide build steps in `nightly.yml` and `release.yml` to avoid the same regression in scheduled and release builds. - **Why this fixes the failure** - The broken path mixed JS-exception and wasm-exception settings: ```yaml CFLAGS: "-fexceptions -s DISABLE_EXCEPTION_CATCHING=0 -g2" CXXFLAGS: "-fexceptions -s DISABLE_EXCEPTION_CATCHING=0" ``` - The updated workflows now invoke: ```yaml ~/env/bin/pyodide build --exports whole_archive ``` and rely on the packaging config’s wasm-exception settings instead. --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> --- .github/workflows/nightly.yml | 9 ++++----- .github/workflows/pyodide.yml | 10 ++++------ .github/workflows/release.yml | 9 ++++----- 3 files changed, 12 insertions(+), 16 deletions(-) diff --git a/.github/workflows/nightly.yml b/.github/workflows/nightly.yml index 52463f6e1..a9c6a0751 100644 --- a/.github/workflows/nightly.yml +++ b/.github/workflows/nightly.yml @@ -512,11 +512,10 @@ jobs: run: | source ~/emsdk/emsdk_env.sh cd src/api/python - CFLAGS="${CFLAGS}" LDFLAGS="${LDFLAGS}" CXXFLAGS="${CXXFLAGS}" ~/env/bin/pyodide build --exports whole_archive - env: - CFLAGS: "-fexceptions -s DISABLE_EXCEPTION_CATCHING=0 -g2" - LDFLAGS: "-fexceptions -s WASM_BIGINT" - CXXFLAGS: "-fexceptions -s DISABLE_EXCEPTION_CATCHING=0" + # Exception/longjmp/bigint flags are declared in pyproject.toml and + # combined with Pyodide's -fwasm-exceptions defaults. Passing the + # legacy JS-EH -fexceptions flags here conflicts with the wasm-EH ABI. + ~/env/bin/pyodide build --exports whole_archive - name: Setup env-pyodide run: | diff --git a/.github/workflows/pyodide.yml b/.github/workflows/pyodide.yml index 16f54f824..4f785f1ca 100644 --- a/.github/workflows/pyodide.yml +++ b/.github/workflows/pyodide.yml @@ -42,11 +42,10 @@ jobs: run: | source ~/emsdk/emsdk_env.sh cd src/api/python - CFLAGS="${CFLAGS}" LDFLAGS="${LDFLAGS}" CXXFLAG="${CXXFLAGS}" ~/env/bin/pyodide build --exports whole_archive - env: - CFLAGS: "-fexceptions -s DISABLE_EXCEPTION_CATCHING=0 -g2" - LDFLAGS: "-fexceptions -s WASM_BIGINT" - CXXFLAGS: "-fexceptions -s DISABLE_EXCEPTION_CATCHING=0" + # Exception/longjmp/bigint flags are declared in pyproject.toml and + # combined with Pyodide's -fwasm-exceptions defaults. Passing the + # legacy JS-EH -fexceptions flags here conflicts with the wasm-EH ABI. + ~/env/bin/pyodide build --exports whole_archive - name: Setup env-pyodide run: | @@ -65,4 +64,3 @@ jobs: name: pyodide-wheel path: src/api/python/dist/*.whl retention-days: 1 - diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index f92f7a2d5..147e150c4 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -522,11 +522,10 @@ jobs: run: | source ~/emsdk/emsdk_env.sh cd src/api/python - CFLAGS="${CFLAGS}" LDFLAGS="${LDFLAGS}" CXXFLAGS="${CXXFLAGS}" ~/env/bin/pyodide build --exports whole_archive - env: - CFLAGS: "-fexceptions -s DISABLE_EXCEPTION_CATCHING=0 -g2" - LDFLAGS: "-fexceptions -s WASM_BIGINT" - CXXFLAGS: "-fexceptions -s DISABLE_EXCEPTION_CATCHING=0" + # Exception/longjmp/bigint flags are declared in pyproject.toml and + # combined with Pyodide's -fwasm-exceptions defaults. Passing the + # legacy JS-EH -fexceptions flags here conflicts with the wasm-EH ABI. + ~/env/bin/pyodide build --exports whole_archive - name: Setup env-pyodide run: |