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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make nannou package compile in WASM environment #715

Closed
wants to merge 2 commits into from

Conversation

Woyten
Copy link
Contributor

@Woyten Woyten commented Mar 1, 2021

Hi. This is a minimal example showing which changes will allow to compile the nannou module against the wasm32-unknown-unknown target.

Disclaimer: I am not saying that:

  • Nannou Apps will run in a Browser after these changes. There are still some things to do.
  • This PR should be merged. But it could! 馃槈

This PR relates to #475.

@Woyten Woyten mentioned this pull request Mar 20, 2021
@mitchmindtree
Copy link
Member

Nice to see a start on this!

One thing that might be worth adding while landing wasm support would be one new CI job that tries to build one or more of the examples for the wasm target, or something along these lines. Normally I would say CI testing of specific platforms is best left for the cross platform crates like winit and cpal. However in our case I think it might be easy for us to accidentally break wasm compatibility otherwise, particularly as some library APIs just aren't compatible with wasm (like those wgpu items you had to gate in this PR) and it's not always obvious what those are.

@Woyten
Copy link
Contributor Author

Woyten commented May 22, 2021

Sorry I haven't responded yet. I will rebase this PR and see how to adapt the CI job once #737 is merged.

@Woyten Woyten force-pushed the nannou-to-wasm-compilation branch 2 times, most recently from 5ac41b2 to 68dc2b4 Compare August 19, 2021 19:38
@Woyten
Copy link
Contributor Author

Woyten commented Aug 19, 2021

@mitchmindtree I upgraded this PR to the newest Nannou version and added a CI check.

@Woyten
Copy link
Contributor Author

Woyten commented Aug 19, 2021

@mitchmindtree Currently, it's not possible to compile the whole Nannou tree to WASM. nannou_timeline depends on envelope which depends on num which depends on rustc-serialize. rustc-serialize will not receive WASM support (rust-lang-deprecated/rustc-serialize#190 (comment)). This means, a new envelope version without the implicit rustc-serialize dependency is needed.

@Woyten
Copy link
Contributor Author

Woyten commented Aug 19, 2021

Other problematic libraries that need to be removed or hidden behind a feature switch are socket2 and home.

@Woyten Woyten changed the title [WIP] Make nannou package compile in WASM environment Make nannou package compile in WASM environment Aug 19, 2021
@Woyten
Copy link
Contributor Author

Woyten commented Nov 20, 2021

@mitchmindtree The PR has been updated to the newest Nannou release. I propose to merge the PR s.t. the main nannou package doesn't lose WASM compatibility in the future.

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