aboutsummaryrefslogtreecommitdiff
path: root/tools/shared.py
diff options
context:
space:
mode:
authorJukka Jylänki <jujjyl@gmail.com>2013-04-06 21:12:55 +0300
committerJukka Jylänki <jujjyl@gmail.com>2013-04-11 10:42:14 +0300
commit1c4f763de44601a8b5a50fd5f78a8fedd314c131 (patch)
treed6f30313cdd557b0825de81f9b5d03465faeb1e9 /tools/shared.py
parentbc234c204c0a1d6d02363e9a60418dd52a6c3c87 (diff)
Extend the use of response files to cover the case when emcc invokes emscripten.py, so that Windows command line length limitations don't break the test_asm_pgo on Windows.
Diffstat (limited to 'tools/shared.py')
-rw-r--r--tools/shared.py12
1 files changed, 10 insertions, 2 deletions
diff --git a/tools/shared.py b/tools/shared.py
index 72f4868e..7692b4f8 100644
--- a/tools/shared.py
+++ b/tools/shared.py
@@ -2,6 +2,7 @@ import shutil, time, os, sys, json, tempfile, copy, shlex, atexit, subprocess, h
from subprocess import Popen, PIPE, STDOUT
from tempfile import mkstemp
import jsrun, cache, tempfiles
+from response_file import create_response_file
def listify(x):
if type(x) is not list: return [x]
@@ -34,13 +35,20 @@ class WindowsPopen:
self.stdout_ = PIPE
if self.stderr_ == None:
self.stderr_ = PIPE
-
- # Call the process with fixed streams.
+
+ # emscripten.py supports reading args from a response file instead of cmdline.
+ # Use .rsp to avoid cmdline length limitations on Windows.
+ if len(args) >= 2 and args[1].endswith("emscripten.py"):
+ response_filename = create_response_file(args[2:], TEMP_DIR)
+ args = args[0:2] + [response_filename]
+
try:
+ # Call the process with fixed streams.
self.process = subprocess.Popen(args, bufsize, executable, self.stdin_, self.stdout_, self.stderr_, preexec_fn, close_fds, shell, cwd, env, universal_newlines, startupinfo, creationflags)
except Exception, e:
print >> sys.stderr, '\nsubprocess.Popen(args=%s) failed! Exception %s\n' % (' '.join(args), str(e))
raise e
+ raise
def communicate(self, input=None):
output = self.process.communicate(input)