aboutsummaryrefslogtreecommitdiffstats
path: root/python/servo
diff options
context:
space:
mode:
authorSimon Sapin <simon.sapin@exyr.org>2020-01-02 13:56:16 +0100
committerSimon Sapin <simon.sapin@exyr.org>2020-01-02 14:20:18 +0100
commitcef92a2050fae29d7ae810da43d387ee57b00273 (patch)
tree8bf9a020b61976f2451094d6e1352bb5460c95c6 /python/servo
parent728133611656f37480b96103dcc1d025f7d12ba3 (diff)
downloadservo-cef92a2050fae29d7ae810da43d387ee57b00273.tar.gz
servo-cef92a2050fae29d7ae810da43d387ee57b00273.zip
Mach: rename default_toolchain to rust_toolchain
Diffstat (limited to 'python/servo')
-rw-r--r--python/servo/bootstrap_commands.py3
-rw-r--r--python/servo/build_commands.py2
-rw-r--r--python/servo/command_base.py15
-rw-r--r--python/servo/post_build_commands.py5
4 files changed, 10 insertions, 15 deletions
diff --git a/python/servo/bootstrap_commands.py b/python/servo/bootstrap_commands.py
index 835c7bf21c2..b8a88314609 100644
--- a/python/servo/bootstrap_commands.py
+++ b/python/servo/bootstrap_commands.py
@@ -281,8 +281,7 @@ class MachCommands(CommandBase):
default='1',
help='Keep up to this many most recent nightlies')
def clean_nightlies(self, force=False, keep=None):
- default_toolchain = self.default_toolchain()
- print("Current Rust version for Servo: {}".format(default_toolchain))
+ print("Current Rust version for Servo: {}".format(self.rust_toolchain()))
old_toolchains = []
keep = int(keep)
stdout = subprocess.check_output(['git', 'log', '--format=%H', 'rust-toolchain'])
diff --git a/python/servo/build_commands.py b/python/servo/build_commands.py
index 4630c9a9dbf..b9d2a90ad79 100644
--- a/python/servo/build_commands.py
+++ b/python/servo/build_commands.py
@@ -243,7 +243,7 @@ class MachCommands(CommandBase):
self.call_rustup_run(["rustc", "--version"])
check_call(["rustup" + BIN_SUFFIX, "target", "add",
- "--toolchain", self.toolchain(), target])
+ "--toolchain", self.rust_toolchain(), target])
env = self.build_env(target=target, is_build=True, uwp=uwp, features=features)
self.ensure_bootstrapped(target=target)
diff --git a/python/servo/command_base.py b/python/servo/command_base.py
index 371eb9844a2..43e993f0907 100644
--- a/python/servo/command_base.py
+++ b/python/servo/command_base.py
@@ -345,17 +345,14 @@ class CommandBase(object):
# Set default android target
self.handle_android_target("armv7-linux-androideabi")
- _default_toolchain = None
+ _rust_toolchain = None
- def toolchain(self):
- return self.default_toolchain()
-
- def default_toolchain(self):
- if self._default_toolchain is None:
+ def rust_toolchain(self):
+ if self._rust_toolchain is None:
filename = path.join(self.context.topdir, "rust-toolchain")
with open(filename) as f:
- self._default_toolchain = f.read().strip()
- return self._default_toolchain
+ self._rust_toolchain = f.read().strip()
+ return self._rust_toolchain
def call_rustup_run(self, args, **kwargs):
if self.config["tools"]["use-rustup"]:
@@ -373,7 +370,7 @@ class CommandBase(object):
print("rustup is at version %s.%s.%s, Servo requires 1.11.0 or more recent." % version)
print("Try running 'rustup self update'.")
return 1
- toolchain = self.toolchain()
+ toolchain = self.rust_toolchain()
if platform.system() == "Windows":
toolchain += "-x86_64-pc-windows-msvc"
args = ["rustup" + BIN_SUFFIX, "run", "--install", toolchain] + args
diff --git a/python/servo/post_build_commands.py b/python/servo/post_build_commands.py
index a6ab4de647c..18b43a1afe0 100644
--- a/python/servo/post_build_commands.py
+++ b/python/servo/post_build_commands.py
@@ -241,9 +241,8 @@ class PostBuildCommands(CommandBase):
@CommandBase.build_like_command_arguments
def doc(self, params, features, target=None, android=False, magicleap=False,
media_stack=None, **kwargs):
- env = os.environ.copy()
- env["RUSTUP_TOOLCHAIN"] = self.toolchain()
- rustc_path = check_output(["rustup" + BIN_SUFFIX, "which", "rustc"], env=env)
+ rustc_path = check_output(
+ ["rustup" + BIN_SUFFIX, "which", "--toolchain", self.rust_toolchain(), "rustc"])
assert path.basename(path.dirname(rustc_path)) == "bin"
toolchain_path = path.dirname(path.dirname(rustc_path))
rust_docs = path.join(toolchain_path, "share", "doc", "rust", "html")