-
Notifications
You must be signed in to change notification settings - Fork 801
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
cross-compiling to wasm32-wasi #1522
Comments
Hi @cymqqqq can you please share your demo code? |
ok, here is my demo code:
}) |
just copy the code from https://pyo3.rs/main/python_from_rust.html |
@cymqqqq so what's going on here is that you're trying to cross-compile to the wasm target. To do this successfully you must direct PyO3 to the lib directory of a wasm Python build, so that PyO3 can read its information to configure the build. However I am unsure whether building a wasm Python extension is possible. There is some prior discussion at #1221 . The bug |
pyo3 v0.13.2
OK. thanks for answering:-) |
We also have some small fixes in #1605 that at least makes it work to cross-compile pyo3 to WASI for our case (given that you have already cross-compiled Python itself). |
As we now sort of support If anyone with knowledge of how to build a Python interpreter for wasm wants to contribute a full CI job, that would be cool! |
🐛 Bug Reports
When reporting a bug, please provide the following information. If this is not a bug report you can just discard this template.
🌍 Environment
rustc --version
):version = "0.x.y"
withgit = "https://github.com/PyO3/pyo3")?
:💥 Reproducing
Please provide a minimal working example. This means both the Rust code and the Python.
Please also write what exact flags are required to reproduce your results.
ubuntu 20.04
py3.7
install python by apt. Did you use a virtualenv? No.
rust version 1.42
pyo3 version 0.13.2
yes, tried
git = "https://github.com/PyO3/pyo3" when I build my demo code, an error comes: error: failed to run custom build command for
pyo3 v0.13.2`Caused by:
process didn't exit successfully:
/home/azureuser/rustpy/target/release/build/pyo3-c4d90697e291dc3a/build-script-build
(exit code: 1)--- stderr
Error: NotPresent
warning: build failed, waiting for other jobs to finish...
error: build failed
Error: Compiling your crate to WebAssembly failed
Caused by: failed to execute
cargo build
: exited with exit code: 101full command: "cargo" "build" "--all-targets" "--release" "--target" "wasm32-wasi"
The text was updated successfully, but these errors were encountered: