diff options
author | Jukka Jylänki <jujjyl@gmail.com> | 2013-09-18 11:08:13 +0300 |
---|---|---|
committer | Jukka Jylänki <jujjyl@gmail.com> | 2013-09-26 12:45:24 +0300 |
commit | 99dcc4eec235eba633303e59176723a048f8d036 (patch) | |
tree | 1fb2029c7ad2aaf057c98ae2fd393a56be2f70ab /tools/shared.py | |
parent | 3488df1fa054ed4352104c07276569dc16c12285 (diff) |
Don't do Popen workaround on Windows by default, since the cmdline -> call emcc.bat usage doesn't seem to need it, and it adversely affects the logging buffering that makes the compiler look unresponsive, since it will only print out compilation output messages at the very end of the whole run.
Diffstat (limited to 'tools/shared.py')
-rw-r--r-- | tools/shared.py | 17 |
1 files changed, 13 insertions, 4 deletions
diff --git a/tools/shared.py b/tools/shared.py index c0c5313f..63dcefca 100644 --- a/tools/shared.py +++ b/tools/shared.py @@ -85,10 +85,6 @@ class WindowsPopen: except: pass # Mute all exceptions in dtor, particularly if we didn't use a response file, self.response_filename doesn't exist. -# Install our replacement Popen handler if we are running on Windows to avoid python spawn process function. -if os.name == 'nt': - Popen = WindowsPopen - __rootpath__ = os.path.abspath(os.path.dirname(os.path.dirname(__file__))) def path_from_root(*pathelems): return os.path.join(__rootpath__, *pathelems) @@ -251,6 +247,19 @@ except Exception, e: logging.error('Error in evaluating %s (at %s): %s, text: %s' % (EM_CONFIG, CONFIG_FILE, str(e), config_text)) sys.exit(1) +try: + EM_POPEN_WORKAROUND +except: + EM_POPEN_WORKAROUND = os.environ.get('EM_POPEN_WORKAROUND') + +# Install our replacement Popen handler if we are running on Windows to avoid python spawn process function. +# nb. This is by default disabled since it has the adverse effect of buffering up all logging messages, which makes +# builds look unresponsive (messages are printed only after the whole build finishes). Whether this workaround is needed +# seems to depend on how the host application that invokes emcc has set up its stdout and stderr. +if EM_POPEN_WORKAROUND and os.name == 'nt': + logging.debug('Installing Popen workaround handler to avoid bug http://bugs.python.org/issue3905') + Popen = WindowsPopen + # Expectations EXPECTED_LLVM_VERSION = (3,2) |