aboutsummaryrefslogtreecommitdiffstats
path: root/python/servo/command_base.py
diff options
context:
space:
mode:
authorMartin Robinson <mrobinson@igalia.com>2024-08-26 22:30:43 -0700
committerGitHub <noreply@github.com>2024-08-27 05:30:43 +0000
commitbb5926b3291877fb47d44ea376881c2d52701bbf (patch)
treea24f769668a9647121e50ee6f6ae7bef6a44d5cd /python/servo/command_base.py
parentba4e081e8eddf8bee186a19a15f3f5dfe9c62dc9 (diff)
downloadservo-bb5926b3291877fb47d44ea376881c2d52701bbf.tar.gz
servo-bb5926b3291877fb47d44ea376881c2d52701bbf.zip
mach: Do not manually install toolchain for non-cross builds (#33190)
* mach: Do not manually install toolchain for non-cross builds This fixes the Apple Silicon build where the installed toolchain does not match the host triple. We only install toolchains manually for cross builds, because cargo and friends will do this automatically when executing. Signed-off-by: Martin Robinson <mrobinson@igalia.com> * fix lints Signed-off-by: Mukilan Thiyagarajan <mukilan@igalia.com> --------- Signed-off-by: Martin Robinson <mrobinson@igalia.com> Signed-off-by: Mukilan Thiyagarajan <mukilan@igalia.com> Co-authored-by: Mukilan Thiyagarajan <mukilan@igalia.com>
Diffstat (limited to 'python/servo/command_base.py')
-rw-r--r--python/servo/command_base.py16
1 files changed, 10 insertions, 6 deletions
diff --git a/python/servo/command_base.py b/python/servo/command_base.py
index 016022c6c41..01dac1ca7fb 100644
--- a/python/servo/command_base.py
+++ b/python/servo/command_base.py
@@ -799,16 +799,20 @@ class CommandBase(object):
return
servo.platform.get().passive_bootstrap()
+ self.context.bootstrapped = True
+
+ # Toolchain installation is handled automatically for non cross compilation builds.
+ if not self.target.is_cross_build():
+ return
- needs_toolchain_install = self.target.triple() not in \
- check_output(["rustup", "target", "list", "--installed"],
- cwd=self.context.topdir).decode()
- if needs_toolchain_install:
+ installed_targets = check_output(
+ ["rustup", "target", "list", "--installed"],
+ cwd=self.context.topdir
+ ).decode()
+ if self.target.triple() not in installed_targets:
check_call(["rustup", "target", "add", self.target.triple()],
cwd=self.context.topdir)
- self.context.bootstrapped = True
-
def ensure_rustup_version(self):
try:
version_line = subprocess.check_output(