mirror of
https://github.com/servo/servo.git
synced 2025-06-12 18:34:39 +00:00
mach: run rustup target add
in ensure_bootstrapped
This commit is contained in:
parent
cef92a2050
commit
e56e49e98f
4 changed files with 12 additions and 11 deletions
|
@ -30,7 +30,7 @@ from mach.decorators import (
|
|||
from mach.registrar import Registrar
|
||||
|
||||
from mach_bootstrap import _get_exec_path
|
||||
from servo.command_base import CommandBase, cd, call, check_call, BIN_SUFFIX, append_to_path_env, gstreamer_root
|
||||
from servo.command_base import CommandBase, cd, call, check_call, append_to_path_env, gstreamer_root
|
||||
from servo.util import host_triple
|
||||
|
||||
|
||||
|
@ -237,14 +237,6 @@ class MachCommands(CommandBase):
|
|||
if very_verbose:
|
||||
opts += ["-vv"]
|
||||
|
||||
if target:
|
||||
if self.config["tools"]["use-rustup"] and not uwp:
|
||||
# 'rustup target add' fails if the toolchain is not installed at all.
|
||||
self.call_rustup_run(["rustc", "--version"])
|
||||
|
||||
check_call(["rustup" + BIN_SUFFIX, "target", "add",
|
||||
"--toolchain", self.rust_toolchain(), target])
|
||||
|
||||
env = self.build_env(target=target, is_build=True, uwp=uwp, features=features)
|
||||
self.ensure_bootstrapped(target=target)
|
||||
self.ensure_clobbered()
|
||||
|
|
|
@ -1016,6 +1016,15 @@ install them, let us know by filing a bug!")
|
|||
if "msvc" in target_platform:
|
||||
Registrar.dispatch("bootstrap", context=self.context)
|
||||
|
||||
if target:
|
||||
if self.config["tools"]["use-rustup"] and not "uwp" in target:
|
||||
# 'rustup target add' fails if the toolchain is not installed at all.
|
||||
self.call_rustup_run(["rustc", "--version"])
|
||||
|
||||
check_call(["rustup" + BIN_SUFFIX, "target", "add",
|
||||
"--toolchain", self.rust_toolchain(), target])
|
||||
|
||||
|
||||
self.context.bootstrapped = True
|
||||
|
||||
def ensure_clobbered(self, target_dir=None):
|
||||
|
|
|
@ -49,7 +49,7 @@ class MachCommands(CommandBase):
|
|||
|
||||
features += self.pick_media_stack(media_stack, target)
|
||||
|
||||
self.ensure_bootstrapped()
|
||||
self.ensure_bootstrapped(target=target)
|
||||
self.ensure_clobbered()
|
||||
env = self.build_env()
|
||||
|
||||
|
|
|
@ -241,13 +241,13 @@ 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()
|
||||
rustc_path = check_output(
|
||||
["rustup" + BIN_SUFFIX, "which", "--toolchain", self.rust_toolchain(), "rustc"])
|
||||
assert path.basename(path.dirname(rustc_path)) == "bin"
|
||||
toolchain_path = path.dirname(path.dirname(rustc_path))
|
||||
rust_docs = path.join(toolchain_path, "share", "doc", "rust", "html")
|
||||
|
||||
self.ensure_bootstrapped()
|
||||
docs = path.join(self.get_target_dir(), "doc")
|
||||
if not path.exists(docs):
|
||||
os.makedirs(docs)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue