Skip to content
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

Make it compile with wasm32-unknown-emscripten #397

Merged
merged 1 commit into from
Feb 12, 2025

Conversation

ndmitchell
Copy link
Contributor

Make it so that emscripten works. Now you can do:

rustup target add wasm32-unknown-emscripten
cargo build --target=wasm32-unknown-emscripten

And it works. Unlike the other WASM target, emscripten configures itself to work with both unix and wasm, so we have to avoid the unix branch.

A more recent variant of the patch in #301. For that PR, it was suggested that cfg_if would be a reasonable alternative. I'm happy to go that route if you want, but found that it makes things more complicated (to my eye). But maintainers choice.

Summary:

Test Plan:
@ndmitchell ndmitchell mentioned this pull request Feb 11, 2025
@alexcrichton
Copy link
Owner

Thanks! Would you be up to adding an entry in the CI matrix to compile for emscripten? I'm not sure how to do that myself. If you're not sure though that seems reasonable to leave out too.

@ndmitchell
Copy link
Contributor Author

I'm working on that on a separate branch and will follow up with that later (it's not super easy, but have something hacky working)

@alexcrichton
Copy link
Owner

Ok!

@alexcrichton alexcrichton merged commit bcc77b4 into alexcrichton:main Feb 12, 2025
7 checks passed
@ndmitchell ndmitchell mentioned this pull request Feb 13, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants