Skip to content

Commit

Permalink
Backed out 2 changesets (bug 1613263, bug 1611326) for presummably ca…
Browse files Browse the repository at this point in the history
…using l10n langpack bustages. a=backout

Backed out changeset 77e54e76848a (bug 1611326)
Backed out changeset 36ba18ac3a68 (bug 1613263)
  • Loading branch information
CosminSabou committed Feb 14, 2020
1 parent ff27adf commit ff39f92
Show file tree
Hide file tree
Showing 74 changed files with 76 additions and 253 deletions.
1 change: 0 additions & 1 deletion accessible/xpcom/moz.build
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,6 @@ else:
GeneratedFile(
'xpcAccEvents.h', 'xpcAccEvents.cpp',
script='AccEventGen.py', entry_point='gen_files',
py2=True,
inputs=[
'AccEvents.conf',
'!/xpcom/idl-parser/xpidl/xpidllex.py',
Expand Down
1 change: 0 additions & 1 deletion browser/app/winlauncher/freestanding/moz.build
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,6 @@ if CONFIG['COMPILE_ENVIRONMENT']:
'%sntdll_freestanding.%s' % (CONFIG['LIB_PREFIX'],
CONFIG['LIB_SUFFIX']),
script='gen_ntdll_freestanding_lib.py',
py2=True,
inputs=['ntdll_freestanding.def'],
flags=[CONFIG['LLVM_DLLTOOL']] + CONFIG['LLVM_DLLTOOL_FLAGS'])

Expand Down
2 changes: 0 additions & 2 deletions browser/locales/moz.build
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ if CONFIG['MOZ_UPDATER']:
'en-US/updater/updater.ini',
'../installer/windows/nsis/updater_append.ini',
]
updater.py2 = True
# Yes, this is weird, but what can you do? This file doesn't want to be in the DIST_SUBDIR,
# but we can't really move it to a different directory until we change how locale repacks
# work.
Expand All @@ -35,7 +34,6 @@ bookmarks.inputs = [
# The `locales/en-US/` will be rewritten to the locale-specific path.
'en-US/profile/bookmarks.inc',
]
bookmarks.py2 = True

with Files("**"):
BUG_COMPONENT = ("Firefox Build System", "General")
Expand Down
1 change: 0 additions & 1 deletion build/clang-plugin/moz.build
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,6 @@ if CONFIG['ENABLE_MOZSEARCH_PLUGIN']:
]

