diff --git a/README.md b/README.md index b1a73eade573..b733d912523a 100644 --- a/README.md +++ b/README.md @@ -149,7 +149,7 @@ 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 diff --git a/appveyor.yml b/appveyor.yml index 782ce173da11..a81c576d4b82 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -37,8 +37,8 @@ branches: - 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: diff --git a/python/servo/bootstrap_commands.py b/python/servo/bootstrap_commands.py index 8975f174d840..aa2986118259 100644 --- a/python/servo/bootstrap_commands.py +++ b/python/servo/bootstrap_commands.py @@ -70,6 +70,8 @@ def bootstrap_rustc(self, force=False, target=[], stable=False): 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=" ") @@ -86,9 +88,13 @@ def bootstrap_rustc(self, force=False, target=[], stable=False): # 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) @@ -126,7 +132,7 @@ def bootstrap_rustc(self, force=False, target=[], stable=False): % (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) diff --git a/python/servo/command_base.py b/python/servo/command_base.py index 3169e9c9d6a6..5ad351b34116 100644 --- a/python/servo/command_base.py +++ b/python/servo/command_base.py @@ -258,7 +258,6 @@ def resolverelative(category, key): 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 @@ def resolverelative(category, key): 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 @@ def resolverelative(category, key): 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,13 +299,14 @@ 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 diff --git a/rust-commit-hash b/rust-commit-hash new file mode 100644 index 000000000000..88ae055e46e9 --- /dev/null +++ b/rust-commit-hash @@ -0,0 +1 @@ +025c328bf5ab336ff708e62a59292298dc1bc089 diff --git a/rust-nightly-date b/rust-nightly-date deleted file mode 100644 index 59e27d02131c..000000000000 --- a/rust-nightly-date +++ /dev/null @@ -1 +0,0 @@ -2017-02-05 diff --git a/servobuild.example b/servobuild.example index 1cf444f57aa3..4e77184666c4 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 diff --git a/tests/compiletest/plugin/compile-fail/ban-domrefcell.rs b/tests/compiletest/plugin/compile-fail/ban-domrefcell.rs index 4ec48545361b..e68c3b9bc9bd 100644 --- a/tests/compiletest/plugin/compile-fail/ban-domrefcell.rs +++ b/tests/compiletest/plugin/compile-fail/ban-domrefcell.rs @@ -13,7 +13,7 @@ use script::test::Node; struct Foo { bar: DOMRefCell> - //~^ ERROR Banned type DOMRefCell> detected. Use MutJS> instead, + //~^ ERROR Banned type DOMRefCell> detected. Use MutJS> instead } fn main() {} diff --git a/tests/compiletest/plugin/compile-fail/ban.rs b/tests/compiletest/plugin/compile-fail/ban.rs index b0ea769b4a89..ebcedffce31f 100644 --- a/tests/compiletest/plugin/compile-fail/ban.rs +++ b/tests/compiletest/plugin/compile-fail/ban.rs @@ -12,7 +12,7 @@ use std::cell::Cell; struct Foo { bar: Cell - //~^ ERROR Banned type Cell detected. Use MutJS instead, + //~^ ERROR Banned type Cell detected. Use MutJS instead } fn main() {} diff --git a/tests/compiletest/plugin/compile-fail/privatize.rs b/tests/compiletest/plugin/compile-fail/privatize.rs index ef185c2169c9..c907a7fa4b3f 100644 --- a/tests/compiletest/plugin/compile-fail/privatize.rs +++ b/tests/compiletest/plugin/compile-fail/privatize.rs @@ -8,7 +8,7 @@ extern crate deny_public_fields; #[derive(DenyPublicFields)] -//~^ ERROR custom derive attribute panicked +//~^ ERROR proc-macro derive panicked struct Foo { pub v1: i32, v2: i32