3
0
Fork 0
mirror of https://github.com/Z3Prover/z3 synced 2026-06-25 10:00:33 +00:00
z3/src/api/python
Copilot fa8c269b27
Fix Pyodide build job failure by restoring wasm side-module linking (#9916)
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>
2026-06-20 18:15:32 -06:00
..
z3 python: make Statistics doctests robust to optional ":time" counter (#9729) 2026-06-06 13:24:19 -07:00
.gitignore Minor tweaks to make things more reliable/less obnoxious 2016-09-14 01:49:37 -07:00
CMakeLists.txt BLD: Add CMake option to build Python bindings without rebuilding libz3 (redux) (#8088) 2026-02-18 20:57:00 -08:00
MANIFEST.in MANIFEST.in will now include pyproject.toml (#5979) 2022-04-15 19:53:16 +02:00
pyproject.toml Fix Pyodide build job failure by restoring wasm side-module linking (#9916) 2026-06-20 18:15:32 -06:00
README.txt fix #2131 2019-02-10 10:07:24 -08:00
setup.py Fix Pyodide build job failure by restoring wasm side-module linking (#9916) 2026-06-20 18:15:32 -06:00
z3test.py fix python for 3.x 2016-09-22 22:24:43 -07:00

On Windows, to build Z3, you should executed the following command
in the Z3 root directory at the Visual Studio Command Prompt

       msbuild /p:configuration=external

If you are using a 64-bit Python interpreter, you should use

       msbuild /p:configuration=external /p:platform=x64


On Linux and macOS, you must install python bindings, before trying example.py.
To install python on Linux and macOS, you should execute the following
command in the Z3 root directory

        sudo make install-z3py