GeneratedFile('ThirdPartyPaths.cpp', script="ThirdPartyPaths.py",
py2=True,
entry_point="generate", inputs=[
'/tools/rewriting/ThirdPartyPaths.txt',
'/tools/rewriting/Generated.txt',
Expand Down
3 changes: 0 additions & 3 deletions build/moz.build
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,6 @@ if CONFIG['MOZ_APP_BASENAME']:
script='../python/mozbuild/mozbuild/action/preprocessor.py',
entry_point='generate',
inputs=['application.ini.in'],
py2=True,
flags=['-D%s=%s' % (k, '1' if v is True else v)
for k, v in appini_defines.iteritems()])

Expand All @@ -96,12 +95,10 @@ if CONFIG['MOZ_APP_BASENAME']:
FINAL_TARGET_PP_FILES += ['update-settings.ini']

GeneratedFile('application.ini.h', script='appini_header.py',
py2=True,
inputs=['!application.ini'])

if CONFIG['ENABLE_TESTS']:
GeneratedFile('automation.py', script='gen_automation.py',
py2=True,
inputs=['automation.py.in'])

TEST_HARNESS_FILES.reftest += [
Expand Down
2 changes: 0 additions & 2 deletions build/templates.mozbuild
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,6 @@ def GeneratedFile(name, *names, **kwargs):
inputs = kwargs.get('inputs', [])
flags = kwargs.get('flags', [])
force = kwargs.get('force', False)
py2 = kwargs.get('py2', False)
if entry_point and not script:
error('entry_point cannot be provided if script is not provided')
if script and ':' in script:
Expand All @@ -198,7 +197,6 @@ def GeneratedFile(name, *names, **kwargs):
generated_file.inputs = inputs
generated_file.flags = flags
generated_file.force = force
generated_file.py2 = py2

include('gecko_templates.mozbuild')
include('test_templates.mozbuild')
Expand Down
2 changes: 0 additions & 2 deletions build/test_templates.mozbuild
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ def GeneratedTestCertificate(name):
if not CONFIG['COMPILE_ENVIRONMENT']:
return
GeneratedFile(name, script='/security/manager/ssl/tests/unit/pycert.py',
py2=True,
inputs=['%s.certspec' % name])
# Turn RELATIVEDIR into list entry: like
# 'security/manager/ssl/tests/unit/bad_certs' ->
Expand All @@ -24,7 +23,6 @@ def GeneratedTestKey(name):
if not CONFIG['COMPILE_ENVIRONMENT']:
return
GeneratedFile(name, script='/security/manager/ssl/tests/unit/pykey.py',
py2=True,
inputs=['%s.keyspec' % name])
# Turn RELATIVEDIR into list entry: like
# 'security/manager/ssl/tests/unit/bad_certs' ->
Expand Down
1 change: 0 additions & 1 deletion build/unix/elfhack/inject/moz.build
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ cpu = CONFIG['CPU_ARCH']

gen_src = '%s.c' % cpu
GeneratedFile(gen_src, script='copy_source.py', entry_point='copy',
py2=True,
inputs = ['../inject.c'])

SOURCES += [
Expand Down
4 changes: 0 additions & 4 deletions config/external/ffi/moz.build
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ else:
]
GeneratedFile('../../../js/src/ctypes/libffi/include/ffi.h',
script='subst_header.py',
py2=True,
inputs=['../../../js/src/ctypes/libffi/include/ffi.h.in'])

LOCAL_INCLUDES += [
Expand Down Expand Up @@ -86,7 +85,6 @@ else:
'!../../../js/src/ctypes/libffi/include/ffi.h',
],
script='preprocess_libffi_asm.py',
py2=True,
flags=['$(DEFINES)', '$(LOCAL_INCLUDES)'])
SOURCES += ['!win64_aarch.asm']
elif CONFIG['FFI_TARGET'] == 'X86':
Expand All @@ -106,7 +104,6 @@ else:
'!../../../js/src/ctypes/libffi/fficonfig.h',
'!../../../js/src/ctypes/libffi/include/ffi.h',
], script='preprocess_libffi_asm.py',
py2=True,
flags=['$(DEFINES)', '$(LOCAL_INCLUDES)'])
SOURCES += ['!win32.asm']
ASFLAGS += ['-safeseh']
Expand All @@ -123,7 +120,6 @@ else:
'!../../../js/src/ctypes/libffi/fficonfig.h',
'!../../../js/src/ctypes/libffi/include/ffi.h',
], script='preprocess_libffi_asm.py',
py2=True,
flags=['$(DEFINES)', '$(LOCAL_INCLUDES)'])
SOURCES += ['!win64.asm']
elif CONFIG['FFI_TARGET'] == 'X86_DARWIN':
Expand Down
1 change: 0 additions & 1 deletion config/external/icu/data/moz.build
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ LOCAL_INCLUDES += ['.']
if CONFIG['OS_TARGET'] == 'WINNT' and CONFIG['CPU_ARCH'] == 'aarch64':
icudata = 'icudata.asm'
GeneratedFile(icudata, script='genicudata.py',
py2=True,
inputs=[CONFIG['ICU_DATA_FILE']], flags=[data_symbol])
SOURCES += ['!%s' % icudata]
elif CONFIG['HAVE_YASM']:
Expand Down
3 changes: 0 additions & 3 deletions config/moz.build
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,6 @@ if CONFIG['WRAP_STL_INCLUDES']:
stl.script = 'make-stl-wrappers.py:gen_wrappers'
stl.flags = [output_dir, stl_compiler, template_file]
stl.flags.extend(stl_headers)
stl.py2 = True

