Skip to content

Instantly share code, notes, and snippets.

@developerfred
Forked from derhuerst/install.md
Created February 14, 2020 09:06
Show Gist options
  • Save developerfred/a60a486a8f9facfa6cb63f0149411c27 to your computer and use it in GitHub Desktop.
Save developerfred/a60a486a8f9facfa6cb63f0149411c27 to your computer and use it in GitHub Desktop.
Rust WASM setup on macOS (with fish shell)

warning: took more than an hour on my machine, because it had to compile fastcomp

  • xcode-select --install
  • make sure, python in your $PATH is Python 2, not 3
  • brew install cmake
  • follow "install Rust" and "install Emscripten" from https://davidmcneil.gitbooks.io/the-rusty-web/setup-and-hello-world.html
    • curl https://sh.rustup.rs -sSf | sh
    • add $HOME/.cargo/env to your $PATH (set -U fish_user_paths …)
    • rustup install nightly
    • rustup default nightly
    • rustup target add asmjs-unknown-emscripten
    • rustup target add wasm32-unknown-emscripten
    • bash
      • source ./emsdk-portable/emsdk_env.sh
      • emsdk update
      • emsdk install sdk-incoming-64bit
      • emsdk activate sdk-incoming-64bit
      • source ./emsdk-portable/emsdk_env.sh
      • emcc --version – should work
  • bash
    • source ./emsdk-portable/emsdk_env.sh
    • rustc --target=asmjs-unknown-emscripten lib/main.rs -o demo.html
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment