3
0
Fork 0
mirror of https://github.com/Z3Prover/z3 synced 2026-06-19 15:16:29 +00:00
z3/.github/workflows
Alcides Fonseca 3bf4d2b53d
python: build a PyPI-publishable Pyodide (PEP 783) wheel (#9891)
## Summary

z3 already builds under Pyodide (there is a `pyodide.yml` workflow and
an
`IS_PYODIDE` path in `setup.py`), but that path uses `pyodide build` and
produces
a wheel tagged `emscripten_<pyodide-version>_wasm32`, which is pinned to
a single
Pyodide release and rejected by PyPI — so today it's only usable as a CI
artifact.

[PEP 783](https://peps.python.org/pep-0783/) introduced the portable
`pyemscripten_<date>_wasm32` platform tag that **PyPI accepts** and
`micropip` can
install at runtime. This makes `z3-solver` build that wheel via
`cibuildwheel --platform pyodide`.

## Changes

- **`setup.py`** — for the emscripten target, use the wheel platform tag
that
  pyodide-build provides verbatim via `_PYTHON_HOST_PLATFORM` (e.g.
`pyemscripten_2026_0_wasm32`) instead of reconstructing an
`emscripten_*` tag.
  Falls back to the previous 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_mk_config` call fails at runtime
with
  `Dynamic linking error: cannot resolve symbol invoke_vi`.
- **`pyproject.toml`** — add `[tool.cibuildwheel]` /
`[tool.pyodide.build]` so
`cibuildwheel --platform pyodide` builds and tests the wheel (`cp314`).
- **`.github/workflows/pyodide-pypi.yml`** (new) — build with
cibuildwheel and
publish to PyPI (trusted publishing) on tags. Existing `pyodide.yml`
unchanged.

## Verification

Built with `cibuildwheel 4.1.0` / `pyodide-build 0.35.0` / `emscripten
5.0.3`,
CPython 3.14 / Pyodide 314:

- Produces `z3_solver-4.17.0.0-py3-none-pyemscripten_2026_0_wasm32.whl`.
- `z3test.py` passes in the Pyodide runtime (node + wasm32).
- Installed via `micropip` and solves SMT problems both under node and
in a
  browser (`sat` with a model, `unsat` for a contradiction).

🤖 Generated with [Claude Code](https://claude.com/claude-code)
🕵️‍♂️ Reviewed by [Alcides Fonseca](https://wiki.alcidesfonseca.com)

Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-18 13:05:03 -06:00
..
shared Upgrade agentic workflows to gh-aw v0.36.0 (#8122) 2026-01-08 11:50:35 -08:00
a3-python.lock.yml Suppress auto-created failure issues for agentic workflows (#9834) 2026-06-11 20:57:43 -07:00
a3-python.md Suppress auto-created failure issues for agentic workflows (#9834) 2026-06-11 20:57:43 -07:00
academic-citation-tracker.lock.yml Suppress auto-created failure issues for agentic workflows (#9834) 2026-06-11 20:57:43 -07:00
academic-citation-tracker.md Suppress auto-created failure issues for agentic workflows (#9834) 2026-06-11 20:57:43 -07:00
agentics-maintenance.yml gh aw init 2026-06-11 14:27:37 -07:00
android-build.yml Bump actions/upload-artifact from 4 to 7 (#9827) 2026-06-11 21:19:49 -07:00
api-coherence-checker.lock.yml Bump actions/checkout from 6.0.2 to 6.0.3 (#9828) 2026-06-11 21:19:13 -07:00
api-coherence-checker.md Suppress auto-created failure issues for agentic workflows (#9834) 2026-06-11 20:57:43 -07:00
build-warning-fixer.lock.yml Suppress auto-created failure issues for agentic workflows (#9834) 2026-06-11 20:57:43 -07:00
build-warning-fixer.md Suppress auto-created failure issues for agentic workflows (#9834) 2026-06-11 20:57:43 -07:00
build-z3-cache.yml Bump actions/checkout from 6.0.2 to 6.0.3 (#9715) 2026-06-04 16:14:05 -07:00
ci.yml Bump actions/checkout from 6.0.2 to 6.0.3 (#9715) 2026-06-04 16:14:05 -07:00
code-conventions-analyzer.lock.yml Suppress auto-created failure issues for agentic workflows (#9834) 2026-06-11 20:57:43 -07:00
code-conventions-analyzer.md Suppress auto-created failure issues for agentic workflows (#9834) 2026-06-11 20:57:43 -07:00
code-simplifier.lock.yml Suppress auto-created failure issues for agentic workflows (#9834) 2026-06-11 20:57:43 -07:00
code-simplifier.md Suppress auto-created failure issues for agentic workflows (#9834) 2026-06-11 20:57:43 -07:00
compare-stats-anomaly-reporter.lock.yml Suppress auto-created failure issues for agentic workflows (#9834) 2026-06-11 20:57:43 -07:00
compare-stats-anomaly-reporter.md Suppress auto-created failure issues for agentic workflows (#9834) 2026-06-11 20:57:43 -07:00
copilot-setup-steps.yml update aw to current version 2026-01-08 18:15:03 +00:00
coverage.yml Bump actions/upload-artifact from 4 to 7 (#9827) 2026-06-11 21:19:49 -07:00
cross-build.yml Bump actions/checkout from 6.0.2 to 6.0.3 (#9715) 2026-06-04 16:14:05 -07:00
csa-analysis.lock.yml Bump actions/checkout from 6.0.2 to 6.0.3 (#9828) 2026-06-11 21:19:13 -07:00
csa-analysis.md Suppress auto-created failure issues for agentic workflows (#9834) 2026-06-11 20:57:43 -07:00
docs.yml Bump actions/upload-artifact from 4 to 7 (#9827) 2026-06-11 21:19:49 -07:00
fstar-master-build.yml Bump actions/upload-artifact from 4 to 7 (#9827) 2026-06-11 21:19:49 -07:00
issue-backlog-processor.lock.yml Suppress auto-created failure issues for agentic workflows (#9834) 2026-06-11 20:57:43 -07:00
issue-backlog-processor.md Suppress auto-created failure issues for agentic workflows (#9834) 2026-06-11 20:57:43 -07:00
mark-prs-ready-for-review.yml Bump actions/github-script from 8.0.0 to 9.0.0 (#9296) 2026-04-19 16:49:03 +02:00
memory-safety-report.lock.yml Bump actions/checkout from 6.0.2 to 6.0.3 (#9828) 2026-06-11 21:19:13 -07:00
memory-safety-report.md Suppress auto-created failure issues for agentic workflows (#9834) 2026-06-11 20:57:43 -07:00
memory-safety.yml Bump actions/upload-artifact from 4 to 7 (#9827) 2026-06-11 21:19:49 -07:00
msvc-static-build-clang-cl.yml Bump actions/checkout from 6.0.2 to 6.0.3 (#9715) 2026-06-04 16:14:05 -07:00
msvc-static-build.yml Bump actions/checkout from 6.0.2 to 6.0.3 (#9715) 2026-06-04 16:14:05 -07:00
nightly-validation.yml ci: validate Microsoft.Z3.dll PE Machine field is AnyCPU in nightly build validation (#9873) 2026-06-16 11:16:19 -06:00
nightly.yml Lcube (#9858) 2026-06-14 16:25:21 -07:00
nuget-build.yml Lcube (#9858) 2026-06-14 16:25:21 -07:00
ocaml.yaml Bump actions/checkout from 6.0.2 to 6.0.3 (#9715) 2026-06-04 16:14:05 -07:00
ostrich-benchmark.lock.yml Bump actions/checkout from 6.0.2 to 6.0.3 (#9828) 2026-06-11 21:19:13 -07:00
ostrich-benchmark.md Suppress auto-created failure issues for agentic workflows (#9834) 2026-06-11 20:57:43 -07:00
pyodide-pypi.yml python: build a PyPI-publishable Pyodide (PEP 783) wheel (#9891) 2026-06-18 13:05:03 -06:00
pyodide.yml Bump actions/checkout from 6.0.2 to 6.0.3 (#9715) 2026-06-04 16:14:05 -07:00
qf-s-benchmark.lock.yml Bump actions/checkout from 6.0.2 to 6.0.3 (#9828) 2026-06-11 21:19:13 -07:00
qf-s-benchmark.md Suppress auto-created failure issues for agentic workflows (#9834) 2026-06-11 20:57:43 -07:00
release-notes-updater.lock.yml Bump actions/checkout from 6.0.2 to 6.0.3 (#9828) 2026-06-11 21:19:13 -07:00
release-notes-updater.md Suppress auto-created failure issues for agentic workflows (#9834) 2026-06-11 20:57:43 -07:00
release.yml Lcube (#9858) 2026-06-14 16:25:21 -07:00
smtlib-benchmark-finder.lock.yml Suppress auto-created failure issues for agentic workflows (#9834) 2026-06-11 20:57:43 -07:00
smtlib-benchmark-finder.md Suppress auto-created failure issues for agentic workflows (#9834) 2026-06-11 20:57:43 -07:00
specbot-crash-analyzer.lock.yml Bump actions/checkout from 6.0.2 to 6.0.3 (#9828) 2026-06-11 21:19:13 -07:00
specbot-crash-analyzer.md Suppress auto-created failure issues for agentic workflows (#9834) 2026-06-11 20:57:43 -07:00
tactic-to-simplifier.lock.yml Bump actions/checkout from 6.0.2 to 6.0.3 (#9828) 2026-06-11 21:19:13 -07:00
tactic-to-simplifier.md Suppress auto-created failure issues for agentic workflows (#9834) 2026-06-11 20:57:43 -07:00
tptp-benchmark.lock.yml Bump actions/checkout from 6.0.2 to 6.0.3 (#9828) 2026-06-11 21:19:13 -07:00
tptp-benchmark.md Suppress auto-created failure issues for agentic workflows (#9834) 2026-06-11 20:57:43 -07:00
wasm-release.yml Bump actions/checkout from 6.0.2 to 6.0.3 (#9715) 2026-06-04 16:14:05 -07:00
wasm.yml Bump actions/checkout from 6.0.2 to 6.0.3 (#9715) 2026-06-04 16:14:05 -07:00
Windows.yml Lcube (#9858) 2026-06-14 16:25:21 -07:00
wip.yml Bump actions/checkout from 6.0.2 to 6.0.3 (#9715) 2026-06-04 16:14:05 -07:00
workflow-suggestion-agent.lock.yml Bump actions/checkout from 6.0.2 to 6.0.3 (#9828) 2026-06-11 21:19:13 -07:00
workflow-suggestion-agent.md Suppress auto-created failure issues for agentic workflows (#9834) 2026-06-11 20:57:43 -07:00
zipt-code-reviewer.lock.yml Bump actions/checkout from 6.0.2 to 6.0.3 (#9828) 2026-06-11 21:19:13 -07:00
zipt-code-reviewer.md Suppress auto-created failure issues for agentic workflows (#9834) 2026-06-11 20:57:43 -07:00