# Wrap <windows.h> to make it easier to use correctly
# NOTE: If we aren't wrapping STL includes, we're building part of the browser
Expand All @@ -72,7 +71,6 @@ if CONFIG['WRAP_STL_INCLUDES']:
GeneratedFile('../dist/stl_wrappers/windows.h',
script='make-windows-h-wrapper.py',
entry_point='generate',
py2=True,
inputs = ['windows-h-constant.decls.h',
'windows-h-unicode.decls.h',
'windows-h-wrapper.template.h'],
Expand All @@ -88,4 +86,3 @@ if CONFIG['WRAP_SYSTEM_INCLUDES']:
system.flags = [output_dir]
system.flags.extend(stl_headers)
system.flags.extend(system_headers)
system.py2 = True
118 changes: 33 additions & 85 deletions config/mozunit/mozunit/mozunit.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,7 @@

from __future__ import absolute_import
import inspect
import io
import os
from six import (
BytesIO,
StringIO,
)
import sys
import unittest
from unittest import TextTestRunner as _TestRunner, TestResult as _TestResult
Expand All @@ -29,6 +24,8 @@
build = MozbuildObject.from_environment(cwd=here)
topsrcdir = build.topsrcdir

StringIO = six.StringIO

'''Helper to make python unit tests report the way that the Mozilla
unit test infrastructure expects tests to report.
Expand Down Expand Up @@ -116,30 +113,21 @@ def run(self, test):
return result


def _mocked_file(cls):
'''Create a mocked file class that inherits from the given class.
'''
class MockedFile(cls):
def __init__(self, context, filename, content):
self.context = context
self.name = filename
cls.__init__(self, content)

def close(self):
self.context.files[self.name] = self.getvalue()
cls.close(self)

def __enter__(self):
return self

def __exit__(self, type, value, traceback):
self.close()
class MockedFile(StringIO):
def __init__(self, context, filename, content=''):
self.context = context
self.name = filename
StringIO.__init__(self, content)

return MockedFile
def close(self):
self.context.files[self.name] = self.getvalue()
StringIO.close(self)

def __enter__(self):
return self

MockedStringFile = _mocked_file(StringIO)
MockedBytesFile = _mocked_file(BytesIO)
def __exit__(self, type, value, traceback):
self.close()


def normcase(path):
Expand All @@ -154,60 +142,6 @@ def normcase(path):
return path


class _MockBaseOpen(object):
'''Callable that acts like the open() function; see MockedOpen for more
info.
'''
def __init__(self, open, files):
self.open = open
self.files = files

def __call__(self, name, mode='r', buffering=None, encoding=None):
# open() can be called with an integer "name" (i.e. a file descriptor).
# We don't generally do this in our codebase, but internal Python
# libraries sometimes do and we want to handle that cleanly.
if isinstance(name, int):
return self.open(name, mode=mode, buffering=buffering,
encoding=encoding)
# buffering is ignored.
absname = normcase(os.path.abspath(name))
if 'w' in mode:
file = self._mocked_file(absname, mode)
elif absname in self.files:
content = self.files[absname]
if content is None:
raise IOError(2, 'No such file or directory')
file = self._mocked_file(absname, mode, content)
elif 'a' in mode:
read_mode = 'rb' if 'b' in mode else 'r'
file = self._mocked_file(
absname, mode, self.open(name, read_mode).read())
else:
file = self.open(name, mode)
if 'a' in mode:
file.seek(0, os.SEEK_END)
return file

def _mocked_file(self, name, mode, content=None):
raise NotImplementedError('subclass must implement')


class _MockPy2Open(_MockBaseOpen):
def _mocked_file(self, name, mode, content=None):
content = six.ensure_binary(content or b'')
return MockedBytesFile(self, name, content)


class _MockOpen(_MockBaseOpen):
def _mocked_file(self, name, mode, content=None):
if 'b' in mode:
content = six.ensure_binary(content or b'')
return MockedBytesFile(self, name, content)
else:
content = six.ensure_text(content or u'')
return MockedStringFile(self, name, content)


class MockedOpen(object):
'''
Context manager diverting the open builtin such that opening files
Expand Down Expand Up @@ -236,24 +170,38 @@ def __init__(self, files={}):
for name, content in files.items():
self.files[normcase(os.path.abspath(name))] = content

def __call__(self, name, mode='r', buffering=None, encoding=None):
# buffering is ignored.
absname = normcase(os.path.abspath(name))
if 'w' in mode:
file = MockedFile(self, absname)
elif absname in self.files:
content = self.files[absname]
if content is None:
raise IOError(2, 'No such file or directory')
file = MockedFile(self, absname, content)
elif 'a' in mode:
file = MockedFile(self, absname, self.open(name, 'r').read())
else:
file = self.open(name, mode)
if 'a' in mode:
file.seek(0, os.SEEK_END)
return file

def __enter__(self):
import six.moves.builtins
self.open = six.moves.builtins.open
self.io_open = io.open
self._orig_path_exists = os.path.exists
self._orig_path_isdir = os.path.isdir
self._orig_path_isfile = os.path.isfile
builtin_cls = _MockPy2Open if six.PY2 else _MockOpen
six.moves.builtins.open = builtin_cls(self.open, self.files)
io.open = _MockOpen(self.io_open, self.files)
six.moves.builtins.open = self
os.path.exists = self._wrapped_exists
os.path.isdir = self._wrapped_isdir
os.path.isfile = self._wrapped_isfile

def __exit__(self, type, value, traceback):
import six.moves.builtins
six.moves.builtins.open = self.open
io.open = self.io_open
os.path.exists = self._orig_path_exists
os.path.isdir = self._orig_path_isdir
os.path.isfile = self._orig_path_isfile
Expand Down
1 change: 0 additions & 1 deletion devtools/client/shared/build/node-templates.mozbuild
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ def CompiledModules(*modules):
"node.stub", *[final + '/' + module for module in modules],
script='/python/mozbuild/mozbuild/action/node.py',
entry_point='generate',
py2=True,
inputs=['/devtools/client/shared/build/build.js'] +
[module for module in modules],
flags=[final])
1 change: 0 additions & 1 deletion devtools/shared/webconsole/moz.build
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ for dir in RELATIVEDIR.split('/'):
base += ["!reserved-js-words.js"]

