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

--HG--
extra : subtree_source : https%3A//hg.mozilla.org/projects/converted-servo-linear
extra : subtree_revision : 5a783721d549881760dfac0fe76eee89b88eea70
This commit is contained in:
Anthony Ramine 2017-02-15 06:46:22 -08:00
parent f79ed665d6
commit 38f941302b
10 changed files with 25 additions and 13 deletions

View File

@ -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

View File

@ -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:

View File

@ -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=" ")
@ -86,9 +88,13 @@ class MachCommands(CommandBase):
# 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 @@ class MachCommands(CommandBase):
% (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)

View File

@ -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,13 +299,14 @@ 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:
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

1
servo/rust-commit-hash Normal file
View File

@ -0,0 +1 @@
025c328bf5ab336ff708e62a59292298dc1bc089

View File

@ -1 +0,0 @@
2017-02-05

View File

@ -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

View File

@ -13,7 +13,7 @@ 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() {}

View File

@ -12,7 +12,7 @@ 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() {}

View File

@ -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