Skip to content

Commit d96564b

Browse files
committed
servo: Merge #15564 - Disable LLVM assertions by default, on supported platforms (from servo:no-gods-no-masters-no-assertions); r=Ms2ger
<!-- Please describe your changes on the following line: --> servo/servo#15559 (comment) > With an empty incremental compilation cache (or, presumably, with incremental compilation disabled), LLVM assertions add 16% to the compilation time in debug mode, 53% (!) in release mode. --- <!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `__` with appropriate data: --> - [x] `./mach build -d` does not report any errors - [x] `./mach test-tidy` does not report any errors - [x] These changes fix #15548 (github issue number if applicable). <!-- Either: --> - [ ] There are tests for these changes OR - [ ] These changes do not require tests because _____ <!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. --> Source-Repo: https://github.com/servo/servo Source-Revision: 1afae52c47e754c6573f4a8b72fcc2e6994d253f
1 parent 41e7ca7 commit d96564b

File tree

4 files changed

+26
-17
lines changed

4 files changed

+26
-17
lines changed

servo/etc/ci/buildbot_steps.yml

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,9 @@ mac-rel-wpt2:
1414
- ./mach filter-intermittents wpt-errorsummary.log --log-intermittents intermittents.log --log-filteredsummary filtered-wpt-errorsummary.log --use-tracker
1515

1616
mac-dev-unit:
17-
- ./mach build --dev
18-
- ./mach test-unit
19-
- ./mach build-cef
17+
- env SERVO_RUSTC_LLVM_ASSERTIONS=1 ./mach build --dev
18+
- env SERVO_RUSTC_LLVM_ASSERTIONS=1 ./mach test-unit
19+
- env SERVO_RUSTC_LLVM_ASSERTIONS=1 ./mach build-cef
2020
- ./mach build-geckolib
2121
- bash ./etc/ci/lockfile_changed.sh
2222
- bash ./etc/ci/manifest_changed.sh
@@ -46,10 +46,10 @@ mac-rel-intermittent:
4646
linux-dev:
4747
- ./mach test-tidy --no-progress --all
4848
- ./mach test-tidy --no-progress --self-test
49-
- ./mach build --dev
50-
- ./mach test-compiletest
51-
- ./mach test-unit
52-
- ./mach build-cef
49+
- env SERVO_RUSTC_LLVM_ASSERTIONS=1 ./mach build --dev
50+
- env SERVO_RUSTC_LLVM_ASSERTIONS=1 ./mach test-compiletest
51+
- env SERVO_RUSTC_LLVM_ASSERTIONS=1 ./mach test-unit
52+
- env SERVO_RUSTC_LLVM_ASSERTIONS=1 ./mach build-cef
5353
- ./mach build-geckolib
5454
- ./mach test-stylo
5555
- bash ./etc/ci/lockfile_changed.sh
@@ -79,24 +79,24 @@ linux-nightly:
7979
- ./etc/ci/upload_nightly.sh linux
8080

8181
android:
82-
- ./mach build --android --dev
83-
- ./mach package --android --dev
82+
- env SERVO_RUSTC_LLVM_ASSERTIONS=1 ./mach build --android --dev
83+
- env SERVO_RUSTC_LLVM_ASSERTIONS=1 ./mach package --android --dev
8484
- bash ./etc/ci/lockfile_changed.sh
8585
- bash ./etc/ci/manifest_changed.sh
8686
- python ./etc/ci/check_dynamic_symbols.py
8787

8888
android-nightly:
89-
- ./mach build --android --release
90-
- ./mach package --android --release
89+
- env SERVO_RUSTC_LLVM_ASSERTIONS=1 ./mach build --android --release
90+
- env SERVO_RUSTC_LLVM_ASSERTIONS=1 ./mach package --android --release
9191
- ./etc/ci/upload_nightly.sh android
9292

9393
arm32:
94-
- ./mach build --rel --target=arm-unknown-linux-gnueabihf
94+
- env SERVO_RUSTC_LLVM_ASSERTIONS=1 ./mach build --rel --target=arm-unknown-linux-gnueabihf
9595
- bash ./etc/ci/lockfile_changed.sh
9696
- bash ./etc/ci/manifest_changed.sh
9797

9898
arm64:
99-
- ./mach build --rel --target=aarch64-unknown-linux-gnu
99+
- env SERVO_RUSTC_LLVM_ASSERTIONS=1 ./mach build --rel --target=aarch64-unknown-linux-gnu
100100
- bash ./etc/ci/lockfile_changed.sh
101101
- bash ./etc/ci/manifest_changed.sh
102102

servo/python/servo/command_base.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
import toml
2424

2525
from servo.packages import WINDOWS_MSVC as msvc_deps
26-
from servo.util import host_triple
26+
from servo.util import host_triple, host_platform
2727

2828
BIN_SUFFIX = ".exe" if sys.platform == "win32" else ""
2929

@@ -263,10 +263,15 @@ def resolverelative(category, key):
263263
context.sharedir, "cargo", self.cargo_build_id())
264264
self.config["tools"].setdefault("rustc-with-gold", get_env_bool("SERVO_RUSTC_WITH_GOLD", True))
265265

266+
# https://github.com/rust-lang/rust/pull/39754
267+
platforms_with_rustc_alt_builds = ["unknown-linux-gnu", "apple-darwin", "pc-windows-msvc"]
268+
llvm_assertions_default = ("SERVO_RUSTC_LLVM_ASSERTIONS" in os.environ
269+
or host_platform() not in platforms_with_rustc_alt_builds)
270+
266271
self.config.setdefault("build", {})
267272
self.config["build"].setdefault("android", False)
268273
self.config["build"].setdefault("mode", "")
269-
self.config["build"].setdefault("llvm-assertions", True)
274+
self.config["build"].setdefault("llvm-assertions", llvm_assertions_default)
270275
self.config["build"].setdefault("debug-mozjs", False)
271276
self.config["build"].setdefault("ccache", "")
272277
self.config["build"].setdefault("rustflags", "")

servo/python/servo/util.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
import urllib2
2121

2222

23-
def host_triple():
23+
def host_platform():
2424
os_type = platform.system().lower()
2525
if os_type == "linux":
2626
os_type = "unknown-linux-gnu"
@@ -42,7 +42,11 @@ def host_triple():
4242
os_type = "unknown-freebsd"
4343
else:
4444
os_type = "unknown"
45+
return os_type
46+
4547

48+
def host_triple():
49+
os_type = host_platform()
4650
cpu_type = platform.machine().lower()
4751
if os_type.endswith("-msvc"):
4852
# vcvars*.bat should set it properly

servo/servobuild.example

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ rustc-with-gold = true
4040
#mode = "dev"
4141

4242
# Whether to enable LLVM assertions in rustc.
43-
#llvm-assertions = true
43+
#llvm-assertions = false
4444

4545
# Set "android = true" or use `mach build --android` to build the Android app.
4646
android = false

0 commit comments

Comments
 (0)