GeneratedFile('reserved-js-words.js', script='GenerateReservedWordsJS.py',
py2=True,
inputs = ['/js/src/frontend/ReservedWords.h'])

DevToolsModules(
Expand Down
2 changes: 0 additions & 2 deletions dom/base/moz.build
Original file line number Diff line number Diff line change
Expand Up @@ -546,11 +546,9 @@ if CONFIG['MOZ_X11']:
CXXFLAGS += CONFIG['TK_CFLAGS']

GeneratedFile('UseCounterList.h', script='gen-usecounters.py',
py2=True,
entry_point='use_counter_list', inputs=['UseCounters.conf'])

GeneratedFile('UseCounterWorkerList.h', script='gen-usecounters.py',
py2=True,
entry_point='use_counter_list', inputs=['UseCountersWorker.conf'])

if CONFIG['CC_TYPE'] in ('clang', 'gcc'):
Expand Down
1 change: 0 additions & 1 deletion dom/bindings/moz.build
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,6 @@ if CONFIG['CC_TYPE'] in ('clang', 'gcc'):
if CONFIG['COMPILE_ENVIRONMENT']:
GeneratedFile('CSS2Properties.webidl',
script='GenerateCSS2PropertiesWebIDL.py',
py2=True,
entry_point='generate',
inputs=[
'/dom/webidl/CSS2Properties.webidl.in',
Expand Down
3 changes: 1 addition & 2 deletions dom/encoding/moz.build
Original file line number Diff line number Diff line change
Expand Up @@ -34,12 +34,11 @@ prefixes = (
for prefix in prefixes:
input_file = prefix + '.properties'
header = prefix + '.properties.h'
GeneratedFile(header, script=props2arrays, inputs=[input_file], py2=True)
GeneratedFile(header, script=props2arrays, inputs=[input_file])

input_file = 'nonparticipatingdomains.properties'
header = input_file + '.h'
GeneratedFile(header, script='../../intl/locale/props2arrays.py',
py2=True,
inputs=[input_file])

MOCHITEST_MANIFESTS += [
Expand Down
1 change: 0 additions & 1 deletion dom/webgpu/ffi/moz.build
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ if CONFIG['COMPILE_ENVIRONMENT']:
GeneratedFile('wgpu_ffi_generated.h',
script='/layout/style/RunCbindgen.py',
entry_point='generate',
py2=True,
inputs=[
'/gfx/wgpu/wgpu-remote',
])
Expand Down
Loading

0 comments on commit ff39f92

Please sign in to comment.