mirror of
https://github.com/servo/servo.git
synced 2025-06-06 16:45:39 +00:00
mach: Install Rust toolchain during bootstrap if needed (#35795)
Signed-off-by: Delan Azabani <dazabani@igalia.com>
This commit is contained in:
parent
3409ab668a
commit
d9ea724abd
1 changed files with 9 additions and 0 deletions
|
@ -60,6 +60,7 @@ class Base:
|
|||
installed_something = False
|
||||
if not skip_platform:
|
||||
installed_something |= self._platform_bootstrap(force)
|
||||
self.install_rust_toolchain()
|
||||
if not skip_lints:
|
||||
installed_something |= self.install_taplo(force)
|
||||
installed_something |= self.install_cargo_deny(force)
|
||||
|
@ -68,6 +69,14 @@ class Base:
|
|||
if not installed_something:
|
||||
print("Dependencies were already installed!")
|
||||
|
||||
def install_rust_toolchain(self):
|
||||
# rustup 1.28.0, and rustup 1.28.1+ with RUSTUP_AUTO_INSTALL=0, require us to explicitly
|
||||
# install the Rust toolchain before trying to use it.
|
||||
print(" * Installing Rust toolchain...")
|
||||
if subprocess.call(["rustup", "show", "active-toolchain"]) != 0:
|
||||
if subprocess.call(["rustup", "toolchain", "install"]) != 0:
|
||||
raise EnvironmentError("Installation of Rust toolchain failed.")
|
||||
|
||||
def install_taplo(self, force: bool) -> bool:
|
||||
if not force and shutil.which("taplo") is not None:
|
||||
return False
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue