-
Notifications
You must be signed in to change notification settings - Fork 221
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
wasm32 support #341
Comments
OK, I've learnt bit more about those things, so I am able to proceed with that - I'm wondering if I could clean up a bit how this multithreading support is conditioned. As I currently see, the // EDIT Ah, I'm having clearer picture now. the |
Got the WIP here: BartAdv@dd6052b |
Since the discussion got a bit spread amongst repos/PRs, I want to step back a bit, and decide what would be best approach:
On top of that: is it really only about parallel? |
to control inclusion of functionality requiring multithreading.
Yeah, let's just put it all under a |
@BartAdv Are you still interested in this? |
@torkleyy yes! It slipped off my radar while waiting for shred changes to be merged. I think I got all the bits ready somewhere, because I'm already building a project using specs with wasm, so I'll just check what's needed to finalize it, most likely later this day. |
Great, thank you! |
shred had a release lately, there's an open PR that bumps the shred version. |
OK, ping me when it's done, I'll rebase on top of that then. |
@BartAdv It's merged ;) |
Yep, sorry for delay, I've opened the PR #353 for that |
Any updates on this? :) I keep poking my head into this issue. It sounds like shred is wasm compliant now? What major pieces remain. |
Unfortunately I'm not tracking it anymore (and not working on a project that needs this)... |
@richardanaya Yes, that's right, shred should be wasm compliant (at least I built it to be), although it's currently not tested for that. Before I tell you what remains, I'd like to say: in theory, we could just take the current code, feature flag everything in Specs that uses
That's why at this point we thought it would be easier to wait for threading support in wasm than trying to work around the problem. I don't know if there are any updates on that; should there be support by now it should be relatively easy to implement. |
Status links:
A related issue is |
For what it's worth, I was able to get get the clusterbomb example compiled and working in the browser. At a high level I had to:
|
Wanted to give a quick update on this. There are still challenges unrelated to getting specs to compile to wasm that stand in the way of using specs for anything non-trivial in the browser. At a high-level, constraints enforced by wasm-bindgen and the nature of game loops in javascript are proving difficult to work around. I've outlined the challenges in this stackoverflow post. Edit: You can see my current progress here: https://github.com/bgourlie/hexthing_wasm |
Any progress/plans on this? |
@liamcurry This is mostly blocked on Specs should be usable with wasm (with some challanges noted by @bgourlie) and missing support for This is not a must-have for 1.0. |
I can confirm that the latest version of Specs works fine with WASM as long as you disable default features (the |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed in 7 days if no further activity occurs. Feel free to comment if this is still relevant. |
This is still relevant. |
Relevant |
Initial support has landed (non-parallel), #580 tracks further progress. |
WASM doesn’t support parallel execution so we need to set default-features = false. amethyst/specs#341 (comment)
Hello,
Tried to build it with
--target wasm32-unknown-unknown
, haven't succeeeded. At first, I found out the dispatcher might be problematic (it's supporting parallel execution), so I went and annotatedshred
with conditional compilation directives (it already had it foremscripted
, so I just duplicated it with analogue fortarget_arch = "wasm32"
here. It builds fine then.Going back to
specs
, I've overriden theshred
to use my branch:only to see
OK, I get that - rand crate relies on some sys stuff. So I wanted to fix whatever dep is wanting
rand
. Found out, therayon-core
uses it. As it turns out,rayon
is used byhibitset
(gated by feature flagparallel
), so I wanted to check if I could gate the specs rayon dependncy similarily...:...to no avail, the build is still giving me
Now - maybe someone more compoenent than me could try and check it? Is it planned to support
wasm32-unknown-unknown
target?The text was updated successfully, but these errors were encountered: