-
Notifications
You must be signed in to change notification settings - Fork 782
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
Set up CI for wasm32-emscripten target #2436
Conversation
So the segfault seems to be because |
It would be good to return an error from |
be42346
to
7ec96a5
Compare
This adds CI to build libpython3.11 for wasm32-emscripten and running tests against it. We need to patch instant to work around the emscripten_get_now: sebcrozet/instant#47 We also have to patch emscripten to work aroung the "undefined symbol gxx_personality_v0" error: emscripten-core/emscripten#17128 I set up a nox file to download and install emscripten, download and build cpython, set appropriate environment variables then run cargo test. The workflow just installs python, rust, node, and nox and runs the nox session. I xfailed all the test failures. There are problems with datetime. iter_dict_nosegv and test_filenotfounderror should probably be fixable. The tests that involve threads or asyncio probably can't be fixed.
Thanks, will try to give full review later!
We shouldn't change the Maybe worth correcting as a separate PR and documenting as a fix in the CHANGELOG. |
Okay I will open a pr. I guess I should add a changelog entry here too. |
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.
This is really neat; I'm very excited to see this added to our CI. Thank you so much for putting the time in for this! (I really need to get my head around how shared libraries work in wasm sometime.)
I guess I should add a changelog entry here too.
As strictly speaking there's not anything user-facing here I don't think a CHANGELOG is necessary for this one. Any subsequent MRs where we fix issues with wasm which users will encounter would be worth documenting. (e.g. the datetime fix.)
I've added a few comments - I think we can drop the instant
patch, and also I'd like to have ignore = "..."
notes on tests which we know will never work.
Let's keep #2412 open after this merges, and then the remaining tests which we believe should work but currently don't can be tracked there. Hopefully we can close everything off before the 0.17 release. (I've still got a couple of axes of feature work I'd like to finish first, so there's some time!)
I've always used #[cfg(not(target_arch = "wasm32"))]
#[test]
fn test() {
// ...
} |
Good point, yes, tests which don't ever expect to work should use |
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.
This is really great, thanks again! 💯
Thanks for the help and the quick reviews @messense and @davidhewitt! Hopefully I'll get to some followup PRs soon. |
This adds CI tests for wasm32-emscripten target. CI run builds
libpython3.11.a
for the wasm32-emscripten target and then runscargo test
against it.Resolves #2412.