Backed out changeset ee6dbeaf8852 (bug 1664077) for build bustages on gfxFontUtils.h. CLOSED TREE

This commit is contained in:
Razvan Maries 2020-09-15 04:02:01 +03:00
Родитель 3fd47263f8
Коммит f46af2adfc
11 изменённых файлов: 86 добавлений и 13 удалений

Просмотреть файл

@ -149,6 +149,19 @@ done
cat >> $CONFIG_STATUS <<\EOF
]
dnl List of AC_DEFINEs that aren't to be exposed in ALLDEFINES
non_global_defines = [
EOF
if test -n "$_NON_GLOBAL_ACDEFINES"; then
for var in $_NON_GLOBAL_ACDEFINES; do
echo " '$var'," >> $CONFIG_STATUS
done
fi
cat >> $CONFIG_STATUS <<EOF
]
flags = [
undivert(MOZ_DIVERSION_ARGS)dnl
]

Просмотреть файл

@ -316,6 +316,9 @@ def post_old_configure(raw_config):
for k, v in iteritems(dict(raw_config['defines'])):
set_old_configure_define(k, v)
set_old_configure_config('non_global_defines',
raw_config['non_global_defines'])
# Assuming no other option is declared after this function, handle the
# env options that were injected by mozconfig_options by creating dummy

Просмотреть файл

