-
Notifications
You must be signed in to change notification settings - Fork 397
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
emscripten support is broken (since wasm-bindgen does not work there?) #810
Comments
Since it appears I am the only developer on emscripten, I suggest simply removing the advertised emscripten support from the docs, to not bait any more victims. ;) |
#809 (comment) |
Maybe if @alisomay made a PR, @benjamin-sieffert could try it out? Then we can see if we can merge it or not. |
@alisomay @est31
I can try your patch instead of mine, but I doubt it helps with the runtime failure. |
I see.. I'm also alien to emscripten and just tried to follow common sense quickly. |
Good points, there is something deeply flawed in our CI jobs then... maybe we should just remove them? |
Just posting here to say that I am an occasional emscripten user myself exploring what's available for rust. Attempting to compile an application that uses Compiling cpal v0.15.2
error[E0412]: cannot find type `WasmOption` in module `wasm_bindgen::convert`
--> C:\Users\djtub\.cargo\registry\src\index.crates.io-6f17d22bba15001f\cpal-0.15.2\src\lib.rs:246:39
|
246 | type Abi = wasm_bindgen::convert::WasmOption<u32>;
| ^^^^^^^^^^ not found in `wasm_bindgen::convert`
error: aborting due to previous error |
Will this ever be supported? XSynth uses cpal for audio and I've been wanting to move from my own homebrewed synthesizer to xsynth. |
When I try to use cpal (via rodio) in an emscripten build, I first need to apply this patch:
Then I can compile and run into the following error:
"cannot call wasm-bindgen imported functions on non-wasm targets" @ /home/ax/.cargo/registry/src/index.crates.io-6f17d22bba15001f/web-sys-0.3.64/src/features/gen_AudioContext.rs:5
Afaik,
wasm-bindgen
fundamentally does not work on emscripten, at least not without jumping through a lot of hoops.Before #713 , "stdweb" was used, which advertises direct emscripten support; so it probably (somewhat) worked at some point.
Unfortunately the old version(s) can no longer be compiled, due to various other changes in rustc/libc/emscripten.
According to the emscripten docs, "OpenAL" should be the best way to get audio in that environment: https://emscripten.org/docs/porting/Audio.html
The text was updated successfully, but these errors were encountered: