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

[DRAFT] add support for wasm32-unknown-emscripten #1469

Draft
wants to merge 5 commits into
base: master
Choose a base branch
from

Conversation

walkingeyerobot
Copy link

This is an early draft PR for the purposes of gathering feedback early. There are also pending changes to wasm-bindgen and Emscripten. This is for issue #1468.

This PR does a few things:

  1. Removes hard coded references to wasm32-unknown-unknown, instead reading .cargo/config.toml to determine what the target triple is. If this file isn't present or a triple isn't specified, wasm32-unknown-unknown is used as the default.
  2. When targeting -emscripten, run the wasm-bindgen install step before building. This makes sure it's available for Emscripten during link time.

TODOs:

  1. Change the -o argument being passed to Emscripten. The default way this is set up passes a full filename ending in .wasm, which causes Emscripten to not even attempt to emit JS. This might need a change to rustc.
  2. Once -o is taken care of, actually copy the final files to pkg.
  3. After wasm-bindgen is installed, ensure Emscripten can find it. Emscripten is currently reading the location from its own config file, but we might want to set up an environment variable or something to make sure it's using the copy installed by wasm-pack.

@walkingeyerobot
Copy link
Author

I'll also note that some of the infrastructure here will be useful for adding wasm64 support per #1464

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.

1 participant