Skip to content

Commit

Permalink
servo: Merge #15564 - Disable LLVM assertions by default, on supporte…
Browse files Browse the repository at this point in the history
…d 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
  • Loading branch information
SimonSapin committed Feb 17, 2017
1 parent 2c704cc commit 7069eed
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 17 deletions.
26 changes: 13 additions & 13 deletions servo/etc/ci/buildbot_steps.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@ mac-rel-wpt2:
- ./mach filter-intermittents wpt-errorsummary.log --log-intermittents intermittents.log --log-filteredsummary filtered-wpt-errorsummary.log --use-tracker

mac-dev-unit:
- ./mach build --dev
- ./mach test-unit
- ./mach build-cef
- env SERVO_RUSTC_LLVM_ASSERTIONS=1 ./mach build --dev
- env SERVO_RUSTC_LLVM_ASSERTIONS=1 ./mach test-unit
- env SERVO_RUSTC_LLVM_ASSERTIONS=1 ./mach build-cef
- ./mach build-geckolib
- bash ./etc/ci/lockfile_changed.sh
- bash ./etc/ci/manifest_changed.sh
Expand Down Expand Up @@ -46,10 +46,10 @@ mac-rel-intermittent:
linux-dev:
- ./mach test-tidy --no-progress --all
- ./mach test-tidy --no-progress --self-test
- ./mach build --dev
- ./mach test-compiletest
- ./mach test-unit
- ./mach build-cef
- env SERVO_RUSTC_LLVM_ASSERTIONS=1 ./mach build --dev
- env SERVO_RUSTC_LLVM_ASSERTIONS=1 ./mach test-compiletest
- env SERVO_RUSTC_LLVM_ASSERTIONS=1 ./mach test-unit
- env SERVO_RUSTC_LLVM_ASSERTIONS=1 ./mach build-cef
- ./mach build-geckolib
- ./mach test-stylo
- bash ./etc/ci/lockfile_changed.sh
Expand Down Expand Up @@ -79,24 +79,24 @@ linux-nightly:
- ./etc/ci/upload_nightly.sh linux

android:
- ./mach build --android --dev
- ./mach package --android --dev
- env SERVO_RUSTC_LLVM_ASSERTIONS=1 ./mach build --android --dev
- env SERVO_RUSTC_LLVM_ASSERTIONS=1 ./mach package --android --dev
- bash ./etc/ci/lockfile_changed.sh
- bash ./etc/ci/manifest_changed.sh
- python ./etc/ci/check_dynamic_symbols.py

android-nightly:
- ./mach build --android --release
- ./mach package --android --release
- env SERVO_RUSTC_LLVM_ASSERTIONS=1 ./mach build --android --release
- env SERVO_RUSTC_LLVM_ASSERTIONS=1 ./mach package --android --release
- ./etc/ci/upload_nightly.sh android

arm32:
- ./mach build --rel --target=arm-unknown-linux-gnueabihf
- env SERVO_RUSTC_LLVM_ASSERTIONS=1 ./mach build --rel --target=arm-unknown-linux-gnueabihf
- bash ./etc/ci/lockfile_changed.sh
- bash ./etc/ci/manifest_changed.sh

arm64:
- ./mach build --rel --target=aarch64-unknown-linux-gnu
- env SERVO_RUSTC_LLVM_ASSERTIONS=1 ./mach build --rel --target=aarch64-unknown-linux-gnu
- bash ./etc/ci/lockfile_changed.sh
- bash ./etc/ci/manifest_changed.sh

Expand Down
9 changes: 7 additions & 2 deletions servo/python/servo/command_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
import toml

from servo.packages import WINDOWS_MSVC as msvc_deps
from servo.util import host_triple
from servo.util import host_triple, host_platform

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

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

# https://github.com/rust-lang/rust/pull/39754
platforms_with_rustc_alt_builds = ["unknown-linux-gnu", "apple-darwin", "pc-windows-msvc"]
llvm_assertions_default = ("SERVO_RUSTC_LLVM_ASSERTIONS" in os.environ
or host_platform() not in platforms_with_rustc_alt_builds)

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("llvm-assertions", llvm_assertions_default)
self.config["build"].setdefault("debug-mozjs", False)
self.config["build"].setdefault("ccache", "")
self.config["build"].setdefault("rustflags", "")
Expand Down
6 changes: 5 additions & 1 deletion servo/python/servo/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
import urllib2


def host_triple():
def host_platform():
os_type = platform.system().lower()
if os_type == "linux":
os_type = "unknown-linux-gnu"
Expand All @@ -42,7 +42,11 @@ def host_triple():
os_type = "unknown-freebsd"
else:
os_type = "unknown"
return os_type


def host_triple():
os_type = host_platform()
cpu_type = platform.machine().lower()
if os_type.endswith("-msvc"):
# vcvars*.bat should set it properly
Expand Down
2 changes: 1 addition & 1 deletion servo/servobuild.example
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ rustc-with-gold = true
#mode = "dev"

# Whether to enable LLVM assertions in rustc.
#llvm-assertions = true
#llvm-assertions = false

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

0 comments on commit 7069eed

Please sign in to comment.