koute / cargo-web

A Cargo subcommand for the client-side Web
Apache License 2.0
1.11k stars 80 forks source link

Update Emscripten support #235

Open tlively opened 4 years ago

tlively commented 4 years ago

https://github.com/emscripten-core/emscripten/issues/10148 is a report from a cargo-web user whose Emscripten installation is managed by cargo-web but is invalid. I took a look at the cargo-web source, and noticed a few issues:

  1. The help messages with instructions for installing Emscripten should probably recommend using emsdk regardless of the platform, since that's the only distribution method maintained by the Emscripten team and will make getting the latest bugfixes much easier.

  2. The instructions for installing emsdk are out of date. The current recommended method is to clone from GitHub. The mozilla-games s3 bucket is not being updated any more.

  3. It looks like cargo-web is trying to use Emscripten's fastcomp backend, but recent versions of Rust have switched to using Emscripten with Rust's LLVM rather than the separate fastcomp LLVM. Recent emsdk versions install the upstream-LLVM version of Emscripten by default.

milahu commented 3 years ago

It looks like cargo-web is trying to use Emscripten's fastcomp backend

yepp

https://github.com/koute/cargo-web/blob/2ddd9bbb567b8d4893e923cba8ad03806d383d80/src/emscripten.rs#L14

$ emsdk list --old | grep 1.38.19
         sdk-fastcomp-tag-1.38.19-64bit
           emscripten-1.38.19       

recent versions of Rust have switched to using Emscripten with Rust's LLVM

so .. are there alternatives to cargo-web? (compatible with recent version of emscripten) or .. how to fix cargo-web?

tlively commented 3 years ago

I would recommend just using cargo itself without additional tools. Details here: https://blog.therocode.net/2020/10/a-guide-to-rust-sdl2-emscripten.