Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?

Build Rust with Emscripten support

  1. curl -O https://s3.amazonaws.com/mozilla-games/emscripten/releases/emsdk-portable.tar.gz
  2. tar -xzf emsdk-portable.tar.gz
  3. source emsdk_portable/emsdk_env.sh
  4. emsdk update
  5. emsdk install sdk-incoming-64bit
  6. emsdk activate sdk-incoming-64bit
  7. cd ~/src
  8. git clone https://github.com/brson/rust --branch emscripten-new && cd rust
  9. cd src/llvm && git remote add brson https://github.com/brson/llvm && git fetch brson && cd ../..
  10. ./configure --enable-rustbuild --target=asmjs-unknown-emscripten
  11. python2 src/bootstrap/bootstrap.py -v --step libtest --stage 2 --target asmjs-unknown-emscripten
  12. python2 src/bootstrap/bootstrap.py --step check-rpass --target=asmjs-unknown-emscripten
@eminence

This comment has been minimized.

Copy link

eminence commented Sep 1, 2016

If anyone sees the following error during step (3):

Traceback (most recent call last):
  File "./emsdk", line 1797, in <module>
    sys.exit(main())
  File "./emsdk", line 1496, in main
    load_sdk_manifest()
  File "./emsdk", line 1291, in load_sdk_manifest
    for p, v in vars(t2).iteritems():
AttributeError: 'dict' object has no attribute 'iteritems'
-bash: ./emsdk_set_env.sh: No such file or directory

This means you need to be using python2, not python3

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.