aboutsummaryrefslogtreecommitdiffstats
path: root/python/servo
diff options
context:
space:
mode:
authorSimon Sapin <simon.sapin@exyr.org>2020-01-02 14:40:03 +0100
committerSimon Sapin <simon.sapin@exyr.org>2020-01-02 15:30:33 +0100
commite96bcea669d9c21db8c0b171a6fe4582bbbd6144 (patch)
tree7efef72422486ab303efa92235caf68b98d17f10 /python/servo
parent855601ebb47282c1e3a2389979b7cae8247b3f69 (diff)
downloadservo-e96bcea669d9c21db8c0b171a6fe4582bbbd6144.tar.gz
servo-e96bcea669d9c21db8c0b171a6fe4582bbbd6144.zip
mach: explicitly install the toolchain and target in `ensure_bootstrapped`
Diffstat (limited to 'python/servo')
-rw-r--r--python/servo/command_base.py12
1 files changed, 7 insertions, 5 deletions
diff --git a/python/servo/command_base.py b/python/servo/command_base.py
index 02c4b25c4cf..23bb48050d2 100644
--- a/python/servo/command_base.py
+++ b/python/servo/command_base.py
@@ -1006,13 +1006,15 @@ install them, let us know by filing a bug!")
if self.config["tools"]["use-rustup"]:
self.ensure_rustup_version()
- if target and "uwp" not in target:
- # 'rustup target add' fails if the toolchain is not installed at all.
- self.call_rustup_run(["rustc", "--version"])
+ toolchain = self.rust_toolchain()
- check_call(["rustup" + BIN_SUFFIX, "target", "add",
- "--toolchain", self.rust_toolchain(), target])
+ if toolchain not in check_output(["rustup", "toolchain", "list"]):
+ check_call(["rustup", "toolchain", "install", toolchain])
+ if target and "uwp" not in target and target not in check_output(
+ ["rustup", "target", "list", "--installed", "--toolchain", toolchain]
+ ):
+ check_call(["rustup", "target", "add", "--toolchain", toolchain, target])
self.context.bootstrapped = True