mirror of
https://github.com/servo/servo.git
synced 2025-07-22 14:53:49 +01:00
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>
This commit is contained in:
parent
ba4e081e8e
commit
bb5926b329
1 changed files with 10 additions and 6 deletions
|
@ -799,16 +799,20 @@ class CommandBase(object):
|
|||
return
|
||||
|
||||
servo.platform.get().passive_bootstrap()
|
||||
self.context.bootstrapped = True
|
||||
|
||||
needs_toolchain_install = self.target.triple() not in \
|
||||
check_output(["rustup", "target", "list", "--installed"],
|
||||
cwd=self.context.topdir).decode()
|
||||
if needs_toolchain_install:
|
||||
# Toolchain installation is handled automatically for non cross compilation builds.
|
||||
if not self.target.is_cross_build():
|
||||
return
|
||||
|
||||
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(
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue