Bug 1447611: Remove --enable-stylo and --enable-stylo-build-bindgen. r=froydnj

Will remove the prefs and stuff in a followup.

MozReview-Commit-ID: HVyfbHOEQYI
This commit is contained in:
Emilio Cobos Álvarez 2018-03-21 12:45:06 +01:00
parent 87089c18e5
commit 330ddd82bf
12 changed files with 133 additions and 250 deletions

View File

@ -2,7 +2,7 @@
args = [
"-x", "c++", "-std=c++14", "-fno-sized-deallocation",
"-DTRACING=1", "-DIMPL_LIBXUL", "-DMOZ_STYLO_BINDINGS=1",
"-DMOZILLA_INTERNAL_API", "-DRUST_BINDGEN", "-DMOZ_STYLO"
"-DMOZILLA_INTERNAL_API", "-DRUST_BINDGEN"
]
"family=unix" = ["-DOS_POSIX=1"]
"os=solaris" = ["-DOS_SOLARIS=1"]

View File

@ -482,21 +482,8 @@ let retainedDisplayListsEnabled = prefs.getBoolPref("layout.display-list.retain"
sandbox.retainedDisplayLists = retainedDisplayListsEnabled && !g.compareRetainedDisplayLists;
sandbox.compareRetainedDisplayLists = g.compareRetainedDisplayLists;
#ifdef MOZ_STYLO
let styloEnabled = false;
// Perhaps a bit redundant in places, but this is easier to compare with the
// the real check in `nsLayoutUtils.cpp` to ensure they test the same way.
if (env.get("STYLO_FORCE_ENABLED")) {
styloEnabled = true;
} else if (env.get("STYLO_FORCE_DISABLED")) {
styloEnabled = false;
} else {
styloEnabled = prefs.getBoolPref("layout.css.servo.enabled", false);
}
sandbox.stylo = styloEnabled;
#else
sandbox.stylo = false;
#endif
// TODO(emilio): Remove the remaining reftest expectations that mention stylo.
sandbox.stylo = true;
sandbox.skiaPdf = false;

View File

@ -5920,18 +5920,12 @@ pref("media.block-autoplay-until-in-foreground", true);
// Is Stylo CSS support built and enabled?
// Only define these prefs if Stylo support is actually built in.
#ifdef MOZ_STYLO
#ifdef MOZ_STYLO_ENABLE
pref("layout.css.servo.enabled", true);
#else
pref("layout.css.servo.enabled", false);
#endif
// Whether Stylo is enabled for chrome document?
// If Stylo is not enabled, this pref doesn't take any effect.
// Note that this pref is only read once when requested. Changing it
// at runtime may have no effect.
pref("layout.css.servo.chrome.enabled", true);
#endif
// TODO: Bug 1324406: Treat 'data:' documents as unique, opaque origins
// If true, data: URIs will be treated as unique opaque origins, hence will use

View File

@ -83,7 +83,8 @@ def build_dict(config, env=os.environ):
d['datareporting'] = bool(substs.get('MOZ_DATA_REPORTING'))
d['healthreport'] = substs.get('MOZ_SERVICES_HEALTHREPORT') == '1'
d['sync'] = substs.get('MOZ_SERVICES_SYNC') == '1'
d['stylo'] = substs.get('MOZ_STYLO_ENABLE') == '1'
# FIXME(emilio): We need to update a lot of WPT expectations before removing this.
d['stylo'] = True
d['asan'] = substs.get('MOZ_ASAN') == '1'
d['tsan'] = substs.get('MOZ_TSAN') == '1'
d['ubsan'] = substs.get('MOZ_UBSAN') == '1'

View File

@ -69,9 +69,6 @@ class MachCommands(MachCommandBase):
else:
os.environ['STYLO_THREADS'] = '4'
if 'enable_stylo' in kwargs and kwargs['enable_stylo']:
os.environ['STYLO_FORCE_ENABLED'] = '1'
if 'enable_webrender' in kwargs and kwargs['enable_webrender']:
os.environ['MOZ_WEBRENDER'] = '1'
os.environ['MOZ_ACCELERATED'] = '1'
@ -205,9 +202,6 @@ class MachCommands(MachCommandBase):
dest='settleWaitTime',
help='Seconds to wait for things to settled down. '
'Defaults to %s.' % SETTLE_WAIT_TIME)
@CommandArgument('--enable-stylo', group='AWSY', action='store_true',
dest='enable_stylo', default=False,
help='Enable Stylo.')
@CommandArgument('--single-stylo-traversal', group='AWSY', action='store_true',
dest='single_stylo_traversal', default=False,
help='Set STYLO_THREADS=1.')

