Skip to content

Commit

Permalink
Install rust-docs rustup component in ./mach doc
Browse files Browse the repository at this point in the history
  • Loading branch information
SimonSapin committed Jan 2, 2020
1 parent 1110cac commit f93c03c
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 6 deletions.
1 change: 0 additions & 1 deletion etc/taskcluster/decision_task.py
Expand Up @@ -226,7 +226,6 @@ def linux_docs_check():
linux_build_task("Docs + check")
.with_treeherder("Linux x64", "Doc+Check")
.with_script("""
rustup component add rust-docs
RUSTDOCFLAGS="--disable-minification" ./mach doc
(
cd target/doc
Expand Down
10 changes: 6 additions & 4 deletions python/servo/command_base.py
Expand Up @@ -994,7 +994,7 @@ def handle_android_target(self, target):
return True
return False

def ensure_bootstrapped(self, target=None):
def ensure_bootstrapped(self, target=None, rustup_components=None):
if self.context.bootstrapped:
return

Expand All @@ -1011,10 +1011,12 @@ def ensure_bootstrapped(self, target=None):
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]
Expand Down
2 changes: 1 addition & 1 deletion python/servo/post_build_commands.py
Expand Up @@ -241,7 +241,7 @@ def rr_replay(self):
@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"
Expand Down

0 comments on commit f93c03c

Please sign in to comment.