diff --git a/Dockerfile b/Dockerfile index e3b4c2e..b989670 100644 --- a/Dockerfile +++ b/Dockerfile @@ -20,6 +20,8 @@ RUN cd /root/ \ && /root/emsdk/emsdk activate latest-upstream \ && source /root/emsdk/emsdk_env.sh --build=Release \ && emcc hello_world.cpp -s WASM_OBJECT_FILES=1 \ + && python -c "import os ; assert open(os.path.expanduser('~/.emscripten')).read().count('LLVM_ROOT') == 1" \ + && python -c "import os ; assert 'upstream' in open(os.path.expanduser('~/.emscripten')).read()" \ && echo "test fastcomp (waterfall)" \ && /root/emsdk/emsdk install latest-fastcomp \ && /root/emsdk/emsdk activate latest-fastcomp \ @@ -28,4 +30,3 @@ RUN cd /root/ \ && emcc hello_world.cpp -s WASM=0 \ && echo "test binaryen source build" \ && /root/emsdk/emsdk install --build=Release binaryen-master-64bit - diff --git a/emsdk b/emsdk index e9cbd9d..2544cc5 100755 --- a/emsdk +++ b/emsdk @@ -1051,13 +1051,26 @@ def generate_dot_emscripten(active_tools): if embedded: cfg += "emsdk_path=os.path.dirname(os.environ.get('EM_CONFIG')).replace('\\\\', '/')\n" + # Different tools may provide the same activated configs; the latest to be + # activated is the relevant one. + activated_keys_in_order = [] + activated_key_values = {} + for tool in active_tools: tool_cfg = tool.activated_config() if tool_cfg: - tool_cfg = tool_cfg.replace(';', '\n') - if 'SPIDERMONKEY_ENGINE=' in tool_cfg: has_spidermonkey = True - if 'NODE_JS=' in tool_cfg: has_node = True - cfg += tool_cfg + '\n' + for specific_cfg in tool_cfg.split(';'): + name, value = specific_cfg.split('=') + if name not in activated_key_values: + activated_keys_in_order.append(name) + activated_key_values[name] = value + + for name in activated_keys_in_order: + if name == 'SPIDERMONKEY_ENGINE': + has_spidermonkey = True + if name == 'NODE_JS': + has_node = True + cfg += name + ' = ' + activated_key_values[name] + '\n' # These two vars must always be defined, even though they might not exist. if not has_spidermonkey: cfg += "SPIDERMONKEY_ENGINE = ''\n"