Skip to content

Commit 4f10a0f

Browse files
author
bors-servo
authored
Auto merge of #15559 - servo:rustup, r=SimonSapin
Allow disabling LLVM assertions in rustc (fixes #15548) <!-- Reviewable:start --> This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/15559) <!-- Reviewable:end -->
2 parents 216a89f + 57fd45a commit 4f10a0f

File tree

10 files changed

+25
-13
lines changed

10 files changed

+25
-13
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,7 @@ Servo's build system automatically downloads a Rust compiler to build itself.
149149
This is normally a specific revision of Rust upstream, but sometimes has a
150150
backported patch or two.
151151
If you'd like to know which nightly build of Rust we use, see
152-
[`rust-nightly-date`](https://github.com/servo/servo/blob/master/rust-nightly-date).
152+
[`rust-commit-hash`](https://github.com/servo/servo/blob/master/rust-commit-hash).
153153

154154
## Building
155155

appveyor.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,8 @@ branches:
3737
- master
3838

3939
cache:
40-
- .servo -> rust-nightly-date, cargo-commit-hash
41-
- .cargo -> rust-nightly-date, cargo-commit-hash
40+
- .servo -> rust-commit-hash, cargo-commit-hash
41+
- .cargo -> rust-commit-hash, cargo-commit-hash
4242
- .ccache
4343

4444
install:

python/servo/bootstrap_commands.py

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,8 @@ def bootstrap_rustc(self, force=False, target=[], stable=False):
7070
rust_path = self.rust_path()
7171
rust_dir = path.join(self.context.sharedir, "rust", rust_path)
7272
install_dir = path.join(self.context.sharedir, "rust", version)
73+
if not self.config["build"]["llvm-assertions"]:
74+
install_dir += "-alt"
7375

7476
if not force and path.exists(path.join(rust_dir, "rustc", "bin", "rustc" + BIN_SUFFIX)):
7577
print("Rust compiler already downloaded.", end=" ")
@@ -86,9 +88,13 @@ def bootstrap_rustc(self, force=False, target=[], stable=False):
8688
# in that directory).
8789
if stable:
8890
tarball = "rustc-%s-%s.tar.gz" % (version, host_triple())
91+
rustc_url = "https://static-rust-lang-org.s3.amazonaws.com/dist/" + tarball
8992
else:
9093
tarball = "%s/rustc-nightly-%s.tar.gz" % (version, host_triple())
91-
rustc_url = "https://static-rust-lang-org.s3.amazonaws.com/dist/" + tarball
94+
base_url = "https://s3.amazonaws.com/rust-lang-ci/rustc-builds"
95+
if not self.config["build"]["llvm-assertions"]:
96+
base_url += "-alt"
97+
rustc_url = base_url + "/" + tarball
9298
tgz_file = rust_dir + '-rustc.tar.gz'
9399

94100
download_file("Rust compiler", rustc_url, tgz_file)
@@ -126,7 +132,7 @@ def bootstrap_rustc(self, force=False, target=[], stable=False):
126132
% (version, target_triple))
127133
tgz_file = install_dir + ('rust-std-%s-%s.tar.gz' % (version, target_triple))
128134
else:
129-
std_url = ("https://static-rust-lang-org.s3.amazonaws.com/dist/%s/rust-std-nightly-%s.tar.gz"
135+
std_url = ("https://s3.amazonaws.com/rust-lang-ci/rustc-builds/%s/rust-std-nightly-%s.tar.gz"
130136
% (version, target_triple))
131137
tgz_file = install_dir + ('rust-std-nightly-%s.tar.gz' % target_triple)
132138

python/servo/command_base.py

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -258,7 +258,6 @@ def resolverelative(category, key):
258258
self.config["tools"].setdefault("system-cargo", False)
259259
self.config["tools"].setdefault("rust-root", "")
260260
self.config["tools"].setdefault("cargo-root", "")
261-
self.set_use_stable_rust(False)
262261
if not self.config["tools"]["system-cargo"]:
263262
self.config["tools"]["cargo-root"] = path.join(
264263
context.sharedir, "cargo", self.cargo_build_id())
@@ -267,6 +266,7 @@ def resolverelative(category, key):
267266
self.config.setdefault("build", {})
268267
self.config["build"].setdefault("android", False)
269268
self.config["build"].setdefault("mode", "")
269+
self.config["build"].setdefault("llvm-assertions", True)
270270
self.config["build"].setdefault("debug-mozjs", False)
271271
self.config["build"].setdefault("ccache", "")
272272
self.config["build"].setdefault("rustflags", "")
@@ -279,6 +279,8 @@ def resolverelative(category, key):
279279
self.config["android"].setdefault("platform", "android-18")
280280
self.config["android"].setdefault("target", "arm-linux-androideabi")
281281

282+
self.set_use_stable_rust(False)
283+
282284
_use_stable_rust = False
283285
_rust_version = None
284286
_rust_version_is_stable = False
@@ -297,13 +299,14 @@ def rust_path(self):
297299
version = self.rust_version()
298300
if self._use_stable_rust:
299301
return os.path.join(version, "rustc-%s-%s" % (version, host_triple()))
300-
else:
301-
return os.path.join(version, "rustc-nightly-%s" % (host_triple()))
302+
if not self.config["build"]["llvm-assertions"]:
303+
version += "-alt"
304+
return os.path.join(version, "rustc-nightly-%s" % (host_triple()))
302305

303306
def rust_version(self):
304307
if self._rust_version is None or self._use_stable_rust != self._rust_version_is_stable:
305308
filename = path.join(self.context.topdir,
306-
"rust-stable-version" if self._use_stable_rust else "rust-nightly-date")
309+
"rust-stable-version" if self._use_stable_rust else "rust-commit-hash")
307310
with open(filename) as f:
308311
self._rust_version = f.read().strip()
309312
return self._rust_version

rust-commit-hash

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
025c328bf5ab336ff708e62a59292298dc1bc089

rust-nightly-date

Lines changed: 0 additions & 1 deletion
This file was deleted.

servobuild.example

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,9 @@ rustc-with-gold = true
3939
# Defaults to prompting before building
4040
#mode = "dev"
4141

42+
# Whether to enable LLVM assertions in rustc.
43+
#llvm-assertions = true
44+
4245
# Set "android = true" or use `mach build --android` to build the Android app.
4346
android = false
4447

tests/compiletest/plugin/compile-fail/ban-domrefcell.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ use script::test::Node;
1313

1414
struct Foo {
1515
bar: DOMRefCell<JS<Node>>
16-
//~^ ERROR Banned type DOMRefCell<JS<T>> detected. Use MutJS<JS<T>> instead,
16+
//~^ ERROR Banned type DOMRefCell<JS<T>> detected. Use MutJS<JS<T>> instead
1717
}
1818

1919
fn main() {}

tests/compiletest/plugin/compile-fail/ban.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ use std::cell::Cell;
1212

1313
struct Foo {
1414
bar: Cell<JSVal>
15-
//~^ ERROR Banned type Cell<JSVal> detected. Use MutJS<JSVal> instead,
15+
//~^ ERROR Banned type Cell<JSVal> detected. Use MutJS<JSVal> instead
1616
}
1717

1818
fn main() {}

tests/compiletest/plugin/compile-fail/privatize.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
extern crate deny_public_fields;
99

1010
#[derive(DenyPublicFields)]
11-
//~^ ERROR custom derive attribute panicked
11+
//~^ ERROR proc-macro derive panicked
1212
struct Foo {
1313
pub v1: i32,
1414
v2: i32

0 commit comments

Comments
 (0)