From 6842553923a0d491be2a07f7aba3f72379215535 Mon Sep 17 00:00:00 2001 From: Simon Sapin Date: Tue, 25 Sep 2018 19:20:44 +0200 Subject: [PATCH 1/4] Fix default-except-unstable build --- ports/servo/non_android_main.rs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/ports/servo/non_android_main.rs b/ports/servo/non_android_main.rs index 7fcc5f0df353..50ba92f21304 100644 --- a/ports/servo/non_android_main.rs +++ b/ports/servo/non_android_main.rs @@ -58,6 +58,9 @@ pub mod platform { pub fn deinit() {} } +#[cfg(not(feature = "unstable"))] +fn install_crash_handler() {} + #[cfg(feature = "unstable")] fn install_crash_handler() { use backtrace::Backtrace; From 39079cff8baffc02feacb563ce027c55abd40a62 Mon Sep 17 00:00:00 2001 From: Simon Sapin Date: Tue, 25 Sep 2018 15:00:25 +0200 Subject: [PATCH 2/4] Only build ports/servo by default (except Android), add `./mach build --libsimpleservo` Fixes #21314 --- Cargo.toml | 5 ----- python/servo/build_commands.py | 9 ++++++++- python/servo/command_base.py | 9 +++++++++ python/servo/devenv_commands.py | 3 +++ 4 files changed, 20 insertions(+), 6 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 069fd75fc96b..bb452af5fa6c 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -4,11 +4,6 @@ members = [ "ports/libsimpleservo/", "tests/unit/*", ] -default-members = [ - "ports/servo", - "ports/libsimpleservo/", - "tests/unit/*", -] exclude = [".cargo"] [profile.release] diff --git a/python/servo/build_commands.py b/python/servo/build_commands.py index 8182f42dc9ef..943281ecf2b9 100644 --- a/python/servo/build_commands.py +++ b/python/servo/build_commands.py @@ -181,9 +181,14 @@ class MachCommands(CommandBase): default=None, action='store_true', 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, 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 [] @@ -251,6 +256,8 @@ def build(self, target=None, release=False, dev=False, jobs=None, self.ensure_bootstrapped(target=target) self.ensure_clobbered() + opts += ["--manifest-path", self.manifest_path(android, libsimpleservo)] + if debug_mozjs: features += ["debugmozjs"] diff --git a/python/servo/command_base.py b/python/servo/command_base.py index b335dcd69ebb..85ec84358344 100644 --- a/python/servo/command_base.py +++ b/python/servo/command_base.py @@ -670,9 +670,18 @@ def package_dir(package): def ports_servo_crate(self): return path.join(self.context.topdir, "ports", "servo") + def manifest_path(self, android=False, libsimpleservo=False): + if libsimpleservo or android: + return self.ports_libsimpleservo_manifest() + else: + return self.ports_servo_manifest() + def ports_servo_manifest(self): 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): """Return a list of optional features to enable for the Servo crate""" features = [] diff --git a/python/servo/devenv_commands.py b/python/servo/devenv_commands.py index 9852558bce6f..2f323010a18c 100644 --- a/python/servo/devenv_commands.py +++ b/python/servo/devenv_commands.py @@ -40,6 +40,9 @@ def run_cargo(self, params, check=False): if check: params = ['check'] + params + if "--manifest-path" not in params: + params += ["--manifest-path", self.ports_servo_manifest()] + build_start = time() status = self.call_rustup_run(["cargo"] + params, env=env) elapsed = time() - build_start From 4e85f9c186a4cd1e23ba5cbe0c019b026d952ce1 Mon Sep 17 00:00:00 2001 From: Simon Sapin Date: Tue, 25 Sep 2018 19:21:42 +0200 Subject: [PATCH 3/4] Build libsimpleservo on CI --- etc/ci/buildbot_steps.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/etc/ci/buildbot_steps.yml b/etc/ci/buildbot_steps.yml index b11858628fbd..607f5653e088 100644 --- a/etc/ci/buildbot_steps.yml +++ b/etc/ci/buildbot_steps.yml @@ -115,6 +115,7 @@ linux-dev: - ./mach test-unit - python ./etc/memory_reports_over_time.py --test - ./mach package --dev + - ./mach build --libsimpleservo - ./mach build --dev --no-default-features --features default-except-unstable -p servo - bash ./etc/ci/lockfile_changed.sh - bash ./etc/ci/check_no_panic.sh From deeb79669f2bd3829cca745f2d514205a4d61307 Mon Sep 17 00:00:00 2001 From: Simon Sapin Date: Tue, 25 Sep 2018 21:00:26 +0200 Subject: [PATCH 4/4] Only add --manifest-path if not already present --- python/servo/build_commands.py | 2 +- python/servo/command_base.py | 13 ++++++++----- python/servo/devenv_commands.py | 3 +-- 3 files changed, 10 insertions(+), 8 deletions(-) diff --git a/python/servo/build_commands.py b/python/servo/build_commands.py index 943281ecf2b9..2cb7856b0f26 100644 --- a/python/servo/build_commands.py +++ b/python/servo/build_commands.py @@ -256,7 +256,7 @@ def build(self, target=None, release=False, dev=False, jobs=None, self.ensure_bootstrapped(target=target) self.ensure_clobbered() - opts += ["--manifest-path", self.manifest_path(android, libsimpleservo)] + self.add_manifest_path(opts, android, libsimpleservo) if debug_mozjs: features += ["debugmozjs"] diff --git a/python/servo/command_base.py b/python/servo/command_base.py index 85ec84358344..b6faa53a5e12 100644 --- a/python/servo/command_base.py +++ b/python/servo/command_base.py @@ -670,11 +670,14 @@ def package_dir(package): def ports_servo_crate(self): return path.join(self.context.topdir, "ports", "servo") - def manifest_path(self, android=False, libsimpleservo=False): - if libsimpleservo or android: - return self.ports_libsimpleservo_manifest() - else: - return self.ports_servo_manifest() + 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): return path.join(self.context.topdir, "ports", "servo", "Cargo.toml") diff --git a/python/servo/devenv_commands.py b/python/servo/devenv_commands.py index 2f323010a18c..c71f424daac5 100644 --- a/python/servo/devenv_commands.py +++ b/python/servo/devenv_commands.py @@ -40,8 +40,7 @@ def run_cargo(self, params, check=False): if check: params = ['check'] + params - if "--manifest-path" not in params: - params += ["--manifest-path", self.ports_servo_manifest()] + self.add_manifest_path(params) build_start = time() status = self.call_rustup_run(["cargo"] + params, env=env)