Add Pixi workflow to verify Pyodide build works#1449
Add Pixi workflow to verify Pyodide build works#1449IvanIsCoding wants to merge 47 commits intoQiskit:mainfrom
Conversation
Pull Request Test Coverage Report for Build 21499831342Details
💛 - Coveralls |
|
Emscripten 4.0.9 seems to be broken with binaryen, I'll need to investigate. It's a shame because I wanted to bump Pyodide such that we can test with the Pyodide shipped by uv |
|
Looks like uv might support a version compiled |
mtreinish
left a comment
There was a problem hiding this comment.
Sorry this took me so long to follow up on. This looks good to me, it exciting to see a workflow for building pyodide in CI. I just had a couple of questions inline. I wasn't able to get pixi working locally and I'm wondering if something went stale while this was waiting on my review.
| We'll need to align the [Emscripten](https://anaconda.org/conda-forge/emscripten) version from `conda-forge` with one | ||
| of the public releases. Then, we pick a `pyodide-build` version higher than the required build version and the equivalent Python | ||
| version also specified in the cross build environments. Lastly, update `[tool.pixi.tasks.install_xbuildenv]` to install | ||
| the selected version of Pyodide. |
There was a problem hiding this comment.
I assume this is because pixi is pulling emscripten from conda instead of a system installed package? But it was a bit confusing to read this description as conda isn't mentioned before. Maybe we should have a sentence before this explaining where conda is coming into play. Since this is a very different workflow from the normal rustworkx build process it's best to be a bit more explicit about how all these pieces come together.
| At the root of the directory, simply run: | ||
|
|
||
| ```bash | ||
| pixi run build_pyodide |
There was a problem hiding this comment.
When I run this locally I first got an issue about the emcc -v call failing, when I set the env var to skip the version check it errors during the build with:
error: linking with `emcc` failed: exit status: 1
|
= note: "emcc" "-s" "EXPORTED_FUNCTIONS=[\"_PyInit_generators\",\"_PyInit_rustworkx\"]" "<1 object files omitted>" "/home/mtreinish/git/qiskit/retworkx/target/wasm32-unknown-emscripten/release/deps/{libcompiler_builtins-ee68dc841fe2a394.rlib}.rlib" "-B<sysroot>/lib/rustlib/x86_64-unknown-linux-gnu/bin/gcc-ld" "--target=wasm32-unknown-emscripten" "-sDISABLE_EXCEPTION_CATCHING=0" "-o" "/home/mtreinish/git/qiskit/retworkx/target/wasm32-unknown-emscripten/release/deps/rustworkx.wasm" "-O3" "-g0" "-sSIDE_MODULE=2" "-sWASM_BIGINT" "-sSIDE_MODULE=2" "-sWASM_BIGINT" "-sABORTING_MALLOC=0" "-sWASM_BIGINT"
= note: some arguments are omitted. use `--verbose` to show all linker arguments
= note: Traceback (most recent call last):
File "/home/mtreinish/git/qiskit/retworkx/.pixi/envs/default/bin/emcc", line 23, in <module>
from tools.toolchain_profiler import ToolchainProfiler
ModuleNotFoundError: No module named 'tools'
|
|
||
| [tool.pixi.workspace] | ||
| channels = ["conda-forge"] | ||
| platforms = ["linux-64", "osx-arm64"] |
There was a problem hiding this comment.
I thought we weren't supporting pixi on arm64 macos?
Follow up of #1447
This uses pixi to run the Pyodide build. This is still higly experimental. It is related to #1416 and #1420 in the sense that pixi is to conda what uv is to pypi.
The Github Action workflow I created does the following:
RUSTC_BOOTSTRAPtrick to enable nightly features on a compiler. Of course that is terrible, but the version is pinned so essentially it is like using a pinned nightly compilerTests are included in #1450