From fa8c269b2799d678b8a77c26743916dfaac0d8af Mon Sep 17 00:00:00 2001 From: Copilot <198982749+Copilot@users.noreply.github.com> Date: Sat, 20 Jun 2026 18:15:32 -0600 Subject: [PATCH] Fix Pyodide build job failure by restoring wasm side-module linking (#9916) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The `build` job in the Pyodide workflow was failing at wheel smoke-test import time because `libz3.so` was not produced as a proper wasm side module (`need the dylink section to be first`, missing exported symbols). This PR restores the required Pyodide linker mode. - **Root cause** - Recent Pyodide linker flag changes enabled wasm EH/longjmp but omitted `-sSIDE_MODULE=1`, so the generated `libz3.so` was not loadable by Pyodide’s dynamic loader. - **Changes** - **`src/api/python/pyproject.toml`** - Added `-sSIDE_MODULE=1` to `[tool.pyodide.build].ldflags`. - **`src/api/python/setup.py`** - Added `-sSIDE_MODULE=1` to the Pyodide `LDFLAGS` path to keep direct `setup.py`-driven builds aligned with `pyproject.toml` behavior. - **Flag delta (core fix)** ```toml # src/api/python/pyproject.toml [tool.pyodide.build] ldflags = "-fwasm-exceptions -sSUPPORT_LONGJMP=wasm -sWASM_BIGINT -sSIDE_MODULE=1" ``` --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> --- src/api/python/pyproject.toml | 2 +- src/api/python/setup.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/api/python/pyproject.toml b/src/api/python/pyproject.toml index 243a85a94..52c6db594 100644 --- a/src/api/python/pyproject.toml +++ b/src/api/python/pyproject.toml @@ -17,7 +17,7 @@ build-backend = "setuptools.build_meta" [tool.pyodide.build] cflags = "-fwasm-exceptions -sSUPPORT_LONGJMP=wasm" cxxflags = "-fwasm-exceptions -sSUPPORT_LONGJMP=wasm" -ldflags = "-fwasm-exceptions -sSUPPORT_LONGJMP=wasm -sWASM_BIGINT" +ldflags = "-fwasm-exceptions -sSUPPORT_LONGJMP=wasm -sWASM_BIGINT -sSIDE_MODULE=1" # --- cibuildwheel: produce a PyPI-publishable pyemscripten wheel ------------- [tool.cibuildwheel] diff --git a/src/api/python/setup.py b/src/api/python/setup.py index 029b5ea86..b199effd3 100644 --- a/src/api/python/setup.py +++ b/src/api/python/setup.py @@ -51,7 +51,7 @@ if RELEASE_DIR is None: _wasm_eh = " -fwasm-exceptions -sSUPPORT_LONGJMP=wasm" build_env['CFLAGS'] = build_env.get('CFLAGS', '') + _wasm_eh build_env['CXXFLAGS'] = build_env.get('CXXFLAGS', '') + _wasm_eh - build_env['LDFLAGS'] = build_env.get('LDFLAGS', '') + _wasm_eh + " -sWASM_BIGINT" + build_env['LDFLAGS'] = build_env.get('LDFLAGS', '') + _wasm_eh + " -sWASM_BIGINT -sSIDE_MODULE=1" IS_SINGLE_THREADED = True ENABLE_LTO = False # build with pthread doesn't work. The WASM bindings are also single threaded.