koute / cargo-web

A Cargo subcommand for the client-side Web

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Update Emscripten support

tlively opened this issue · comments

emscripten-core/emscripten#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.

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

yepp

url: "https://github.com/koute/emscripten-build/releases/download/emscripten-1.38.19-1/emscripten-1.38.19-1-x86_64-unknown-linux-gnu.tgz",

$ 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?

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