Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow disabling LLVM assertions in rustc (fixes #15548) #15559

Merged
merged 2 commits into from Feb 15, 2017
Merged
Changes from all commits
Commits
File filter...
Filter file types
Jump to…
Jump to file
Failed to load files.

Always

Just for now

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

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

@@ -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
@@ -0,0 +1 @@
025c328bf5ab336ff708e62a59292298dc1bc089

This file was deleted.

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

@@ -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() {}
@@ -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() {}
@@ -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
ProTip! Use n and p to navigate between commits in a pull request.
You can’t perform that action at this time.