servo: Merge #15559 - Allow disabling LLVM assertions in rustc (fixes #15548) (from servo:rustup); r=SimonSapin
authorAnthony Ramine <n.oxyde@gmail.com>
Wed, 15 Feb 2017 06:46:22 -0800
changeset 343365 a74967bd9c259d869eaad6509fcb378bba99689a
parent 343364 9f38984114fa95888bbbb510e15a31d86940db34
child 343366 b41aae558e9586afef8b06ea7e9d424f5743c05b
push id31377
push usercbook@mozilla.com
push dateFri, 17 Feb 2017 11:41:48 +0000
treeherdermozilla-central@975ce5d8f7d8 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersSimonSapin
milestone54.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
servo: Merge #15559 - Allow disabling LLVM assertions in rustc (fixes #15548) (from servo:rustup); r=SimonSapin Source-Repo: https://github.com/servo/servo Source-Revision: 4f10a0f2e1ae545649957cc7e305c8cb81312759
servo/README.md
servo/appveyor.yml
servo/python/servo/bootstrap_commands.py
servo/python/servo/command_base.py
servo/rust-commit-hash
servo/rust-nightly-date
servo/servobuild.example
servo/tests/compiletest/plugin/compile-fail/ban-domrefcell.rs
servo/tests/compiletest/plugin/compile-fail/ban.rs
servo/tests/compiletest/plugin/compile-fail/privatize.rs
--- a/servo/README.md
+++ b/servo/README.md
@@ -144,17 +144,17 @@ Pre-installed Android tools are needed. 
 [details](https://github.com/servo/servo/wiki/Building-for-Android)
 
 ## The Rust compiler
 
 Servo's build system automatically downloads a Rust compiler to build itself.
 This is normally a specific revision of Rust upstream, but sometimes has a
 backported patch or two.
 If you'd like to know which nightly build of Rust we use, see
-[`rust-nightly-date`](https://github.com/servo/servo/blob/master/rust-nightly-date).
+[`rust-commit-hash`](https://github.com/servo/servo/blob/master/rust-commit-hash).
 
 ## Building
 
 Servo is built with Cargo, the Rust package manager. We also use Mozilla's
 Mach tools to orchestrate the build and other tasks.
 
 ### Normal build
 
--- a/servo/appveyor.yml
+++ b/servo/appveyor.yml
@@ -32,18 +32,18 @@ environment:
   - TARGET: nightly-x86_64-pc-windows-msvc
   - TARGET: nightly-x86_64-pc-windows-gnu
 
 branches:
   only:
     - master
 
 cache:
-  - .servo -> rust-nightly-date, cargo-commit-hash
-  - .cargo -> rust-nightly-date, cargo-commit-hash
+  - .servo -> rust-commit-hash, cargo-commit-hash
+  - .cargo -> rust-commit-hash, cargo-commit-hash
   - .ccache
 
 install:
   - if %TARGET:*-msvc=msvc%==msvc set BUILD_ENV=msvc
   - if %TARGET:*-gnu=gnu%==gnu set BUILD_ENV=gnu
   - if %BUILD_ENV%==gnu  set PATH=C:\msys64\mingw64\bin;C:\msys64\usr\bin\;%PATH%
   - if %BUILD_ENV%==gnu  set MSYSTEM=MINGW64
   - if %BUILD_ENV%==gnu  set MSYS=winsymlinks=lnk
--- a/servo/python/servo/bootstrap_commands.py
+++ b/servo/python/servo/bootstrap_commands.py
@@ -65,35 +65,41 @@ class MachCommands(CommandBase):
                      action='store_true',
                      help='Use stable rustc version')
     def bootstrap_rustc(self, force=False, target=[], stable=False):
         self.set_use_stable_rust(stable)
         version = self.rust_version()
         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=" ")
             print("Use |bootstrap-rust --force| to download again.")
         else:
             if path.isdir(rust_dir):
                 shutil.rmtree(rust_dir)
             os.makedirs(rust_dir)
 
             # The nightly Rust compiler is hosted on the nightly server under the date with a name
             # rustc-nightly-HOST-TRIPLE.tar.gz, whereas the stable compiler is named
             # rustc-VERSION-HOST-TRIPLE.tar.gz. We just need to pull down and extract it,
             # giving a directory name that will be the same as the tarball name (rustc is
             # in that directory).
             if stable:
                 tarball = "rustc-%s-%s.tar.gz" % (version, host_triple())
+                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://static-rust-lang-org.s3.amazonaws.com/dist/" + 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)
 
             print("Extracting Rust compiler...")
             extract(tgz_file, install_dir)
             print("Rust compiler ready.")
 
@@ -121,17 +127,17 @@ class MachCommands(CommandBase):
                 print("Use |bootstrap-rust --force| to download again.")
                 continue
 
             if self.use_stable_rust():
                 std_url = ("https://static-rust-lang-org.s3.amazonaws.com/dist/rust-std-%s-%s.tar.gz"
                            % (version, target_triple))
                 tgz_file = install_dir + ('rust-std-%s-%s.tar.gz' % (version, target_triple))
             else:
-                std_url = ("https://static-rust-lang-org.s3.amazonaws.com/dist/%s/rust-std-nightly-%s.tar.gz"
+                std_url = ("https://s3.amazonaws.com/rust-lang-ci/rustc-builds/%s/rust-std-nightly-%s.tar.gz"
                            % (version, target_triple))
                 tgz_file = install_dir + ('rust-std-nightly-%s.tar.gz' % target_triple)
 
             download_file("Host rust library for target %s" % target_triple, std_url, tgz_file)
             print("Extracting Rust stdlib for target %s..." % target_triple)
             extract(tgz_file, install_dir)
             shutil.copytree(path.join(install_dir,
                                       "rust-std%s%s-%s" % (nightly_suffix, stable_version, target_triple),
--- a/servo/python/servo/command_base.py
+++ b/servo/python/servo/command_base.py
@@ -253,37 +253,39 @@ class CommandBase(object):
         resolverelative("tools", "cargo-home-dir")
 
         context.sharedir = self.config["tools"]["cache-dir"]
 
         self.config["tools"].setdefault("system-rust", False)
         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())
         self.config["tools"].setdefault("rustc-with-gold", get_env_bool("SERVO_RUSTC_WITH_GOLD", True))
 
         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", "")
         self.config["build"].setdefault("incremental", False)
 
         self.config.setdefault("android", {})
         self.config["android"].setdefault("sdk", "")
         self.config["android"].setdefault("ndk", "")
         self.config["android"].setdefault("toolchain", "")
         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
     _cargo_build_id = None
 
     def set_use_stable_rust(self, use_stable_rust=True):
         self._use_stable_rust = use_stable_rust
         if not self.config["tools"]["system-rust"]:
@@ -292,23 +294,24 @@ class CommandBase(object):
 
     def use_stable_rust(self):
         return self._use_stable_rust
 
     def rust_path(self):
         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:
             filename = path.join(self.context.topdir,
-                                 "rust-stable-version" if self._use_stable_rust else "rust-nightly-date")
+                                 "rust-stable-version" if self._use_stable_rust else "rust-commit-hash")
             with open(filename) as f:
                 self._rust_version = f.read().strip()
         return self._rust_version
 
     def cargo_build_id(self):
         if self._cargo_build_id is None:
             filename = path.join(self.context.topdir, "cargo-commit-hash")
             with open(filename) as f:
new file mode 100644
--- /dev/null
+++ b/servo/rust-commit-hash
@@ -0,0 +1,1 @@
+025c328bf5ab336ff708e62a59292298dc1bc089
deleted file mode 100644
--- a/servo/rust-nightly-date
+++ /dev/null
@@ -1,1 +0,0 @@
-2017-02-05
--- a/servo/servobuild.example
+++ b/servo/servobuild.example
@@ -34,16 +34,19 @@ rustc-with-gold = true
 #notify-command = "notify-send"
 
 [build]
 # Set "mode = dev" or use `mach build --dev` to build the project with warning.
 # or Set "mode = release" or use `mach build --release` for optimized build.
 # 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
 
 # Set "debug-mozjs" or use `mach build --debug-mozjs` to build a debug spidermonkey.
 debug-mozjs = false
 
 # Set to the path to your ccache binary to enable caching of compiler outputs
 #ccache = "/usr/local/bin/ccache"
--- a/servo/tests/compiletest/plugin/compile-fail/ban-domrefcell.rs
+++ b/servo/tests/compiletest/plugin/compile-fail/ban-domrefcell.rs
@@ -8,12 +8,12 @@
 extern crate script;
 
 use script::test::DOMRefCell;
 use script::test::JS;
 use script::test::Node;
 
 struct Foo {
     bar: DOMRefCell<JS<Node>>
-    //~^ ERROR Banned type DOMRefCell<JS<T>> detected. Use MutJS<JS<T>> instead,
+    //~^ ERROR Banned type DOMRefCell<JS<T>> detected. Use MutJS<JS<T>> instead
 }
 
 fn main() {}
--- a/servo/tests/compiletest/plugin/compile-fail/ban.rs
+++ b/servo/tests/compiletest/plugin/compile-fail/ban.rs
@@ -7,12 +7,12 @@
 
 extern crate js;
 
 use js::jsval::JSVal;
 use std::cell::Cell;
 
 struct Foo {
     bar: Cell<JSVal>
-    //~^ ERROR Banned type Cell<JSVal> detected. Use MutJS<JSVal> instead,
+    //~^ ERROR Banned type Cell<JSVal> detected. Use MutJS<JSVal> instead
 }
 
 fn main() {}
--- a/servo/tests/compiletest/plugin/compile-fail/privatize.rs
+++ b/servo/tests/compiletest/plugin/compile-fail/privatize.rs
@@ -3,15 +3,15 @@
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #![allow(dead_code)]
 
 #[macro_use]
 extern crate deny_public_fields;
 
 #[derive(DenyPublicFields)]
-//~^ ERROR custom derive attribute panicked
+//~^ ERROR proc-macro derive panicked
 struct Foo {
     pub v1: i32,
     v2: i32
 }
 
 fn main() {}