Bug 1585751 - [lint.wpt] Work around mozprocess Windows + Python 3 bug, r=jgraham
authorAndrew Halberstadt <ahalberstadt@mozilla.com>
Thu, 03 Oct 2019 13:17:34 +0000
changeset 496167 4ba57765a7674e46842d2b6aa0bb07fae742522f
parent 496166 7cfcbf9b6dfa9972d6de1ca5c9f3e5912113678b
child 496168 6050b9e662edf1099201136cb1044bdc3cad3ade
push id36646
push usernerli@mozilla.com
push dateThu, 03 Oct 2019 21:48:01 +0000
treeherdermozilla-central@2e1bfb7458de [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjgraham
bugs1585751
milestone71.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1585751 - [lint.wpt] Work around mozprocess Windows + Python 3 bug, r=jgraham Depends on D47975 Differential Revision: https://phabricator.services.mozilla.com/D47976
tools/lint/wpt/wpt.py
--- a/tools/lint/wpt/wpt.py
+++ b/tools/lint/wpt/wpt.py
@@ -34,16 +34,25 @@ def lint(files, config, **kwargs):
         print("No specific files specified, running the full wpt lint"
               " (this is slow)", file=sys.stderr)
         files = ["--all"]
     cmd = ['python2', os.path.join(tests_dir, 'wpt'), 'lint', '--json'] + files
     log.debug("Command: {}".format(' '.join(cmd)))
 
     proc = ProcessHandler(cmd, env=os.environ, processOutputLine=process_line,
                           universal_newlines=True)
+
+    if sys.platform == 'win32':
+        # Workaround for bug 1585702. According to the win32 docs,
+        # CreateProcess will use the calling process's env by default. Since we
+        # are passing in `os.environ` wholesale anyway, setting the env to
+        # `None` shouldn't make a difference. An alternative workaround would
+        # be to stop using mozprocess here and use subprocess directly.
+        proc.env = None
+
     proc.run()
     try:
         proc.wait()
         if proc.returncode != 0:
             results.append(
                 result.from_config(config,
                                    message="Lint process exited with return code %s" %
                                    proc.returncode))