-
Notifications
You must be signed in to change notification settings - Fork 58
Add rustworkx alpha recipe
#90
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
Add rustworkx alpha recipe
#90
Conversation
packages/rustworkx/meta.yaml
Outdated
| url: https://github.com/IvanIsCoding/rustworkx/releases/download/v0.17.0a3/rustworkx-0.17.0a3.tar.gz | ||
| sha256: 8bd0c295134e2b0c03808d4e69428b41153849db6488839084a78793c337f191 | ||
| build: | ||
| script: export RUSTFLAGS="-C target-feature=+atomics,+bulk-memory,+mutable-globals -C link-arg=-s -C link-arg=ALLOW_MEMORY_GROWTH=1 -C link-arg=-s -C link-arg=MODULARIZE=1 -C link-arg=-s -C link-arg=EXPORT_NAME=createModule -C link-arg=-s -C link-arg=EXPORT_ES6=1 -C link-arg=-s -C link-arg=ASSERTIONS=1" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think you should get rid of this RUSTFLAGS setting. It surely won't with this.
| script: export RUSTFLAGS="-C target-feature=+atomics,+bulk-memory,+mutable-globals -C link-arg=-s -C link-arg=ALLOW_MEMORY_GROWTH=1 -C link-arg=-s -C link-arg=MODULARIZE=1 -C link-arg=-s -C link-arg=EXPORT_NAME=createModule -C link-arg=-s -C link-arg=EXPORT_ES6=1 -C link-arg=-s -C link-arg=ASSERTIONS=1" |
If you do need to add something to RUSTFLAGS try to do it like this:
export RUSTFLAGS="$RUSTFLAGS -C <some new flag>"
The stuff that is in there by default is important.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I agree there are too many flags. From https://doc.rust-lang.org/cargo/reference/config.html#buildrustflags I thinl that pyodide build interferes with.cargo/config.toml. I will try to cut the number of flags, many of them were cargo culted (no pun intended). For the rest, I will see if setting RUSTFLAGS="" catches the options from .cargo/config.toml
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The reality is the build just need s"-C", "target-feature=+atomics,+bulk-memory,+mutable-globals" in addition to the default flags. But for pyodide build setting RUSTFLAGS doesn't seem to be additive?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You can do export RUSTFLAGS="$RUSTFLAGS -Ctarget-feature=+atomics,+bulk-memory,+mutable-globals. But bulk-memory and mutable-globals are on by default (at least they should be...). Atomics probably isn't.
Package Build ResultsTotal packages built: 35 Package Build Times (click to expand)
Longest build: openssl (2m 54s) |
Wow that's fancy @ryanking13 |
|
Ok, I reused the For the other target features, I didn't get a very conclusive answer by running |
hoodmane
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me if tests pass.
agriyakhetarpal
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, @IvanIsCoding ! The tests are passing, and I had two comments, this should be good to merge after them. I'm glad you were able to figure out the out-of-tree build, too.
|
Ok, I will be able to add a check on my CI: Qiskit/rustworkx#1450. I think I found a way to make things work with a pinned Pyodide Build 0.30.2, Pyodide 0.27.5, and Emscripten 3.1.58 via https://pixi.sh/. Soon that Pyodide version will be outdated, but I think as long as a build with 0.27.5 keeps passing, the tests in |
|
Sounds good to have a smoke test, but I'm also a little confused about your PRs – why not run the full test suite in the CI using |
|
BTW, the Python interpreter provided by |
|
Another thing I noticed from the pixi setup – while it mentions that it is possible only with with linux-x86-64; I'd like to note that linux-arm64, macos-amd64, and macos-arm64 should all work equally well. We test for macOS in pyodide-build's CI. |
We can move to somewhere as this PR is approved but for the full test suite: I think Why not use And for the Linux part in Pixi: you opened conda-forge/emscripten-feedstock#35. If it got closed I'd add macOS support for aarch64. I'd also add Linux support for aarch64 but they don't have that either. And Windows users should use WSL I don’t want to deal with Emscripten on Windows. |
|
Qiskit/rustworkx#1450 now has the full test suite. Fortunately, all tests pass. The only ones that are skipped are the ones that required graphviz. Honestly, the result is better than anticipated. |
Makes sense! That said, if you were to move, the only extra dependency would be
Ah, that's right. No one has responded there, I'll take a look now!
Thank you, this is awesome! |
|
I don't think there has been anything else to do here, so I guess we can merge now! |
Related to Qiskit/rustworkx#1447
In short, this adds a very experimental
rustworkxto Pyodide. If this is the wrong place to submit a recipe, let me know.At the current status, the other
rustworkxauthor has not yet merged the Pyodide support. It also might take a while for us to publish 0.17.0. So I called it a pre-release with0.17.0a3and hosted it in my GitHub fork's release.Overall, this seems to be working on the browser but failing with Python from
pyodide venvso I will open an issue onpyodide-buildasking a couple questions. (edit: report in pyodide/pyodide-build#201)