View File

@ -163,12 +163,6 @@ class DesktopUnittest(TestingMixin, MercurialScript, BlobUploadMixin, MozbaseMix
"default": False,
"help": "Forcibly enable single thread traversal in Stylo with STYLO_THREADS=1"}
],
[["--enable-stylo"], {
"action": "store_true",
"dest": "enable_stylo",
"default": False,
"help": "Run tests with Stylo enabled"}
],
[["--enable-webrender"], {
"action": "store_true",
"dest": "enable_webrender",

View File

@ -88,18 +88,6 @@ class WebPlatformTest(TestingMixin, MercurialScript, BlobUploadMixin, CodeCovera
"default": False,
"help": "Forcibly enable single thread traversal in Stylo with STYLO_THREADS=1"}
],
[["--enable-stylo"], {
"action": "store_true",
"dest": "enable_stylo",
"default": False,
"help": "Run tests with Stylo enabled"}
],
[["--disable-stylo"], {
"action": "store_true",
"dest": "disable_stylo",
"default": False,
"help": "Run tests with Stylo disabled"}
],
] + copy.deepcopy(testing_config_options) + \
copy.deepcopy(blobupload_config_options) + \
copy.deepcopy(code_coverage_config_options)
@ -322,20 +310,11 @@ class WebPlatformTest(TestingMixin, MercurialScript, BlobUploadMixin, CodeCovera
env['MOZ_HEADLESS_WIDTH'] = self.config['headless_width']
env['MOZ_HEADLESS_HEIGHT'] = self.config['headless_height']
if self.config['disable_stylo']:
if self.config['single_stylo_traversal']:
self.fatal("--disable-stylo conflicts with --single-stylo-traversal")
if self.config['enable_stylo']:
self.fatal("--disable-stylo conflicts with --enable-stylo")
if self.config['single_stylo_traversal']:
env['STYLO_THREADS'] = '1'
else:
env['STYLO_THREADS'] = '4'
if self.config['enable_stylo']:
env['STYLO_FORCE_ENABLED'] = '1'
env = self.query_env(partial_env=env, log_level=INFO)
start_time = datetime.now()

View File

@ -4,15 +4,10 @@
# 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/.
gkrust_features = []
if CONFIG['MOZ_STYLO']:
gkrust_features += ['servo']
gkrust_features = ['servo', 'bindgen']
if CONFIG['MOZ_STYLO_BINDGEN']:
gkrust_features += ['bindgen']
if CONFIG['MOZ_DEBUG']:
gkrust_features += ['gecko_debug']
if CONFIG['MOZ_DEBUG']:
gkrust_features += ['gecko_debug']
if CONFIG['MOZ_BUILD_WEBRENDER']:
gkrust_features += ['quantum_render']

View File

@ -334,11 +334,5 @@ this.AppConstants = Object.freeze({
false,
#endif
MOZ_STYLO:
#ifdef MOZ_STYLO
true,
#else
false,
#endif
MOZ_STYLO: true,
});

View File

@ -550,47 +550,6 @@ id_and_secret_keyfile('Leanplum SDK')
simple_keyfile('Pocket API')
# Servo integration
# ==============================================================
option('--enable-stylo', nargs='?', choices=('build',),
help='Include Stylo in the build. "build" means to disable Stylo at ' +
'runtime.')
@depends('--enable-stylo', '--help')
def stylo_config(value, _):
# If nothing is specified, default to building and enabling Stylo,
# and not building the old style system.
build_stylo = True
enable_stylo = True
old_style = None
if len(value) and value[0] == 'build':
# Build but disable by request.
enable_stylo = None
old_style = True
elif value.origin != 'default' and not bool(value):
# Disable stylo entirely.
old_style = True
build_stylo = None
enable_stylo = None
return namespace(
build = build_stylo,
enable = enable_stylo,
old_style = old_style,
)
option('--disable-stylo-build-bindgen',
help='Disable build-time bindgen for Stylo')
@depends('--enable-stylo-build-bindgen', '--enable-compile-environment')
def building_stylo_bindgen(bindgen_enabled, compile_environment):
if not compile_environment:
return False
if not bindgen_enabled:
return False
return True
# We support setting up the appropriate options for Stylo's build-time
# bindings generation via setting LLVM_CONFIG or by providing explicit
# configure options. The Windows installer of LLVM/Clang doesn't provide
@ -640,161 +599,151 @@ def llvm_config_paths(host):
return llvm_config_progs
llvm_config = check_prog('LLVM_CONFIG', llvm_config_paths,
when=building_stylo_bindgen,
what='llvm-config', allow_missing=True)
with only_when(building_stylo_bindgen):
option('--with-libclang-path', nargs=1,
help='Absolute path to a directory containing Clang/LLVM libraries for Stylo (version 3.9.x or above)')
option('--with-clang-path', nargs=1,
help='Absolute path to a Clang binary for Stylo bindgen (version 3.9.x or above)')
option('--with-libclang-path', nargs=1,
help='Absolute path to a directory containing Clang/LLVM libraries for Stylo (version 3.9.x or above)')
option('--with-clang-path', nargs=1,
help='Absolute path to a Clang binary for Stylo bindgen (version 3.9.x or above)')
def invoke_llvm_config(llvm_config, *options):
'''Invoke llvm_config with the given options and return the first line of
output.'''
lines = check_cmd_output(llvm_config, *options).splitlines()
return lines[0]
def invoke_llvm_config(llvm_config, *options):
'''Invoke llvm_config with the given options and return the first line of
output.'''
lines = check_cmd_output(llvm_config, *options).splitlines()
return lines[0]
@imports(_from='textwrap', _import='dedent')
def check_minimum_llvm_config_version(llvm_config):
version = Version(invoke_llvm_config(llvm_config, '--version'))
min_version = Version('3.9.0')
if version < min_version:
@imports(_from='textwrap', _import='dedent')
def check_minimum_llvm_config_version(llvm_config):
version = Version(invoke_llvm_config(llvm_config, '--version'))
min_version = Version('3.9.0')
if version < min_version:
die(dedent('''\
llvm installation {} is incompatible with Stylo bindgen.
To compile Stylo, please install version {} or greater of
Clang + LLVM and ensure that the 'llvm-config' from that
installation is first on your path.
You can verify this by typing 'llvm-config --version'.
'''.format(version, min_version)))
@depends(llvm_config, '--with-libclang-path', '--with-clang-path',
host_library_name_info, host)
@imports('os.path')
@imports('glob')
@imports(_from='textwrap', _import='dedent')
def bindgen_config_paths(llvm_config, libclang_path, clang_path,
library_name_info, host):
def search_for_libclang(path):
# Try to ensure that the clang shared library that bindgen is going
# to look for is actually present. The files that we search for
# mirror the logic in clang-sys/build.rs.
libclang_choices = []
if host.os == 'WINNT':
libclang_choices.append('libclang.dll')
libclang_choices.append('%sclang%s' % (library_name_info.dll.prefix,
library_name_info.dll.suffix))
if host.kernel == 'Linux':
libclang_choices.append('libclang.so.1')
if host.os == 'OpenBSD':
libclang_choices = glob.glob(path + '/libclang.so.*.*')
# At least one of the choices must be found.
for choice in libclang_choices:
libclang = os.path.join(path, choice)
if os.path.exists(libclang):
return (True, None)
else:
return (False, list(set(libclang_choices)))
if not libclang_path and not clang_path:
# We must have LLVM_CONFIG in this case.
if not llvm_config:
die(dedent('''\
llvm installation {} is incompatible with Stylo bindgen.
Could not find LLVM/Clang installation for compiling stylo build-time
bindgen. Please specify the 'LLVM_CONFIG' environment variable
(recommended), pass the '--with-libclang-path' and '--with-clang-path'
options to configure, or put 'llvm-config' in your PATH. Altering your
PATH may expose 'clang' as well, potentially altering your compiler,
which may not be what you intended.'''))
To compile Stylo, please install version {} or greater of
Clang + LLVM and ensure that the 'llvm-config' from that
installation is first on your path.
check_minimum_llvm_config_version(llvm_config)
libclang_arg = '--bindir' if host.os == 'WINNT' else '--libdir'
libclang_path = invoke_llvm_config(llvm_config, libclang_arg)
clang_path = os.path.join(invoke_llvm_config(llvm_config, '--bindir'),
'clang')
libclang_path = normsep(libclang_path)
clang_path = normsep(clang_path)
You can verify this by typing 'llvm-config --version'.
'''.format(version, min_version)))
@depends(llvm_config, '--with-libclang-path', '--with-clang-path',
host_library_name_info, host)
@imports('os.path')
@imports('glob')
@imports(_from='textwrap', _import='dedent')
def bindgen_config_paths(llvm_config, libclang_path, clang_path,
library_name_info, host):
def search_for_libclang(path):
# Try to ensure that the clang shared library that bindgen is going
# to look for is actually present. The files that we search for
# mirror the logic in clang-sys/build.rs.
libclang_choices = []
if host.os == 'WINNT':
libclang_choices.append('libclang.dll')
libclang_choices.append('%sclang%s' % (library_name_info.dll.prefix,
library_name_info.dll.suffix))
if host.kernel == 'Linux':
libclang_choices.append('libclang.so.1')
if host.os == 'OpenBSD':
libclang_choices = glob.glob(path + '/libclang.so.*.*')
# At least one of the choices must be found.
for choice in libclang_choices:
libclang = os.path.join(path, choice)
if os.path.exists(libclang):
return (True, None)
else:
return (False, list(set(libclang_choices)))
if not libclang_path and not clang_path:
# We must have LLVM_CONFIG in this case.
if not llvm_config:
die(dedent('''\
Could not find LLVM/Clang installation for compiling stylo build-time
bindgen. Please specify the 'LLVM_CONFIG' environment variable
(recommended), pass the '--with-libclang-path' and '--with-clang-path'
options to configure, or put 'llvm-config' in your PATH. Altering your
PATH may expose 'clang' as well, potentially altering your compiler,
which may not be what you intended.'''))
check_minimum_llvm_config_version(llvm_config)
libclang_arg = '--bindir' if host.os == 'WINNT' else '--libdir'
libclang_path = invoke_llvm_config(llvm_config, libclang_arg)
clang_path = os.path.join(invoke_llvm_config(llvm_config, '--bindir'),
'clang')
libclang_path = normsep(libclang_path)
clang_path = normsep(clang_path)
# Debian-based distros, at least, can have llvm-config installed
# but not have other packages installed. Since the user is trying
# to use their system packages, we can't be more specific about what
# they need.
clang_resolved = find_program(clang_path)
if not clang_resolved:
die(dedent('''\
The file {} returned by `llvm-config {}` does not exist.
clang is required to build Stylo. Please install the necessary packages,
run `mach bootstrap`, or add --disable-stylo to your mozconfig.
'''.format(clang_path, '--bindir')))
if not os.path.exists(libclang_path):
die(dedent('''\
The directory {} returned by `llvm-config {}` does not exist.
clang is required to build Stylo. Please install the necessary packages,
run `mach bootstrap`, or add --disable-stylo to your mozconfig.
'''.format(libclang_path, libclang_arg)))
(found, searched) = search_for_libclang(libclang_path)
if not found:
die(dedent('''\
Could not find the clang shared library in the path {}
returned by `llvm-config {}` (searched for files {}).
clang is required to build Stylo. Please install the necessary packages,
run `mach bootstrap`, or add --disable-stylo to your mozconfig.
'''.format(libclang_path, libclang_arg, searched)))
return namespace(
libclang_path=libclang_path,
clang_path=clang_resolved,
)
if (not libclang_path and clang_path) or \
(libclang_path and not clang_path):
# Debian-based distros, at least, can have llvm-config installed
# but not have other packages installed. Since the user is trying
# to use their system packages, we can't be more specific about what
# they need.
clang_resolved = find_program(clang_path)
if not clang_resolved:
die(dedent('''\
You must provide both of --with-libclang-path and --with-clang-path
or neither of them.'''))
The file {} returned by `llvm-config {}` does not exist.
clang is required to build Firefox. Please install the necessary
packages, or run `mach bootstrap`.
'''.format(clang_path, '--bindir')))
libclang_path = libclang_path[0]
clang_path = clang_path[0]
if not os.path.exists(libclang_path) or \
not os.path.isdir(libclang_path):
if not os.path.exists(libclang_path):
die(dedent('''\
The argument to --with-libclang-path is not a directory: {}
'''.format(libclang_path)))
The directory {} returned by `llvm-config {}` does not exist.
clang is required to build Firefox. Please install the necessary
packages, or run `mach bootstrap`.
'''.format(libclang_path, libclang_arg)))
(found, searched) = search_for_libclang(libclang_path)
if not found:
die(dedent('''\
Could not find the clang shared library in the path {}
specified by --with-libclang-path (searched for files {}).
'''.format(libclang_path, searched)))
clang_resolved = find_program(clang_path)
if not clang_resolved:
die(dedent('''\
The argument to --with-clang-path is not a file: {}
'''.format(clang_path)))
returned by `llvm-config {}` (searched for files {}).
clang is required to build Firefox. Please install the necessary
packages, or run `mach bootstrap`.
'''.format(libclang_path, libclang_arg, searched)))
return namespace(
libclang_path=libclang_path,
clang_path=clang_resolved,
)
set_config('MOZ_LIBCLANG_PATH', bindgen_config_paths.libclang_path)
set_config('MOZ_CLANG_PATH', bindgen_config_paths.clang_path)
set_config('MOZ_STYLO_BINDGEN', depends_if('--enable-stylo-build-bindgen')(lambda _: True))
if (not libclang_path and clang_path) or \
(libclang_path and not clang_path):
die(dedent('''\
You must provide both of --with-libclang-path and --with-clang-path
or neither of them.'''))
set_config('MOZ_STYLO', stylo_config.build)
set_define('MOZ_STYLO', stylo_config.build)
set_config('MOZ_STYLO_ENABLE', stylo_config.enable)
set_define('MOZ_STYLO_ENABLE', stylo_config.enable)
set_config('MOZ_OLD_STYLE', stylo_config.old_style)
set_define('MOZ_OLD_STYLE', stylo_config.old_style)
libclang_path = libclang_path[0]
clang_path = clang_path[0]
if not os.path.exists(libclang_path) or \
not os.path.isdir(libclang_path):
die(dedent('''\
The argument to --with-libclang-path is not a directory: {}
'''.format(libclang_path)))
(found, searched) = search_for_libclang(libclang_path)
if not found:
die(dedent('''\
Could not find the clang shared library in the path {}
specified by --with-libclang-path (searched for files {}).
'''.format(libclang_path, searched)))
clang_resolved = find_program(clang_path)
if not clang_resolved:
die(dedent('''\
The argument to --with-clang-path is not a file: {}
'''.format(clang_path)))
return namespace(
libclang_path=libclang_path,
clang_path=clang_resolved,
)
set_config('MOZ_LIBCLANG_PATH', bindgen_config_paths.libclang_path)
set_config('MOZ_CLANG_PATH', bindgen_config_paths.clang_path)
option('--with-servo', env='SERVO_TARGET_DIR', nargs=1,
help='Absolute path of the target directory where libgeckoservo can '

View File

@ -91,13 +91,11 @@ ifdef MOZ_ASAN
$(PYTHON) $(MOZILLA_DIR)/build/unix/rewrite_asan_dylib.py $(DIST)/$(MOZ_PKG_DIR)$(_BINPATH)
endif # MOZ_ASAN
endif # Darwin
ifdef MOZ_STYLO
ifndef MOZ_ARTIFACT_BUILDS
@echo 'Packing stylo binding files...'
cd '$(DIST)/rust_bindings/style' && \
zip -r5D '$(ABS_DIST)/$(PKG_PATH)$(STYLO_BINDINGS_PACKAGE)' .
endif # MOZ_ARTIFACT_BUILDS
endif # MOZ_STYLO
prepare-package: stage-package

View File

@ -407,6 +407,7 @@ UPLOAD_FILES= \
$(call QUOTED_WILDCARD,$(topobjdir)/$(MOZ_BUILD_APP)/installer/windows/instgen/setup.exe) \
$(call QUOTED_WILDCARD,$(topobjdir)/$(MOZ_BUILD_APP)/installer/windows/instgen/setup-stub.exe) \
$(call QUOTED_WILDCARD,$(topsrcdir)/toolchains.json) \
$(call QUOTED_WILDCARD,$(DIST)/$(PKG_PATH)$(STYLO_BINDINGS_PACKAGE)) \
$(if $(UPLOAD_EXTRA_FILES), $(foreach f, $(UPLOAD_EXTRA_FILES), $(wildcard $(DIST)/$(f))))
ifneq ($(filter-out en-US x-test,$(AB_CD)),)
@ -423,9 +424,6 @@ ifdef MOZ_CODE_COVERAGE
$(NULL)
endif
ifdef MOZ_STYLO
UPLOAD_FILES += $(call QUOTED_WILDCARD,$(DIST)/$(PKG_PATH)$(STYLO_BINDINGS_PACKAGE))
endif
ifdef ENABLE_MOZSEARCH_PLUGIN
UPLOAD_FILES += $(call QUOTED_WILDCARD,$(DIST)/$(PKG_PATH)$(MOZSEARCH_ARCHIVE_BASENAME).zip)