mirror of
https://github.com/Z3Prover/z3
synced 2026-06-22 16:40:29 +00:00
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>
66 lines
1.8 KiB
YAML
66 lines
1.8 KiB
YAML
name: Pyodide Build
|
|
|
|
on:
|
|
schedule:
|
|
- cron: '0 0 */2 * *'
|
|
workflow_dispatch:
|
|
|
|
env:
|
|
BUILD_TYPE: Release
|
|
|
|
permissions:
|
|
contents: read
|
|
|
|
jobs:
|
|
build:
|
|
runs-on: ubuntu-24.04
|
|
|
|
strategy:
|
|
fail-fast: false
|
|
|
|
steps:
|
|
- name: Checkout code
|
|
uses: actions/checkout@v7
|
|
|
|
- name: Setup packages
|
|
run: sudo apt-get update && sudo apt-get install -y python3-dev python3-pip python3-venv
|
|
|
|
- name: Create venv
|
|
run: python3 -m venv ~/env
|
|
|
|
- name: Install pyodide
|
|
run: ~/env/bin/pip install pyodide-build pyodide-cli
|
|
|
|
- name: Configure CMake and build
|
|
run: |
|
|
git clone https://github.com/emscripten-core/emsdk.git ~/emsdk
|
|
cd ~/emsdk && PYODIDE_EMSCRIPTEN_VERSION=$(~/env/bin/pyodide config get emscripten_version)
|
|
./emsdk install ${PYODIDE_EMSCRIPTEN_VERSION}
|
|
./emsdk activate ${PYODIDE_EMSCRIPTEN_VERSION}
|
|
|
|
- name: Build Z3
|
|
run: |
|
|
source ~/emsdk/emsdk_env.sh
|
|
cd src/api/python
|
|
# 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: |
|
|
source ~/env/bin/activate
|
|
source ~/emsdk/emsdk_env.sh
|
|
pyodide venv ~/env-pyodide
|
|
|
|
- name: Setup z3 wheel
|
|
run: |
|
|
~/env-pyodide/bin/pip install src/api/python/dist/*.whl
|
|
~/env-pyodide/bin/python - <src/api/python/z3test.py z3
|
|
|
|
- name: Package wheel
|
|
uses: actions/upload-artifact@master
|
|
with:
|
|
name: pyodide-wheel
|
|
path: src/api/python/dist/*.whl
|
|
retention-days: 1
|