Auto merge of #21809 - servo:features, r=SimonSapin

Only build ports/servo by default (except Android), add `./mach build --libsimpleservo`

Fixes #21314

<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/21809)
<!-- Reviewable:end -->
This commit is contained in:
bors-servo 2018-09-27 13:35:09 -04:00 committed by GitHub
commit 0964d055cd
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 26 additions and 6 deletions

View file

@ -4,11 +4,6 @@ members = [
"ports/libsimpleservo/", "ports/libsimpleservo/",
"tests/unit/*", "tests/unit/*",
] ]
default-members = [
"ports/servo",
"ports/libsimpleservo/",
"tests/unit/*",
]
exclude = [".cargo"] exclude = [".cargo"]
[profile.release] [profile.release]

View file

@ -115,6 +115,7 @@ linux-dev:
- ./mach test-unit - ./mach test-unit
- python ./etc/memory_reports_over_time.py --test - python ./etc/memory_reports_over_time.py --test
- ./mach package --dev - ./mach package --dev
- ./mach build --libsimpleservo
- ./mach build --dev --no-default-features --features default-except-unstable -p servo - ./mach build --dev --no-default-features --features default-except-unstable -p servo
- bash ./etc/ci/lockfile_changed.sh - bash ./etc/ci/lockfile_changed.sh
- bash ./etc/ci/check_no_panic.sh - bash ./etc/ci/check_no_panic.sh

View file

@ -58,6 +58,9 @@ pub mod platform {
pub fn deinit() {} pub fn deinit() {}
} }
#[cfg(not(feature = "unstable"))]
fn install_crash_handler() {}
#[cfg(feature = "unstable")] #[cfg(feature = "unstable")]
fn install_crash_handler() { fn install_crash_handler() {
use backtrace::Backtrace; use backtrace::Backtrace;

View file

@ -184,9 +184,14 @@ class MachCommands(CommandBase):
default=None, default=None,
action='store_true', action='store_true',
help='Enable debug assertions in release') help='Enable debug assertions in release')
@CommandArgument('--libsimpleservo',
default=None,
action='store_true',
help='Build the libsimpleservo library instead of the servo executable')
def build(self, target=None, release=False, dev=False, jobs=None, def build(self, target=None, release=False, dev=False, jobs=None,
features=None, android=None, no_package=False, verbose=False, very_verbose=False, features=None, android=None, no_package=False, verbose=False, very_verbose=False,
debug_mozjs=False, params=None, with_debug_assertions=False): debug_mozjs=False, params=None, with_debug_assertions=False,
libsimpleservo=False):
opts = params or [] opts = params or []
@ -254,6 +259,8 @@ class MachCommands(CommandBase):
self.ensure_bootstrapped(target=target) self.ensure_bootstrapped(target=target)
self.ensure_clobbered() self.ensure_clobbered()
self.add_manifest_path(opts, android, libsimpleservo)
if debug_mozjs: if debug_mozjs:
features += ["debugmozjs"] features += ["debugmozjs"]

View file

@ -670,9 +670,21 @@ install them, let us know by filing a bug!")
def ports_servo_crate(self): def ports_servo_crate(self):
return path.join(self.context.topdir, "ports", "servo") return path.join(self.context.topdir, "ports", "servo")
def add_manifest_path(self, args, android=False, libsimpleservo=False):
if "--manifest-path" not in args:
if libsimpleservo or android:
manifest = self.ports_libsimpleservo_manifest()
else:
manifest = self.ports_servo_manifest()
args.append("--manifest-path")
args.append(manifest)
def ports_servo_manifest(self): def ports_servo_manifest(self):
return path.join(self.context.topdir, "ports", "servo", "Cargo.toml") return path.join(self.context.topdir, "ports", "servo", "Cargo.toml")
def ports_libsimpleservo_manifest(self):
return path.join(self.context.topdir, "ports", "libsimpleservo", "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 = []

View file

@ -42,6 +42,8 @@ class MachCommands(CommandBase):
if check: if check:
params = ['check'] + params params = ['check'] + params
self.add_manifest_path(params)
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