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.py13
1 files changed, 13 insertions, 0 deletions
diff --git a/python/servo/platform/base.py b/python/servo/platform/base.py
index d3d03cf80ef..e8a62400bd9 100644
--- a/python/servo/platform/base.py
+++ b/python/servo/platform/base.py
@@ -97,6 +97,7 @@ class Base:
def bootstrap(self, force: bool):
installed_something = self._platform_bootstrap(force)
installed_something |= self.install_taplo(force)
+ installed_something |= self.install_crown(force)
if not installed_something:
print("Dependencies were already installed!")
@@ -110,6 +111,18 @@ class Base:
return True
+ def install_crown(self, force: bool) -> bool:
+ # We need to override the rustc set in cargo/config.toml because crown
+ # may not be installed yet.
+ env = dict(os.environ)
+ env["CARGO_BUILD_RUSTC"] = "rustc"
+
+ if subprocess.call(["cargo", "install", "--path", "support/crown"],
+ stdout=subprocess.PIPE, stderr=subprocess.PIPE, env=env) != 0:
+ raise EnvironmentError("Installation of crown failed.")
+
+ return True
+
def passive_bootstrap(self) -> bool:
"""A bootstrap method that is called without explicitly invoking `./mach bootstrap`
but that is executed in the process of other `./mach` commands. This should be