How to Update the Emscripten C/C++ Compiler

The Emscripten C/C++ Compiler for Webassembly is evolving at a blazing speed. Bug fixes and new features. Keeping it updated can save you hours when you stumble upon something that is already resolved.

Change is the only constant. Heraclitus

It goes without saying that you need to have Emscripten installed before you try to update it. Note that this post is dealing with the Windows environment, although the updating process should be pretty similar for the Linux environment.

Commands To Get Emscripten Updated

Before executing the following commands, make sure you go to the directory where Emscripten(emsdk) is installed, and set its environment variables by executing:


emsdk_env.bat

Emscripten update commands:


emsdk update-tags
emsdk install latest
emsdk activate latest

Your compiler is updated after a few minutes. Easy.

Not so fast, my compiler update process failed!

Issue Updating Emscripten

I suspect that the following issue is also happening during the installation.

Currently the emsdk install latest command eventually gives the following error:


.
.
.
Installing tool 'emscripten-1.37.35'..
Error downloading URL 'https://github.com/kripken/emscripten/archive/1.37.35.zip': <urlopen error [Errno 1] _ssl.c:504: error:1407742E:SSL routines:SS L23_GET_SERVER_HELLO:tlsv1 alert protocol version>
Installation failed!


This error appears to be happening because the Python shipped with Emscripten will do SSL version 2 only, and sites are refusing this older standard.

Workaround

Fortunately, there is already a documented workaround.

If you have followed my installation steps, you already have Python 2.7.14 installed. If you don’t, just install it.

To work around this error, instead of issuing the emsdk install latest command, use:


c:\Python27\python emsdk install latest

Do not change the last command, keep it as described above: emsdk activate latest.

Issue Was Filed

I have filed a bug report about this issue.

What Prompt me to Try to Update Emscripten?

I was getting the following error on Firefox and Chrome when trying to execute a small wasm module:

TypeError: import object field ‘env’ is not an Object

Was this error be resolved after I had updated Emscripten? Actually no :(. This error is not an issue with the compiler, and I am preparing an interesting post about it (stay tuned!).

Post MindMap

mindmap-update-emscripten-webassemblycode
Software version
windows 7
Python updated from 2.7.5 to 2.7.14
emscripten updated from 1.37.27 to 1.37.35

Leave a message below. Webassembly is evolving rapidly, please let me know if this post got outdated.

Enjoyed this post?

Don't miss new posts: Share it with your friends:

2 Responses

  1. Al says:

    Hey! Curious if you could post a guide or give more info on how exactly to compile an entire C++ video game, into a playable game in the browser using a static html page. Thanks!

    • webassemblycodecom-admin says:

      Hey! Thanks for stopping by. This is actually one of the purposes of this blog. I am breaking down all the steps needed to fully run a game with Webassembly.
      I am going to do this with Tetris, but then all the lessons would be applicable to other games as well.
      .
      I am curious with this part in your message:”into a playable game in the browser using a static html page.”
      .
      In the context of webassembly, you are going to have the html file, but inevitable you are going to have a webassembly module compiled from C(C++) and also some needed javascripted glue code.
      .
      Please signup for the email letter and you will see this unfolding.

Leave a Reply

Your email address will not be published. Required fields are marked *