mirror of
https://github.com/servo/servo.git
synced 2025-06-13 10:54:29 +00:00
Install rust-docs
rustup component in ./mach doc
This commit is contained in:
parent
1110cac184
commit
f93c03cda3
3 changed files with 7 additions and 6 deletions
|
@ -226,7 +226,6 @@ def linux_docs_check():
|
||||||
linux_build_task("Docs + check")
|
linux_build_task("Docs + check")
|
||||||
.with_treeherder("Linux x64", "Doc+Check")
|
.with_treeherder("Linux x64", "Doc+Check")
|
||||||
.with_script("""
|
.with_script("""
|
||||||
rustup component add rust-docs
|
|
||||||
RUSTDOCFLAGS="--disable-minification" ./mach doc
|
RUSTDOCFLAGS="--disable-minification" ./mach doc
|
||||||
(
|
(
|
||||||
cd target/doc
|
cd target/doc
|
||||||
|
|
|
@ -994,7 +994,7 @@ install them, let us know by filing a bug!")
|
||||||
return True
|
return True
|
||||||
return False
|
return False
|
||||||
|
|
||||||
def ensure_bootstrapped(self, target=None):
|
def ensure_bootstrapped(self, target=None, rustup_components=None):
|
||||||
if self.context.bootstrapped:
|
if self.context.bootstrapped:
|
||||||
return
|
return
|
||||||
|
|
||||||
|
@ -1011,10 +1011,12 @@ install them, let us know by filing a bug!")
|
||||||
if toolchain not in check_output(["rustup", "toolchain", "list"]):
|
if toolchain not in check_output(["rustup", "toolchain", "list"]):
|
||||||
check_call(["rustup", "toolchain", "install", "--profile", "minimal", toolchain])
|
check_call(["rustup", "toolchain", "install", "--profile", "minimal", toolchain])
|
||||||
|
|
||||||
if "rustc-dev" not in check_output(
|
installed = check_output(
|
||||||
["rustup", "component", "list", "--installed", "--toolchain", toolchain]
|
["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(
|
if target and "uwp" not in target and target not in check_output(
|
||||||
["rustup", "target", "list", "--installed", "--toolchain", toolchain]
|
["rustup", "target", "list", "--installed", "--toolchain", toolchain]
|
||||||
|
|
|
@ -241,7 +241,7 @@ class PostBuildCommands(CommandBase):
|
||||||
@CommandBase.build_like_command_arguments
|
@CommandBase.build_like_command_arguments
|
||||||
def doc(self, params, features, target=None, android=False, magicleap=False,
|
def doc(self, params, features, target=None, android=False, magicleap=False,
|
||||||
media_stack=None, **kwargs):
|
media_stack=None, **kwargs):
|
||||||
self.ensure_bootstrapped()
|
self.ensure_bootstrapped(rustup_components=["rust-docs"])
|
||||||
rustc_path = check_output(
|
rustc_path = check_output(
|
||||||
["rustup" + BIN_SUFFIX, "which", "--toolchain", self.rust_toolchain(), "rustc"])
|
["rustup" + BIN_SUFFIX, "which", "--toolchain", self.rust_toolchain(), "rustc"])
|
||||||
assert path.basename(path.dirname(rustc_path)) == "bin"
|
assert path.basename(path.dirname(rustc_path)) == "bin"
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue