-
Notifications
You must be signed in to change notification settings - Fork 1.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Build Python distributions targeting wasm #7418
Comments
I tried integrating wasm two years ago over the course of a couple of weeks. Obviously currently, there isn't any python wheel with WASM build. Presumably, this is precisely what pyodide would help with. |
I don't see the branch, but fortunately pyodide does support out-of-tree builds now and I'll try it out when I get some time. |
@rhelmot - I poked at this a bit. pyodide build seems to require something equivalent to |
Hmm... we should be fully compliant with the appropriate standards. The only thing I can think which might be an issue is it might try to copy the subtree rooted at the setup.py file in isolation, which will make it not possible to copy the proper z3 sources. I'll take a look soon. |
Finally got around to this. I was able to build the pyodide wheel with minor modifications to setup.py, but running z3test.py yields the following error:
Do you know what this is about? Should I submit the PR or is this indicative of some sort of big architectural incompatibility with the platform? |
Thanks, I have been busy coding on something else. |
still getting the same error after that commit. Do you want me to add pyodide CI so you can test this yourself? |
Ha, I was just updating this thread essentially asking if you could add a CI so I can fix it on my side? |
I would have to swap context to set up an actual pyodide build locally, so a CI would be much better. Also it could, if appropriate, be part of WASM action at some point. I added several more commits after that one to take care of structs that didn't inherit from std::exception |
I have a preliminary build step for wasm CI on the pyodide-ci branch, but the building seems to run the poor azure pipelines box out of memory during the linking stage. I think if we can turn off LTO it'll work fine, but for something like Z3 that seems important... see https://dev.azure.com/Z3Public/Z3/_build/results?buildId=7659&view=logs&j=2f68f21a-4f23-5f18-1620-f32fb059cc4b&t=70bb1769-113b-52cf-d677-1cc690cb0a72 for build logs |
memory issues have been intermittent before. |
Looks like Azure DevOps is set up to run the pipeline from Master when I select to rerun. |
I think there is a typo in your branch: source ~/emsdk/emsdk_emv -> source ~/emsdk/emsdk_env After changing this, the Github Action fails further down the line. Given that Azure pipelines are overloaded and flaky, I wonder if making progress on the GitHub action version is going to be easier. The current break is:
So python isn't just python. |
hmm, you are bypassing me now. I was going to try pip install pyodide-cli per friendly AI suggestion/hallucination |
Looks like we should follow instructions at this point and file with pyodide devs. https://github.com/Z3Prover/z3/actions/runs/11851278844/job/33027495365 |
I wonder, it could very well be the following: https://emscripten.org/docs/porting/exceptions.html It says to pass a compile flag to enable exceptions. |
Webassembly is now a supported platform for CPython, and can be used via e.g. the Pyodide project to produce in-browser tools. I'd love to get Z3-backed testing working in this demo of hypothesis-crosshair, for example.
Since Z3 already has wasm builds for js, and many Python libraries with native extensions already support wasm (e.g.), I'm confident that this is practical - if also a bit fiddly to set up.
The text was updated successfully, but these errors were encountered: