mach + rustup: use the minimal profile and install rustc-dev

This commit is contained in:
Simon Sapin 2020-01-02 15:27:25 +01:00
parent 6f70a9c1de
commit 1110cac184
5 changed files with 15 additions and 26 deletions

View file

@ -1009,7 +1009,12 @@ install them, let us know by filing a bug!")
toolchain = self.rust_toolchain()
if toolchain not in check_output(["rustup", "toolchain", "list"]):
check_call(["rustup", "toolchain", "install", toolchain])
check_call(["rustup", "toolchain", "install", "--profile", "minimal", toolchain])
if "rustc-dev" not in check_output(
["rustup", "component", "list", "--installed", "--toolchain", toolchain]
):
check_call(["rustup", "component", "add", "--toolchain", toolchain, "rustc-dev"])
if target and "uwp" not in target and target not in check_output(
["rustup", "target", "list", "--installed", "--toolchain", toolchain]
@ -1029,7 +1034,7 @@ install them, let us know by filing a bug!")
return 1
raise
version = tuple(map(int, re.match(b"rustup (\d+)\.(\d+)\.(\d+)", version_line).groups()))
if version < (1, 11, 0):
if version < (1, 21, 0):
print("rustup is at version %s.%s.%s, Servo requires 1.11.0 or more recent." % version)
print("Try running 'rustup self update'.")
return 1

View file

@ -24,7 +24,7 @@ from mach.decorators import (
Command,
)
from servo.command_base import CommandBase, cd, call, BIN_SUFFIX
from servo.command_base import CommandBase, cd, call
from servo.build_commands import notify_build_done
from servo.util import get_static_rust_lang_org_dist, get_urlopen_kwargs
@ -213,7 +213,7 @@ class MachCommands(CommandBase):
filename = path.join(self.context.topdir, "rust-toolchain")
with open(filename, "w") as f:
f.write(toolchain + "\n")
return call(["rustup" + BIN_SUFFIX, "component", "add", "rustc-dev"])
self.ensure_bootstrapped()
@Command('fetch',
description='Fetch Rust, Cargo and Cargo dependencies',