aboutsummaryrefslogtreecommitdiffstats
path: root/python/servo/platform/base.py
diff options
context:
space:
mode:
Diffstat (limited to 'python/servo/platform/base.py')
-rw-r--r--python/servo/platform/base.py9
1 files changed, 9 insertions, 0 deletions
diff --git a/python/servo/platform/base.py b/python/servo/platform/base.py
index 81963777a80..0f2bf25de15 100644
--- a/python/servo/platform/base.py
+++ b/python/servo/platform/base.py
@@ -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