3
0
Fork 0
mirror of https://github.com/Z3Prover/z3 synced 2026-06-19 15:16:29 +00:00
z3/.github
Alcides Fonseca 78818f9ae1 python: build a PyPI-publishable Pyodide (PEP 783) wheel
z3 already builds under Pyodide, but via `pyodide build` the resulting
wheel is tagged `emscripten_<pyodide-version>_wasm32` and only usable as a
CI artifact. PEP 783 introduced the portable `pyemscripten_<date>_wasm32`
tag that PyPI accepts and micropip can install at runtime. This makes z3
produce that wheel via `cibuildwheel --platform pyodide`.

Changes:

* setup.py: for the emscripten target, use the wheel platform tag that
  pyodide-build supplies verbatim via _PYTHON_HOST_PLATFORM (e.g.
  `pyemscripten_2026_0_wasm32`) instead of reconstructing an
  `emscripten_*` tag, falling back to the old behaviour when that env var
  is absent.

* setup.py / CMakeLists.txt / pyproject.toml: switch the Pyodide build
  from JS-based exceptions (`-fexceptions`, `-sDISABLE_EXCEPTION_CATCHING=0`)
  to native wasm exception handling (`-fwasm-exceptions
  -sSUPPORT_LONGJMP=wasm`), matching the ABI of the Pyodide 314 /
  emscripten 5 main module. With the old flags libz3.so imports `invoke_*`
  trampolines the runtime no longer provides, so the wheel builds but the
  first Z3 call fails at runtime with
  "Dynamic linking error: cannot resolve symbol invoke_vi".

* pyproject.toml: add [tool.cibuildwheel] / [tool.pyodide.build] config so
  `cibuildwheel --platform pyodide` builds and tests the wheel.

* add .github/workflows/pyodide-pypi.yml building the wheel with
  cibuildwheel and publishing it to PyPI (trusted publishing) on tags. The
  existing pyodide.yml artifact build is left unchanged.

Verified with cibuildwheel 4.1.0 / pyodide-build 0.35.0 / emscripten 5.0.3:
the resulting z3_solver-4.17.0.0-py3-none-pyemscripten_2026_0_wasm32.whl
passes z3test.py in the Pyodide runtime and solves SMT problems both under
node and in a browser via micropip.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-17 12:36:27 +01:00
..
actions Fix coverage report generation with merge-mode-functions=separate 2025-09-16 16:03:11 +00:00
agents include skills 2026-06-07 14:18:21 -07:00
aw Regenerate agentic workflow locks to fix AWF install failures (#9496) 2026-05-10 21:48:54 -04:00
prompts gitignore 2025-03-12 17:18:37 -07:00
scripts fix memory-safety-report to download artifacts via MCP tools (#8979) 2026-03-15 10:12:49 -07:00
skills gh aw init 2026-06-11 14:27:37 -07:00
workflows python: build a PyPI-publishable Pyodide (PEP 783) wheel 2026-06-17 12:36:27 +01:00
CI_MIGRATION.md Fix workflow compilation errors and relocate documentation files (#8295) 2026-01-22 21:05:05 -08:00
CI_TESTING.md Fix workflow compilation errors and relocate documentation files (#8295) 2026-01-22 21:05:05 -08:00
copilot-instructions.md Add .github/copilot-instructions.md with comprehensive Z3 development guide (#7766) 2025-08-12 15:18:52 -07:00
dependabot.yml Add smtlib-benchmark-finder agentic workflow (#9629) 2026-05-26 15:28:11 -07:00
mcp.json include skills 2026-06-07 14:18:21 -07:00