diff options
author | Martin Robinson <mrobinson@igalia.com> | 2023-05-24 19:40:30 +0200 |
---|---|---|
committer | Martin Robinson <mrobinson@igalia.com> | 2023-05-25 16:58:05 +0200 |
commit | debc37a7d3269c194a21a592dacf94df9f065b4e (patch) | |
tree | 672c8b021c1ebe0bf2d7e2473e3f7c7b49547de7 /python/servo/post_build_commands.py | |
parent | e9a7787a4d7e3a836853fd8b319951f20879fc83 (diff) | |
download | servo-debc37a7d3269c194a21a592dacf94df9f065b4e.tar.gz servo-debc37a7d3269c194a21a592dacf94df9f065b4e.zip |
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.
Diffstat (limited to 'python/servo/post_build_commands.py')
-rw-r--r-- | python/servo/post_build_commands.py | 14 |
1 files changed, 3 insertions, 11 deletions
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 |