From deeb79669f2bd3829cca745f2d514205a4d61307 Mon Sep 17 00:00:00 2001 From: Simon Sapin Date: Tue, 25 Sep 2018 21:00:26 +0200 Subject: [PATCH] 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 943281ecf2b..2cb7856b0f2 100644 --- a/python/servo/build_commands.py +++ b/python/servo/build_commands.py @@ -256,7 +256,7 @@ class MachCommands(CommandBase): 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 85ec8435834..b6faa53a5e1 100644 --- a/python/servo/command_base.py +++ b/python/servo/command_base.py @@ -670,11 +670,14 @@ install them, let us know by filing a bug!") 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 2f323010a18..c71f424daac 100644 --- a/python/servo/devenv_commands.py +++ b/python/servo/devenv_commands.py @@ -40,8 +40,7 @@ class MachCommands(CommandBase): 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)