@ -97,11 +97,13 @@ def config_status(config):
sanitized_config = {}
sanitized_config['substs'] = {
k: sanitize_config(v) for k, v in six.iteritems(config)
if k not in ('DEFINES', 'TOPSRCDIR', 'TOPOBJDIR', 'CONFIG_STATUS_DEPS')
if k not in ('DEFINES', 'non_global_defines', 'TOPSRCDIR', 'TOPOBJDIR',
'CONFIG_STATUS_DEPS')
}
sanitized_config['defines'] = {
k: sanitize_config(v) for k, v in six.iteritems(config['DEFINES'])
}
sanitized_config['non_global_defines'] = config['non_global_defines']
sanitized_config['topsrcdir'] = config['TOPSRCDIR']
sanitized_config['topobjdir'] = config['TOPOBJDIR']
sanitized_config['mozconfig'] = config.get('MOZCONFIG')
@ -125,7 +127,7 @@ def config_status(config):
fh.write('%s = ' % k)
write_indented_repr(fh, v)
fh.write("__all__ = ['topobjdir', 'topsrcdir', 'defines', "
"'substs', 'mozconfig']")
"'non_global_defines', 'substs', 'mozconfig']")
if config.get('MOZ_BUILD_APP') != 'js' or config.get('JS_STANDALONE'):
fh.write(textwrap.dedent('''

Просмотреть файл

@ -2487,6 +2487,7 @@ if test "$NECKO_WIFI"; then
AC_MSG_ERROR([Necko WiFi scanning needs DBus on your platform, remove --disable-dbus or use --disable-necko-wifi])
fi
AC_DEFINE(NECKO_WIFI)
_NON_GLOBAL_ACDEFINES="$_NON_GLOBAL_ACDEFINES NECKO_WIFI"
fi
AC_SUBST(NECKO_WIFI)
AC_SUBST(NECKO_WIFI_DBUS)
@ -2833,6 +2834,19 @@ fi
dnl Spit out some output
dnl ========================================================
dnl The following defines are used by xpcom
_NON_GLOBAL_ACDEFINES="$_NON_GLOBAL_ACDEFINES
HAVE_GETPAGESIZE
HAVE_STATVFS64
HAVE_STATVFS
HAVE_STATFS64
HAVE_STATFS
HAVE_SYS_STATVFS_H
HAVE_SYS_STATFS_H
HAVE_SYS_VFS_H
HAVE_SYS_MOUNT_H
"
# Avoid using obsolete NSPR features
AC_DEFINE(NO_NSPR_10_SUPPORT)

Просмотреть файл

@ -36,6 +36,7 @@ class BuildConfig(object):
self.topsrcdir = None
self.topobjdir = None
self.defines = {}
self.non_global_defines = []
self.substs = {}
self.files = []
self.mozconfig = None
@ -94,10 +95,12 @@ class ConfigEnvironment(object):
the top object directory.
- defines is a dict filled from AC_DEFINE and AC_DEFINE_UNQUOTED in
autoconf.
- non_global_defines are a list of names appearing in defines above
that are not meant to be exported in ACDEFINES (see below)
- substs is a dict filled from AC_SUBST in autoconf.
ConfigEnvironment automatically defines one additional substs variable
from all the defines:
from all the defines not appearing in non_global_defines:
- ACDEFINES contains the defines in the form -DNAME=VALUE, for use on
preprocessor command lines. The order in which defines were given
when creating the ConfigEnvironment is preserved.
@ -118,12 +121,13 @@ class ConfigEnvironment(object):
"""
def __init__(self, topsrcdir, topobjdir, defines=None,
substs=None, source=None, mozconfig=None):
non_global_defines=None, substs=None, source=None, mozconfig=None):
if not source:
source = mozpath.join(topobjdir, 'config.status')
self.source = source
self.defines = ReadOnlyDict(defines or {})
self.non_global_defines = non_global_defines or []
self.substs = dict(substs or {})
self.topsrcdir = mozpath.abspath(topsrcdir)
self.topobjdir = mozpath.abspath(topobjdir)
@ -146,7 +150,8 @@ class ConfigEnvironment(object):
self.import_suffix = self.dll_suffix
self.bin_suffix = self.substs.get('BIN_SUFFIX', '')
global_defines = [name for name in self.defines]
global_defines = [name for name in self.defines
if name not in self.non_global_defines]
self.substs["ACDEFINES"] = ' '.join(
[
'-D%s=%s' % (name, shell_quote(self.defines[name]).replace('$', '$$'))
@ -185,7 +190,8 @@ class ConfigEnvironment(object):
@memoized_property
def acdefines(self):
acdefines = dict((name, self.defines[name])
for name in self.defines)
for name in self.defines
if name not in self.non_global_defines)
return ReadOnlyDict(acdefines)
@staticmethod
@ -193,7 +199,7 @@ class ConfigEnvironment(object):
config = BuildConfig.from_config_status(path)
return ConfigEnvironment(config.topsrcdir, config.topobjdir,
config.defines, config.substs, path)
config.defines, config.non_global_defines, config.substs, path)
class PartialConfigDict(object):
@ -308,7 +314,7 @@ class PartialConfigEnvironment(object):
environment.
The PartialConfigEnvironment automatically defines one additional subst variable
from all the defines:
from all the defines not appearing in non_global_defines:
- ACDEFINES contains the defines in the form -DNAME=VALUE, for use on
preprocessor command lines. The order in which defines were given
when creating the ConfigEnvironment is preserved.
@ -331,6 +337,7 @@ class PartialConfigEnvironment(object):
global_defines = [
name for name in config['defines']
if name not in config['non_global_defines']
]
acdefines = ' '.join(['-D%s=%s' % (name,
shell_quote(config['defines'][name]).replace('$', '$$'))

Просмотреть файл

@ -374,6 +374,10 @@ class MozbuildObject(ProcessExecutionMixin):
def defines(self):
return self.config_environment.defines
@property
def non_global_defines(self):
return self.config_environment.non_global_defines
@property
def substs(self):
return self.config_environment.substs

Просмотреть файл

@ -61,8 +61,9 @@ files by running:
'''.strip()
def config_status(topobjdir='.', topsrcdir='.', defines=None, substs=None,
source=None, mozconfig=None, args=sys.argv[1:]):
def config_status(topobjdir='.', topsrcdir='.', defines=None,
non_global_defines=None, substs=None, source=None,
mozconfig=None, args=sys.argv[1:]):
'''Main function, providing config.status functionality.
Contrary to config.status, it doesn't use CONFIG_FILES or CONFIG_HEADERS
@ -112,7 +113,8 @@ def config_status(topobjdir='.', topsrcdir='.', defines=None, substs=None,
if not options.not_topobjdir:
topobjdir = os.path.realpath('.')
env = ConfigEnvironment(topsrcdir, topobjdir, defines=defines, substs=substs,
env = ConfigEnvironment(topsrcdir, topobjdir, defines=defines,
non_global_defines=non_global_defines, substs=substs,
source=source, mozconfig=mozconfig)
with FileAvoidWrite(os.path.join(topobjdir, 'mozinfo.json')) as f:

Просмотреть файл

@ -30,10 +30,12 @@ test_data_path = mozpath.join(test_data_path, 'data')
CONFIGS = defaultdict(lambda: {
'defines': {},
'non_global_defines': [],
'substs': {'OS_TARGET': 'WINNT'},
}, {
'binary-components': {
'defines': {},
'non_global_defines': [],
'substs': {
'LIB_PREFIX': 'lib',
'RUST_LIB_PREFIX': 'lib',
@ -44,6 +46,7 @@ CONFIGS = defaultdict(lambda: {
},
'rust-library': {
'defines': {},
'non_global_defines': [],
'substs': {
'COMPILE_ENVIRONMENT': '1',
'RUST_TARGET': 'x86_64-unknown-linux-gnu',
@ -55,6 +58,7 @@ CONFIGS = defaultdict(lambda: {
},
'host-rust-library': {
'defines': {},
'non_global_defines': [],
'substs': {
'COMPILE_ENVIRONMENT': '1',
'RUST_HOST_TARGET': 'x86_64-unknown-linux-gnu',
@ -67,6 +71,7 @@ CONFIGS = defaultdict(lambda: {
},
'host-rust-library-features': {
'defines': {},
'non_global_defines': [],
'substs': {
'COMPILE_ENVIRONMENT': '1',
'RUST_HOST_TARGET': 'x86_64-unknown-linux-gnu',
@ -79,6 +84,7 @@ CONFIGS = defaultdict(lambda: {
},
'rust-library-features': {
'defines': {},
'non_global_defines': [],
'substs': {
'COMPILE_ENVIRONMENT': '1',
'RUST_TARGET': 'x86_64-unknown-linux-gnu',
@ -90,6 +96,7 @@ CONFIGS = defaultdict(lambda: {
},
'rust-programs': {
'defines': {},
'non_global_defines': [],
'substs': {
'COMPILE_ENVIRONMENT': '1',
'RUST_TARGET': 'i686-pc-windows-msvc',
@ -100,6 +107,7 @@ CONFIGS = defaultdict(lambda: {
},
'test-support-binaries-tracked': {
'defines': {},
'non_global_defines': [],
'substs': {
'COMPILE_ENVIRONMENT': '1',
'LIB_SUFFIX': 'dll',
@ -108,6 +116,7 @@ CONFIGS = defaultdict(lambda: {
},
'sources': {
'defines': {},
'non_global_defines': [],
'substs': {
'LIB_PREFIX': 'lib',
'LIB_SUFFIX': 'a',
@ -118,6 +127,10 @@ CONFIGS = defaultdict(lambda: {
'MOZ_TRUE_1': '1',
'MOZ_TRUE_2': '1',
},
'non_global_defines': [
'MOZ_NONGLOBAL_1',
'MOZ_NONGLOBAL_2',
],
'substs': {
'MOZ_FOO': 'foo',
'MOZ_BAR': 'bar',
@ -125,6 +138,7 @@ CONFIGS = defaultdict(lambda: {
},
'substitute_config_files': {
'defines': {},
'non_global_defines': [],
'substs': {
'MOZ_FOO': 'foo',
'MOZ_BAR': 'bar',
@ -135,18 +149,21 @@ CONFIGS = defaultdict(lambda: {
'foo': 'baz qux',
'baz': 1,
},
'non_global_defines': [],
'substs': {
'foo': 'bar baz',
},
},
'visual-studio': {
'defines': {},
'non_global_defines': [],
'substs': {
'MOZ_APP_NAME': 'my_app',
},
},
'prog-lib-c-only': {
'defines': {},
'non_global_defines': [],
'substs': {
'COMPILE_ENVIRONMENT': '1',
'LIB_SUFFIX': '.a',
@ -155,6 +172,7 @@ CONFIGS = defaultdict(lambda: {
},
'gn-processor': {
'defines': {},
'non_global_defines': [],
'substs': {
'BUILD_BACKENDS': [
'GnMozbuildWriter',
@ -172,6 +190,7 @@ CONFIGS = defaultdict(lambda: {
},
'ipdl_sources': {
'defines': {},
'non_global_defines': [],
'substs': {
'COMPILE_ENVIRONMENT': '1',
'LIB_SUFFIX': '.a',
@ -180,6 +199,7 @@ CONFIGS = defaultdict(lambda: {
},
'program-paths': {
'defines': {},
'non_global_defines': [],
'substs': {
'COMPILE_ENVIRONMENT': '1',
'BIN_SUFFIX': '.prog',
@ -187,6 +207,7 @@ CONFIGS = defaultdict(lambda: {
},
'linkage': {
'defines': {},
'non_global_defines': [],
'substs': {
'CC_TYPE': 'clang',
'COMPILE_ENVIRONMENT': '1',

Просмотреть файл

@ -37,10 +37,12 @@ class TestEnvironment(unittest.TestCase):
'''
env = ConfigEnvironment('.', '.',
defines={'foo': 'bar', 'baz': 'qux 42',
'abc': "d'e'f"},
'abc': "d'e'f", 'extra': 'foobar'},
non_global_defines=['extra', 'ignore'],
substs={'FOO': 'bar', 'FOOBAR': '', 'ABC': 'def',
'bar': 'baz qux', 'zzz': '"abc def"',
'qux': ''})
# non_global_defines should be filtered out in ACDEFINES.
# Original order of the defines need to be respected in ACDEFINES
self.assertEqual(env.substs['ACDEFINES'],
"""-Dabc='d'\\''e'\\''f' -Dbaz='qux 42' -Dfoo=bar""")

Просмотреть файл

@ -18,12 +18,16 @@ config = {
'defines': {
'MOZ_FOO': '1',
'MOZ_BAR': '2',
'MOZ_NON_GLOBAL': '3',
},
'substs': {
'MOZ_SUBST_1': '1',
'MOZ_SUBST_2': '2',
'CPP': 'cpp',
},
'non_global_defines': [
'MOZ_NON_GLOBAL',
],
}

Просмотреть файл

@ -304,9 +304,10 @@ class TestMozbuildObject(unittest.TestCase):
fh.write("topsrcdir = '%s'\n" % topsrcdir)
fh.write("mozconfig = None\n")
fh.write("defines = { 'FOO': 'foo' }\n")
fh.write("non_global_defines = ['BAR']\n")
fh.write("substs = { 'QUX': 'qux' }\n")
fh.write("__all__ = ['topobjdir', 'topsrcdir', 'defines', "
"'substs', 'mozconfig']")
"'non_global_defines', 'substs', 'mozconfig']")
base = self.get_base(topobjdir=d)