mirror of
https://github.com/servo/servo.git
synced 2025-07-24 15:50:21 +01:00
Remove geckolib-related build commands.
This commit is contained in:
parent
66ff70dd3e
commit
a440a0bdaf
11 changed files with 12 additions and 165 deletions
|
@ -2,9 +2,6 @@
|
||||||
members = [
|
members = [
|
||||||
"ports/servo",
|
"ports/servo",
|
||||||
"tests/unit/*",
|
"tests/unit/*",
|
||||||
|
|
||||||
"ports/geckolib",
|
|
||||||
"ports/geckolib/tests",
|
|
||||||
]
|
]
|
||||||
default-members = [
|
default-members = [
|
||||||
"ports/servo",
|
"ports/servo",
|
||||||
|
|
|
@ -8,4 +8,4 @@ set -o errexit
|
||||||
set -o nounset
|
set -o nounset
|
||||||
set -o pipefail
|
set -o pipefail
|
||||||
|
|
||||||
rm -rf target/{debug,release,doc,geckolib}
|
rm -rf target/{debug,release,doc}
|
||||||
|
|
|
@ -1,6 +0,0 @@
|
||||||
<!doctype html>
|
|
||||||
<title>Geckolib, a subset of Servo’s style system for Stylo project.</title>
|
|
||||||
<meta http-equiv=refresh content="0;url=geckoservo/index.html">
|
|
||||||
|
|
||||||
Documentation for Geckolib, a subset of Servo’s style system for Stylo project.
|
|
||||||
Start with <a href="geckoservo/index.html">the <code>geckoservo</code> crate</a>
|
|
|
@ -1 +0,0 @@
|
||||||
1.24.0
|
|
|
@ -128,17 +128,14 @@ class MachCommands(CommandBase):
|
||||||
help='Keep up to this many most recent nightlies')
|
help='Keep up to this many most recent nightlies')
|
||||||
def clean_nightlies(self, force=False, keep=None):
|
def clean_nightlies(self, force=False, keep=None):
|
||||||
default_toolchain = self.default_toolchain()
|
default_toolchain = self.default_toolchain()
|
||||||
geckolib_toolchain = self.geckolib_toolchain()
|
|
||||||
print("Current Rust version for Servo: {}".format(default_toolchain))
|
print("Current Rust version for Servo: {}".format(default_toolchain))
|
||||||
print("Current Rust version for geckolib: {}".format(geckolib_toolchain))
|
|
||||||
old_toolchains = []
|
old_toolchains = []
|
||||||
keep = int(keep)
|
keep = int(keep)
|
||||||
for toolchain_file in ['rust-toolchain', 'geckolib-rust-toolchain']:
|
stdout = subprocess.check_output(['git', 'log', '--format=%H', 'rust-toolchain'])
|
||||||
stdout = subprocess.check_output(['git', 'log', '--format=%H', toolchain_file])
|
|
||||||
for i, commit_hash in enumerate(stdout.split(), 1):
|
for i, commit_hash in enumerate(stdout.split(), 1):
|
||||||
if i > keep:
|
if i > keep:
|
||||||
toolchain = subprocess.check_output(
|
toolchain = subprocess.check_output(
|
||||||
['git', 'show', '%s:%s' % (commit_hash, toolchain_file)])
|
['git', 'show', '%s:rust-toolchain' % commit_hash])
|
||||||
old_toolchains.append(toolchain.strip())
|
old_toolchains.append(toolchain.strip())
|
||||||
|
|
||||||
removing_anything = False
|
removing_anything = False
|
||||||
|
|
|
@ -386,49 +386,6 @@ class MachCommands(CommandBase):
|
||||||
print("Build %s in %s" % ("Completed" if status == 0 else "FAILED", format_duration(elapsed)))
|
print("Build %s in %s" % ("Completed" if status == 0 else "FAILED", format_duration(elapsed)))
|
||||||
return status
|
return status
|
||||||
|
|
||||||
@Command('build-geckolib',
|
|
||||||
description='Build a static library of components used by Gecko',
|
|
||||||
category='build')
|
|
||||||
@CommandArgument('--jobs', '-j',
|
|
||||||
default=None,
|
|
||||||
help='Number of jobs to run in parallel')
|
|
||||||
@CommandArgument('--verbose', '-v',
|
|
||||||
action='store_true',
|
|
||||||
help='Print verbose output')
|
|
||||||
@CommandArgument('--release', '-r',
|
|
||||||
action='store_true',
|
|
||||||
help='Build in release mode')
|
|
||||||
def build_geckolib(self, jobs=None, verbose=False, release=False):
|
|
||||||
self.set_use_geckolib_toolchain()
|
|
||||||
self.ensure_bootstrapped()
|
|
||||||
self.ensure_clobbered()
|
|
||||||
|
|
||||||
env = self.build_env(is_build=True, geckolib=True)
|
|
||||||
|
|
||||||
ret = None
|
|
||||||
opts = ["-p", "geckoservo"]
|
|
||||||
features = []
|
|
||||||
|
|
||||||
if jobs is not None:
|
|
||||||
opts += ["-j", jobs]
|
|
||||||
if verbose:
|
|
||||||
opts += ["-v"]
|
|
||||||
if release:
|
|
||||||
opts += ["--release"]
|
|
||||||
if features:
|
|
||||||
opts += ["--features", ' '.join(features)]
|
|
||||||
|
|
||||||
build_start = time()
|
|
||||||
ret = self.call_rustup_run(["cargo", "build"] + opts, env=env, verbose=verbose)
|
|
||||||
elapsed = time() - build_start
|
|
||||||
|
|
||||||
# Generate Desktop Notification if elapsed-time > some threshold value
|
|
||||||
notify_build_done(self.config, elapsed)
|
|
||||||
|
|
||||||
print("GeckoLib build completed in %s" % format_duration(elapsed))
|
|
||||||
|
|
||||||
return ret
|
|
||||||
|
|
||||||
@Command('clean',
|
@Command('clean',
|
||||||
description='Clean the build directory.',
|
description='Clean the build directory.',
|
||||||
category='build')
|
category='build')
|
||||||
|
|
|
@ -285,28 +285,11 @@ class CommandBase(object):
|
||||||
# Set default android target
|
# Set default android target
|
||||||
self.handle_android_target("armv7-linux-androideabi")
|
self.handle_android_target("armv7-linux-androideabi")
|
||||||
|
|
||||||
self.set_use_geckolib_toolchain(False)
|
|
||||||
|
|
||||||
_use_geckolib_toolchain = False
|
|
||||||
_geckolib_toolchain = None
|
|
||||||
_default_toolchain = None
|
_default_toolchain = None
|
||||||
|
|
||||||
def set_use_geckolib_toolchain(self, use_geckolib_toolchain=True):
|
|
||||||
self._use_geckolib_toolchain = use_geckolib_toolchain
|
|
||||||
|
|
||||||
def toolchain(self):
|
def toolchain(self):
|
||||||
if self._use_geckolib_toolchain:
|
|
||||||
return self.geckolib_toolchain()
|
|
||||||
else:
|
|
||||||
return self.default_toolchain()
|
return self.default_toolchain()
|
||||||
|
|
||||||
def geckolib_toolchain(self):
|
|
||||||
if self._geckolib_toolchain is None:
|
|
||||||
filename = path.join(self.context.topdir, "geckolib-rust-toolchain")
|
|
||||||
with open(filename) as f:
|
|
||||||
self._geckolib_toolchain = f.read().strip()
|
|
||||||
return self._geckolib_toolchain
|
|
||||||
|
|
||||||
def default_toolchain(self):
|
def default_toolchain(self):
|
||||||
if self._default_toolchain is None:
|
if self._default_toolchain is None:
|
||||||
filename = path.join(self.context.topdir, "rust-toolchain")
|
filename = path.join(self.context.topdir, "rust-toolchain")
|
||||||
|
@ -474,7 +457,7 @@ class CommandBase(object):
|
||||||
bin_folder = path.join(destination_folder, "PFiles", "Mozilla research", "Servo Tech Demo")
|
bin_folder = path.join(destination_folder, "PFiles", "Mozilla research", "Servo Tech Demo")
|
||||||
return path.join(bin_folder, "servo{}".format(BIN_SUFFIX))
|
return path.join(bin_folder, "servo{}".format(BIN_SUFFIX))
|
||||||
|
|
||||||
def build_env(self, hosts_file_path=None, target=None, is_build=False, geckolib=False, test_unit=False):
|
def build_env(self, hosts_file_path=None, target=None, is_build=False, test_unit=False):
|
||||||
"""Return an extended environment dictionary."""
|
"""Return an extended environment dictionary."""
|
||||||
env = os.environ.copy()
|
env = os.environ.copy()
|
||||||
if sys.platform == "win32" and type(env['PATH']) == unicode:
|
if sys.platform == "win32" and type(env['PATH']) == unicode:
|
||||||
|
@ -593,10 +576,7 @@ class CommandBase(object):
|
||||||
|
|
||||||
env['GIT_INFO'] = '-'.join(git_info)
|
env['GIT_INFO'] = '-'.join(git_info)
|
||||||
|
|
||||||
if geckolib:
|
if self.config["build"]["thinlto"]:
|
||||||
geckolib_build_path = path.join(self.context.topdir, "target", "geckolib").encode("UTF-8")
|
|
||||||
env["CARGO_TARGET_DIR"] = geckolib_build_path
|
|
||||||
elif self.config["build"]["thinlto"]:
|
|
||||||
env['RUSTFLAGS'] += " -Z thinlto"
|
env['RUSTFLAGS'] += " -Z thinlto"
|
||||||
|
|
||||||
return env
|
return env
|
||||||
|
@ -607,9 +587,6 @@ class CommandBase(object):
|
||||||
def servo_manifest(self):
|
def servo_manifest(self):
|
||||||
return path.join(self.context.topdir, "ports", "servo", "Cargo.toml")
|
return path.join(self.context.topdir, "ports", "servo", "Cargo.toml")
|
||||||
|
|
||||||
def geckolib_manifest(self):
|
|
||||||
return path.join(self.context.topdir, "ports", "geckolib", "Cargo.toml")
|
|
||||||
|
|
||||||
def servo_features(self):
|
def servo_features(self):
|
||||||
"""Return a list of optional features to enable for the Servo crate"""
|
"""Return a list of optional features to enable for the Servo crate"""
|
||||||
features = []
|
features = []
|
||||||
|
|
|
@ -28,29 +28,17 @@ from servo.util import STATIC_RUST_LANG_ORG_DIST, URLOPEN_KWARGS
|
||||||
|
|
||||||
@CommandProvider
|
@CommandProvider
|
||||||
class MachCommands(CommandBase):
|
class MachCommands(CommandBase):
|
||||||
def run_cargo(self, params, geckolib=False, check=False):
|
def run_cargo(self, params, check=False):
|
||||||
if not params:
|
if not params:
|
||||||
params = []
|
params = []
|
||||||
|
|
||||||
self.ensure_bootstrapped()
|
self.ensure_bootstrapped()
|
||||||
self.ensure_clobbered()
|
self.ensure_clobbered()
|
||||||
env = self.build_env(geckolib=geckolib)
|
env = self.build_env()
|
||||||
|
|
||||||
if check:
|
if check:
|
||||||
params = ['check'] + params
|
params = ['check'] + params
|
||||||
|
|
||||||
if geckolib:
|
|
||||||
# for c in $(cargo --list | tail -$(($(cargo --list | wc -l) - 1))); do
|
|
||||||
# (cargo help $c 2>&1 | grep "\\--package" >/dev/null 2>&1) && echo $c
|
|
||||||
# done
|
|
||||||
if params and params[0] in [
|
|
||||||
'bench', 'build', 'check', 'clean', 'doc', 'fmt', 'pkgid',
|
|
||||||
'run', 'rustc', 'rustdoc', 'test', 'update',
|
|
||||||
]:
|
|
||||||
params[1:1] = ['--package', 'geckoservo']
|
|
||||||
|
|
||||||
self.set_use_geckolib_toolchain()
|
|
||||||
|
|
||||||
build_start = time()
|
build_start = time()
|
||||||
status = self.call_rustup_run(["cargo"] + params, env=env)
|
status = self.call_rustup_run(["cargo"] + params, env=env)
|
||||||
elapsed = time() - build_start
|
elapsed = time() - build_start
|
||||||
|
@ -71,15 +59,6 @@ class MachCommands(CommandBase):
|
||||||
def cargo(self, params):
|
def cargo(self, params):
|
||||||
return self.run_cargo(params)
|
return self.run_cargo(params)
|
||||||
|
|
||||||
@Command('cargo-geckolib',
|
|
||||||
description='Run Cargo with the same compiler version and root crate as build-geckolib',
|
|
||||||
category='devenv')
|
|
||||||
@CommandArgument(
|
|
||||||
'params', default=None, nargs='...',
|
|
||||||
help="Command-line arguments to be passed through to Cargo")
|
|
||||||
def cargo_geckolib(self, params):
|
|
||||||
return self.run_cargo(params, geckolib=True)
|
|
||||||
|
|
||||||
@Command('check',
|
@Command('check',
|
||||||
description='Run "cargo check"',
|
description='Run "cargo check"',
|
||||||
category='devenv')
|
category='devenv')
|
||||||
|
@ -89,15 +68,6 @@ class MachCommands(CommandBase):
|
||||||
def check(self, params):
|
def check(self, params):
|
||||||
return self.run_cargo(params, check=True)
|
return self.run_cargo(params, check=True)
|
||||||
|
|
||||||
@Command('check-geckolib',
|
|
||||||
description='Run "cargo check" with the same compiler version and root crate as build-geckolib',
|
|
||||||
category='devenv')
|
|
||||||
@CommandArgument(
|
|
||||||
'params', default=None, nargs='...',
|
|
||||||
help="Command-line arguments to be passed through to cargo check")
|
|
||||||
def check_geckolib(self, params):
|
|
||||||
return self.run_cargo(params, check=True, geckolib=True)
|
|
||||||
|
|
||||||
@Command('cargo-update',
|
@Command('cargo-update',
|
||||||
description='Same as update-cargo',
|
description='Same as update-cargo',
|
||||||
category='devenv')
|
category='devenv')
|
||||||
|
@ -212,22 +182,6 @@ class MachCommands(CommandBase):
|
||||||
self.ensure_bootstrapped()
|
self.ensure_bootstrapped()
|
||||||
return self.call_rustup_run(["rustc"] + params, env=self.build_env())
|
return self.call_rustup_run(["rustc"] + params, env=self.build_env())
|
||||||
|
|
||||||
@Command('rustc-geckolib',
|
|
||||||
description='Run the Rust compiler with the same compiler version and root crate as build-geckolib',
|
|
||||||
category='devenv')
|
|
||||||
@CommandArgument(
|
|
||||||
'params', default=None, nargs='...',
|
|
||||||
help="Command-line arguments to be passed through to rustc")
|
|
||||||
def rustc_geckolib(self, params):
|
|
||||||
if params is None:
|
|
||||||
params = []
|
|
||||||
|
|
||||||
self.set_use_geckolib_toolchain()
|
|
||||||
self.ensure_bootstrapped()
|
|
||||||
env = self.build_env(geckolib=True)
|
|
||||||
|
|
||||||
return self.call_rustup_run(["rustc"] + params, env=env)
|
|
||||||
|
|
||||||
@Command('grep',
|
@Command('grep',
|
||||||
description='`git grep` for selected directories.',
|
description='`git grep` for selected directories.',
|
||||||
category='devenv')
|
category='devenv')
|
||||||
|
|
|
@ -295,28 +295,6 @@ class MachCommands(CommandBase):
|
||||||
if err is not 0:
|
if err is not 0:
|
||||||
return err
|
return err
|
||||||
|
|
||||||
@Command('test-stylo',
|
|
||||||
description='Run stylo unit tests',
|
|
||||||
category='testing')
|
|
||||||
@CommandArgument('test_name', nargs=argparse.REMAINDER,
|
|
||||||
help="Only run tests that match this pattern or file path")
|
|
||||||
@CommandArgument('--release', default=False, action="store_true",
|
|
||||||
help="Run with a release build of servo")
|
|
||||||
def test_stylo(self, release=False, test_name=None):
|
|
||||||
self.set_use_geckolib_toolchain()
|
|
||||||
self.ensure_bootstrapped()
|
|
||||||
|
|
||||||
env = self.build_env()
|
|
||||||
env["RUST_BACKTRACE"] = "1"
|
|
||||||
env["CARGO_TARGET_DIR"] = path.join(self.context.topdir, "target", "geckolib").encode("UTF-8")
|
|
||||||
|
|
||||||
args = (
|
|
||||||
["cargo", "test", "--manifest-path", self.geckolib_manifest(), "-p", "stylo_tests"] +
|
|
||||||
(["--release"] if release else []) +
|
|
||||||
(test_name or [])
|
|
||||||
)
|
|
||||||
return self.call_rustup_run(args, env=env)
|
|
||||||
|
|
||||||
@Command('test-content',
|
@Command('test-content',
|
||||||
description='Run the content tests',
|
description='Run the content tests',
|
||||||
category='testing')
|
category='testing')
|
||||||
|
|
|
@ -490,7 +490,6 @@ def check_rust(file_name, lines):
|
||||||
if not file_name.endswith(".rs") or \
|
if not file_name.endswith(".rs") or \
|
||||||
file_name.endswith(".mako.rs") or \
|
file_name.endswith(".mako.rs") or \
|
||||||
file_name.endswith(os.path.join("style", "build.rs")) or \
|
file_name.endswith(os.path.join("style", "build.rs")) or \
|
||||||
file_name.endswith(os.path.join("geckolib", "build.rs")) or \
|
|
||||||
file_name.endswith(os.path.join("unit", "style", "stylesheets.rs")):
|
file_name.endswith(os.path.join("unit", "style", "stylesheets.rs")):
|
||||||
raise StopIteration
|
raise StopIteration
|
||||||
|
|
||||||
|
|
|
@ -55,11 +55,6 @@ files = [
|
||||||
"./components/style/properties/helpers/animated_properties.mako.rs",
|
"./components/style/properties/helpers/animated_properties.mako.rs",
|
||||||
# Helper macro where actually a pseudo-element per line makes sense.
|
# Helper macro where actually a pseudo-element per line makes sense.
|
||||||
"./components/style/gecko/non_ts_pseudo_class_list.rs",
|
"./components/style/gecko/non_ts_pseudo_class_list.rs",
|
||||||
# Generated and upstream code combined with our own. Could use cleanup
|
|
||||||
"./components/style/gecko/generated/bindings.rs",
|
|
||||||
"./components/style/gecko/generated/pseudo_element_definition.rs",
|
|
||||||
"./components/style/gecko/generated/structs.rs",
|
|
||||||
"./components/style/gecko/generated/atom_macro.rs",
|
|
||||||
"./resources/hsts_preload.json",
|
"./resources/hsts_preload.json",
|
||||||
"./tests/wpt/metadata/MANIFEST.json",
|
"./tests/wpt/metadata/MANIFEST.json",
|
||||||
"./support/android/openssl.sh",
|
"./support/android/openssl.sh",
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue