aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAnthony Ramine <n.oxyde@gmail.com>2017-02-15 11:47:03 +0100
committerSimon Sapin <simon.sapin@exyr.org>2017-02-15 14:55:02 +0100
commit57fd45a5c28e71e56c1f4c72260c80c92d4418dc (patch)
tree68767b676eac64574f2772abd42fd428a8783fac
parent336e6c8f286be636a105af858cac18b4d42c1b12 (diff)
downloadservo-57fd45a5c28e71e56c1f4c72260c80c92d4418dc.tar.gz
servo-57fd45a5c28e71e56c1f4c72260c80c92d4418dc.zip
Allow disabling LLVM assertions in rustc (fixes #15548)
-rw-r--r--python/servo/bootstrap_commands.py7
-rw-r--r--python/servo/command_base.py9
-rw-r--r--servobuild.example3
3 files changed, 15 insertions, 4 deletions
diff --git a/python/servo/bootstrap_commands.py b/python/servo/bootstrap_commands.py
index ee29bce06db..aa298611825 100644
--- a/python/servo/bootstrap_commands.py
+++ b/python/servo/bootstrap_commands.py
@@ -70,6 +70,8 @@ class MachCommands(CommandBase):
rust_path = self.rust_path()
rust_dir = path.join(self.context.sharedir, "rust", rust_path)
install_dir = path.join(self.context.sharedir, "rust", version)
+ if not self.config["build"]["llvm-assertions"]:
+ install_dir += "-alt"
if not force and path.exists(path.join(rust_dir, "rustc", "bin", "rustc" + BIN_SUFFIX)):
print("Rust compiler already downloaded.", end=" ")
@@ -89,7 +91,10 @@ class MachCommands(CommandBase):
rustc_url = "https://static-rust-lang-org.s3.amazonaws.com/dist/" + tarball
else:
tarball = "%s/rustc-nightly-%s.tar.gz" % (version, host_triple())
- rustc_url = "https://s3.amazonaws.com/rust-lang-ci/rustc-builds/" + tarball
+ base_url = "https://s3.amazonaws.com/rust-lang-ci/rustc-builds"
+ if not self.config["build"]["llvm-assertions"]:
+ base_url += "-alt"
+ rustc_url = base_url + "/" + tarball
tgz_file = rust_dir + '-rustc.tar.gz'
download_file("Rust compiler", rustc_url, tgz_file)
diff --git a/python/servo/command_base.py b/python/servo/command_base.py
index d533fa44bb8..5ad351b3411 100644
--- a/python/servo/command_base.py
+++ b/python/servo/command_base.py
@@ -258,7 +258,6 @@ class CommandBase(object):
self.config["tools"].setdefault("system-cargo", False)
self.config["tools"].setdefault("rust-root", "")
self.config["tools"].setdefault("cargo-root", "")
- self.set_use_stable_rust(False)
if not self.config["tools"]["system-cargo"]:
self.config["tools"]["cargo-root"] = path.join(
context.sharedir, "cargo", self.cargo_build_id())
@@ -267,6 +266,7 @@ class CommandBase(object):
self.config.setdefault("build", {})
self.config["build"].setdefault("android", False)
self.config["build"].setdefault("mode", "")
+ self.config["build"].setdefault("llvm-assertions", True)
self.config["build"].setdefault("debug-mozjs", False)
self.config["build"].setdefault("ccache", "")
self.config["build"].setdefault("rustflags", "")
@@ -279,6 +279,8 @@ class CommandBase(object):
self.config["android"].setdefault("platform", "android-18")
self.config["android"].setdefault("target", "arm-linux-androideabi")
+ self.set_use_stable_rust(False)
+
_use_stable_rust = False
_rust_version = None
_rust_version_is_stable = False
@@ -297,8 +299,9 @@ class CommandBase(object):
version = self.rust_version()
if self._use_stable_rust:
return os.path.join(version, "rustc-%s-%s" % (version, host_triple()))
- else:
- return os.path.join(version, "rustc-nightly-%s" % (host_triple()))
+ if not self.config["build"]["llvm-assertions"]:
+ version += "-alt"
+ return os.path.join(version, "rustc-nightly-%s" % (host_triple()))
def rust_version(self):
if self._rust_version is None or self._use_stable_rust != self._rust_version_is_stable:
diff --git a/servobuild.example b/servobuild.example
index 1cf444f57aa..4e77184666c 100644
--- a/servobuild.example
+++ b/servobuild.example
@@ -39,6 +39,9 @@ rustc-with-gold = true
# Defaults to prompting before building
#mode = "dev"
+# Whether to enable LLVM assertions in rustc.
+#llvm-assertions = true
+
# Set "android = true" or use `mach build --android` to build the Android app.
android = false