aboutsummaryrefslogtreecommitdiffstats
path: root/python/servo
diff options
context:
space:
mode:
Diffstat (limited to 'python/servo')
-rw-r--r--python/servo/command_base.py10
-rw-r--r--python/servo/post_build_commands.py2
2 files changed, 7 insertions, 5 deletions
diff --git a/python/servo/command_base.py b/python/servo/command_base.py
index f42a36fc738..c32219c184d 100644
--- a/python/servo/command_base.py
+++ b/python/servo/command_base.py
@@ -994,7 +994,7 @@ install them, let us know by filing a bug!")
return True
return False
- def ensure_bootstrapped(self, target=None):
+ def ensure_bootstrapped(self, target=None, rustup_components=None):
if self.context.bootstrapped:
return
@@ -1011,10 +1011,12 @@ install them, let us know by filing a bug!")
if toolchain not in check_output(["rustup", "toolchain", "list"]):
check_call(["rustup", "toolchain", "install", "--profile", "minimal", toolchain])
- if "rustc-dev" not in check_output(
+ installed = check_output(
["rustup", "component", "list", "--installed", "--toolchain", toolchain]
- ):
- check_call(["rustup", "component", "add", "--toolchain", toolchain, "rustc-dev"])
+ )
+ for component in set(rustup_components or []) | {"rustc-dev"}:
+ if component not in installed:
+ check_call(["rustup", "component", "add", "--toolchain", toolchain, component])
if target and "uwp" not in target and target not in check_output(
["rustup", "target", "list", "--installed", "--toolchain", toolchain]
diff --git a/python/servo/post_build_commands.py b/python/servo/post_build_commands.py
index 941999fdc0b..0311350e273 100644
--- a/python/servo/post_build_commands.py
+++ b/python/servo/post_build_commands.py
@@ -241,7 +241,7 @@ class PostBuildCommands(CommandBase):
@CommandBase.build_like_command_arguments
def doc(self, params, features, target=None, android=False, magicleap=False,
media_stack=None, **kwargs):
- self.ensure_bootstrapped()
+ self.ensure_bootstrapped(rustup_components=["rust-docs"])
rustc_path = check_output(
["rustup" + BIN_SUFFIX, "which", "--toolchain", self.rust_toolchain(), "rustc"])
assert path.basename(path.dirname(rustc_path)) == "bin"