From debc37a7d3269c194a21a592dacf94df9f065b4e Mon Sep 17 00:00:00 2001 From: Martin Robinson Date: Wed, 24 May 2023 19:40:30 +0200 Subject: Clean up cross-compilation and features Integrate cross-compilation and media-stack handling into the `build_like_command_arguments` decorator. This removes a lot of repetition in the code and standardizes how targets are selected for all similar commands. Now cross compilation targets, feature flags, and helper variables are stored in the CommandBase instance. This also avoids having to continuously pass these arguments down to functions called by the commands. --- python/servo/post_build_commands.py | 14 +++----------- 1 file changed, 3 insertions(+), 11 deletions(-) (limited to 'python/servo/post_build_commands.py') diff --git a/python/servo/post_build_commands.py b/python/servo/post_build_commands.py index 07f104630a1..afe8b12dfd4 100644 --- a/python/servo/post_build_commands.py +++ b/python/servo/post_build_commands.py @@ -242,8 +242,7 @@ class PostBuildCommands(CommandBase): 'params', nargs='...', help="Command-line arguments to be passed through to cargo doc") @CommandBase.build_like_command_arguments - def doc(self, params, features, target=None, android=False, - media_stack=None, **kwargs): + def doc(self, params, **kwargs): self.ensure_bootstrapped(rustup_components=["rust-docs"]) rustc_path = check_output( ["rustup" + BIN_SUFFIX, "which", "--toolchain", self.rust_toolchain(), "rustc"] @@ -271,15 +270,8 @@ class PostBuildCommands(CommandBase): else: copy2(full_name, destination) - features = features or [] - - target, android = self.pick_target_triple(target, android) - - features += self.pick_media_stack(media_stack, target) - - env = self.build_env(target=target, is_build=True, features=features) - - returncode = self.run_cargo_build_like_command("doc", params, features=features, env=env, **kwargs) + env = self.build_env(is_build=True) + returncode = self.run_cargo_build_like_command("doc", params, env=env, **kwargs) if returncode: return returncode -- cgit v1.2.3