mirror of
https://github.com/servo/servo.git
synced 2025-06-06 16:45:39 +00: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 = [
|
||||
"ports/servo",
|
||||
"tests/unit/*",
|
||||
|
||||
"ports/geckolib",
|
||||
"ports/geckolib/tests",
|
||||
]
|
||||
default-members = [
|
||||
"ports/servo",
|
||||
|
|
|
@ -8,4 +8,4 @@ set -o errexit
|
|||
set -o nounset
|
||||
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,18 +128,15 @@ class MachCommands(CommandBase):
|
|||
help='Keep up to this many most recent nightlies')
|
||||
def clean_nightlies(self, force=False, keep=None):
|
||||
default_toolchain = self.default_toolchain()
|
||||
geckolib_toolchain = self.geckolib_toolchain()
|
||||
print("Current Rust version for Servo: {}".format(default_toolchain))
|
||||
print("Current Rust version for geckolib: {}".format(geckolib_toolchain))
|
||||
old_toolchains = []
|
||||
keep = int(keep)
|
||||
for toolchain_file in ['rust-toolchain', 'geckolib-rust-toolchain']:
|
||||
stdout = subprocess.check_output(['git', 'log', '--format=%H', toolchain_file])
|
||||
for i, commit_hash in enumerate(stdout.split(), 1):
|
||||
if i > keep:
|
||||
toolchain = subprocess.check_output(
|
||||
['git', 'show', '%s:%s' % (commit_hash, toolchain_file)])
|
||||
old_toolchains.append(toolchain.strip())
|
||||
stdout = subprocess.check_output(['git', 'log', '--format=%H', 'rust-toolchain'])
|
||||
for i, commit_hash in enumerate(stdout.split(), 1):
|
||||
if i > keep:
|
||||
toolchain = subprocess.check_output(
|
||||
['git', 'show', '%s:rust-toolchain' % commit_hash])
|
||||
old_toolchains.append(toolchain.strip())
|
||||
|
||||
removing_anything = False
|
||||
stdout = subprocess.check_output(['rustup', 'toolchain', 'list'])
|
||||
|
|
|
@ -386,49 +386,6 @@ class MachCommands(CommandBase):
|
|||
print("Build %s in %s" % ("Completed" if status == 0 else "FAILED", format_duration(elapsed)))
|
||||
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',
|
||||
description='Clean the build directory.',
|
||||
category='build')
|
||||
|
|
|
@ -285,27 +285,10 @@ class CommandBase(object):
|
|||
# Set default android target
|
||||
self.handle_android_target("armv7-linux-androideabi")
|
||||
|
||||
self.set_use_geckolib_toolchain(False)
|
||||
|
||||
_use_geckolib_toolchain = False
|
||||
_geckolib_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):
|
||||
if self._use_geckolib_toolchain:
|
||||
return self.geckolib_toolchain()
|
||||
else:
|
||||
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
|
||||
return self.default_toolchain()
|
||||
|
||||
def default_toolchain(self):
|
||||
if self._default_toolchain is None:
|
||||
|
@ -474,7 +457,7 @@ class CommandBase(object):
|
|||
bin_folder = path.join(destination_folder, "PFiles", "Mozilla research", "Servo Tech Demo")
|
||||
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."""
|
||||
env = os.environ.copy()
|
||||
if sys.platform == "win32" and type(env['PATH']) == unicode:
|
||||
|
@ -593,10 +576,7 @@ class CommandBase(object):
|
|||
|
||||
env['GIT_INFO'] = '-'.join(git_info)
|
||||
|
||||
if geckolib:
|
||||
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"]:
|
||||
if self.config["build"]["thinlto"]:
|
||||
env['RUSTFLAGS'] += " -Z thinlto"
|
||||
|
||||
return env
|
||||
|
@ -607,9 +587,6 @@ class CommandBase(object):
|
|||
def servo_manifest(self):
|
||||
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):
|
||||
"""Return a list of optional features to enable for the Servo crate"""
|
||||
features = []
|
||||
|
|
|
@ -28,29 +28,17 @@ from servo.util import STATIC_RUST_LANG_ORG_DIST, URLOPEN_KWARGS
|
|||
|
||||
@CommandProvider
|
||||
class MachCommands(CommandBase):
|
||||
def run_cargo(self, params, geckolib=False, check=False):
|
||||
def run_cargo(self, params, check=False):
|
||||
if not params:
|
||||
params = []
|
||||
|
||||
self.ensure_bootstrapped()
|
||||
self.ensure_clobbered()
|
||||
env = self.build_env(geckolib=geckolib)
|
||||
env = self.build_env()
|
||||
|
||||
if check:
|
||||
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()
|
||||
status = self.call_rustup_run(["cargo"] + params, env=env)
|
||||
elapsed = time() - build_start
|
||||
|
@ -71,15 +59,6 @@ class MachCommands(CommandBase):
|
|||
def cargo(self, 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',
|
||||
description='Run "cargo check"',
|
||||
category='devenv')
|
||||
|
@ -89,15 +68,6 @@ class MachCommands(CommandBase):
|
|||
def check(self, params):
|
||||
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',
|
||||
description='Same as update-cargo',
|
||||
category='devenv')
|
||||
|
@ -212,22 +182,6 @@ class MachCommands(CommandBase):
|
|||
self.ensure_bootstrapped()
|
||||
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',
|
||||
description='`git grep` for selected directories.',
|
||||
category='devenv')
|
||||
|
|
|
@ -295,28 +295,6 @@ class MachCommands(CommandBase):
|
|||
if err is not 0:
|
||||
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',
|
||||
description='Run the content tests',
|
||||
category='testing')
|
||||
|
|
|
@ -490,7 +490,6 @@ def check_rust(file_name, lines):
|
|||
if not file_name.endswith(".rs") or \
|
||||
file_name.endswith(".mako.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")):
|
||||
raise StopIteration
|
||||
|
||||
|
|
|
@ -55,11 +55,6 @@ files = [
|
|||
"./components/style/properties/helpers/animated_properties.mako.rs",
|
||||
# Helper macro where actually a pseudo-element per line makes sense.
|
||||
"./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",
|
||||
"./tests/wpt/metadata/MANIFEST.json",
|
||||
"./support/android/openssl.sh",
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue