Backed out 2 changesets (bug 1617748, bug 1623701) on request by dev
authorCoroiu Cristina <ccoroiu@mozilla.com>
Thu, 26 Mar 2020 00:01:03 +0200
changeset 520445 202ac04e9c8d7b1be18197b20dfdabb6f1e83ceb
parent 520444 082f545dff2b5c38578e68f27c2863a7238122da
child 520446 85bae8580dde1e86c3d11582474ff4af9f92b768
push id37250
push userdvarga@mozilla.com
push dateThu, 26 Mar 2020 04:04:15 +0000
treeherdermozilla-central@85bae8580dde [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs1617748, 1623701
milestone76.0a1
backs out547716d123e23f1426ad59653370f74f2d4ea0f7
dc80296ade1721ff732a863b6916cc2384f7dbba
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
Backed out 2 changesets (bug 1617748, bug 1623701) on request by dev Backed out changeset 547716d123e2 (bug 1617748) Backed out changeset dc80296ade17 (bug 1623701)
mach
testing/mozbase/mozprocess/mozprocess/processhandler.py
--- a/mach
+++ b/mach
@@ -12,21 +12,24 @@
 ''':'
 py2commands="
     analyze
     android
     android-emulator
     artifact
     awsy-test
     browsertime
+    build
+    build-backend
     buildsymbols
     cargo
     check-spidermonkey
     clang-format
     compileflags
+    configure
     cppunittest
     cramtest
     crashtest
     devtools-css-db
     doctor
     empty-makefiles
     file-info
     firefox-ui-functional
--- a/testing/mozbase/mozprocess/mozprocess/processhandler.py
+++ b/testing/mozbase/mozprocess/mozprocess/processhandler.py
@@ -1,16 +1,15 @@
 # This Source Code Form is subject to the terms of the Mozilla Public
 # License, v. 2.0. If a copy of the MPL was not distributed with this file,
 # You can obtain one at http://mozilla.org/MPL/2.0/.
 
 from __future__ import absolute_import, print_function, unicode_literals
 
 import errno
-import io
 import os
 import signal
 import subprocess
 import sys
 import threading
 import traceback
 from datetime import datetime
 
@@ -123,42 +122,27 @@ class ProcessHandlerMixin(object):
                 'stdin': stdin,
                 'stdout': stdout,
                 'stderr': stderr,
                 'preexec_fn': preexec_fn,
                 'close_fds': close_fds,
                 'shell': shell,
                 'cwd': cwd,
                 'env': env,
+                'universal_newlines': universal_newlines,
                 'startupinfo': startupinfo,
                 'creationflags': creationflags,
             }
-            if six.PY2:
-                kwargs['universal_newlines'] = universal_newlines
-            if six.PY3 and sys.version_info.minor >= 6:
-                kwargs['universal_newlines'] = universal_newlines
+            if six.PY3 and universal_newlines:
                 kwargs['encoding'] = encoding
             try:
                 subprocess.Popen.__init__(self, args, **kwargs)
             except OSError:
                 print(args, file=sys.stderr)
                 raise
-            # We need to support Python 3.5 for now, which doesn't support the
-            # "encoding" argument to the Popen constructor. For now, emulate it
-            # by patching the streams so that they return consistent values.
-            # This can be removed once we remove support for Python 3.5.
-            if six.PY3 and sys.version_info.minor == 5 and universal_newlines:
-                if self.stdin is not None:
-                    self.stdin = io.TextIOWrapper(self.stdin, encoding=encoding)
-                if self.stdout is not None:
-                    self.stdout = io.TextIOWrapper(self.stdout,
-                                                   encoding=encoding)
-                if self.stderr is not None:
-                    self.stderr = io.TextIOWrapper(self.stderr,
-                                                   encoding=encoding)
 
         def debug(self, msg):
             if not MOZPROCESS_DEBUG:
                 return
             thread = threading.current_thread().name
             print("DBG::MOZPROC PID:{} ({}) | {}".format(self.pid, thread, msg))
 
         def __del__(self):
@@ -1153,32 +1137,35 @@ class StoreOutput(object):
 
     def __call__(self, line):
         self.output.append(line)
 
 
 class StreamOutput(object):
     """pass output to a stream and flush"""
 
-    def __init__(self, stream, text=True):
+    def __init__(self, stream):
         self.stream = stream
-        self.text = text
 
     def __call__(self, line):
-        ensure = six.ensure_text if self.text else six.ensure_binary
-        self.stream.write(ensure(line + '\n'))
+        try:
+            self.stream.write(line + '\n'.encode('utf8'))
+        except UnicodeDecodeError:
+            # TODO: Workaround for bug #991866 to make sure we can display when
+            # when normal UTF-8 display is failing
+            self.stream.write(line.decode('iso8859-1') + '\n')
         self.stream.flush()
 
 
 class LogOutput(StreamOutput):
     """pass output to a file"""
 
     def __init__(self, filename):
         self.file_obj = open(filename, 'a')
-        StreamOutput.__init__(self, self.file_obj, True)
+        StreamOutput.__init__(self, self.file_obj)
 
     def __del__(self):
         if self.file_obj is not None:
             self.file_obj.close()
 
 
 # front end class with the default handlers
 
@@ -1210,22 +1197,19 @@ class ProcessHandler(ProcessHandlerMixin
 
         if logfile:
             logoutput = LogOutput(logfile)
             kwargs['processOutputLine'].append(logoutput)
 
         if stream is True:
             # Print to standard output only if no outputline provided
             if not kwargs['processOutputLine']:
-                kwargs['processOutputLine'].append(
-                    StreamOutput(sys.stdout,
-                                 kwargs.get('universal_newlines', False)))
+                kwargs['processOutputLine'].append(StreamOutput(sys.stdout))
         elif stream:
-            streamoutput = StreamOutput(stream,
-                                        kwargs.get('universal_newlines', False))
+            streamoutput = StreamOutput(stream)
             kwargs['processOutputLine'].append(streamoutput)
 
         self.output = None
         if storeOutput:
             storeoutput = StoreOutput()
             self.output = storeoutput.output
             kwargs['processOutputLine'].append(storeoutput)