diff options
author | Alon Zakai <alonzakai@gmail.com> | 2013-02-28 15:26:52 -0500 |
---|---|---|
committer | Alon Zakai <alonzakai@gmail.com> | 2013-02-28 15:34:34 -0500 |
commit | 1b88f7337bbb641ce3d85a155472ff97b8620a95 (patch) | |
tree | 6ad9adbdd2fbcf1aa523e991d01fefe28e6e54e9 /tools | |
parent | 6477d51f2e380f281631a363b6343f11248cd71a (diff) |
disable v8 stack size increase because of windows instability; make it easy to at least add params to node/v8 in ~/.emscripten by defining a list there and not just a string
Diffstat (limited to 'tools')
-rw-r--r-- | tools/js_optimizer.py | 2 | ||||
-rw-r--r-- | tools/shared.py | 13 |
2 files changed, 10 insertions, 5 deletions
diff --git a/tools/js_optimizer.py b/tools/js_optimizer.py index ca42081d..231c6257 100644 --- a/tools/js_optimizer.py +++ b/tools/js_optimizer.py @@ -139,7 +139,7 @@ def run_on_js(filename, passes, js_engine, jcache): if len(filenames) > 0: # XXX Use '--nocrankshaft' to disable crankshaft to work around v8 bug 1895, needed for older v8/node (node 0.6.8+ should be ok) - commands = map(lambda filename: [js_engine, JS_OPTIMIZER, filename, 'noPrintMetadata'] + passes, filenames) + commands = map(lambda filename: js_engine + [JS_OPTIMIZER, filename, 'noPrintMetadata'] + passes, filenames) #print [' '.join(command) for command in commands] cores = min(cores, filenames) diff --git a/tools/shared.py b/tools/shared.py index 93f9745d..10e267a7 100644 --- a/tools/shared.py +++ b/tools/shared.py @@ -2,6 +2,10 @@ import shutil, time, os, sys, json, tempfile, copy, shlex, atexit, subprocess, h from subprocess import Popen, PIPE, STDOUT from tempfile import mkstemp +def listify(x): + if type(x) is not list: return [x] + return x + # On Windows python suffers from a particularly nasty bug if python is spawning new processes while python itself is spawned from some other non-console process. # Use a custom replacement for Popen on Windows to avoid the "WindowsError: [Error 6] The handle is invalid" errors when emcc is driven through cmake or mingw32-make. # See http://bugs.python.org/issue3905 @@ -158,7 +162,8 @@ EXPECTED_NODE_VERSION = (0,6,8) def check_node_version(): try: - actual = Popen([NODE_JS, '--version'], stdout=PIPE).communicate()[0].strip() + node = listify(NODE_JS) + actual = Popen(node + ['--version'], stdout=PIPE).communicate()[0].strip() version = tuple(map(int, actual.replace('v', '').split('.'))) if version >= EXPECTED_NODE_VERSION: return True @@ -468,8 +473,8 @@ def timeout_run(proc, timeout, note='unnamed process', full_output=False): def run_js(filename, engine=None, args=[], check_timeout=False, stdout=PIPE, stderr=None, cwd=None, full_output=False): if engine is None: engine = JS_ENGINES[0] - if type(engine) is not list: engine = [engine] - if 'd8' in engine[0] or 'node' in engine[0]: engine += ['--stack_size=8192'] + engine = listify(engine) + #if not WINDOWS: 'd8' in engine[0] or 'node' in engine[0]: engine += ['--stack_size=8192'] # needed for some big projects command = engine + [filename] + (['--'] if 'd8' in engine[0] else []) + args return timeout_run(Popen(command, stdout=stdout, stderr=stderr, cwd=cwd), 15*60 if check_timeout else None, 'Execution', full_output=full_output) @@ -1092,7 +1097,7 @@ set(CMAKE_FIND_ROOT_PATH_MODE_PACKAGE ONLY)''' % { 'winfix': '' if not WINDOWS e @staticmethod def js_optimizer(filename, passes, jcache): - return js_optimizer.run(filename, passes, NODE_JS, jcache) + return js_optimizer.run(filename, passes, listify(NODE_JS), jcache) @staticmethod def closure_compiler(filename): |