aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorbors-servo <lbergstrom+bors@mozilla.com>2016-11-05 22:57:44 -0500
committerGitHub <noreply@github.com>2016-11-05 22:57:44 -0500
commitdbce416ad436b9a3a007181fbd5d0f158cd7d9e4 (patch)
tree35964c9bdbdc941b7587a7340968f492e210ce05
parentbc9a8f58db140bc685998e7c3587e4c68915e06f (diff)
parent76ec3f423adabed526d074cc0948945fb1ada031 (diff)
downloadservo-dbce416ad436b9a3a007181fbd5d0f158cd7d9e4.tar.gz
servo-dbce416ad436b9a3a007181fbd5d0f158cd7d9e4.zip
Auto merge of #14025 - iamrohit7:debug-assertions, r=Wafflespeanut
Add --with-debug-assertions flag for Mach I tested out building a release with the flag and added a `debug_assert!(false)` in `fn main` and it panicked. <!-- 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 #14009 (github issue number if applicable). <!-- Either: --> - [ ] There are tests for these changes OR - [X] These changes do not require tests because they are manually tested <!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. --> <!-- 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/14025) <!-- Reviewable:end -->
-rw-r--r--etc/ci/buildbot_steps.yml6
-rw-r--r--python/servo/build_commands.py24
2 files changed, 17 insertions, 13 deletions
diff --git a/etc/ci/buildbot_steps.yml b/etc/ci/buildbot_steps.yml
index 0b6ae34f92b..19d67c02f25 100644
--- a/etc/ci/buildbot_steps.yml
+++ b/etc/ci/buildbot_steps.yml
@@ -55,15 +55,15 @@ linux-dev:
- bash ./etc/ci/check_no_panic.sh
linux-rel-wpt:
- - ./mach build --release
+ - ./mach build --release --with-debug-assertions
- ./mach test-wpt-failure
- ./mach test-wpt --release --processes 24 --log-raw test-wpt.log --log-errorsummary wpt-errorsummary.log
- ./mach test-wpt --release --binary-arg=--multiprocess --processes 24 --log-raw test-wpt-mp.log --log-errorsummary wpt-mp-errorsummary.log eventsource
linux-rel-css:
- - ./mach build --release
+ - ./mach build --release --with-debug-assertions
- ./mach test-css --release --processes 16 --log-raw test-css.log --log-errorsummary css-errorsummary.log
- - ./mach build-cef --release
+ - ./mach build-cef --release --with-debug-assertions
- ./mach build-geckolib --release
- ./mach test-stylo --release
- bash ./etc/ci/lockfile_changed.sh
diff --git a/python/servo/build_commands.py b/python/servo/build_commands.py
index 8f05c3e3376..b78a286be61 100644
--- a/python/servo/build_commands.py
+++ b/python/servo/build_commands.py
@@ -153,8 +153,13 @@ class MachCommands(CommandBase):
help='Print verbose output')
@CommandArgument('params', nargs='...',
help="Command-line arguments to be passed through to Cargo")
+ @CommandArgument('--with-debug-assertions',
+ default=None,
+ action='store_true',
+ help='Enable debug assertions in release')
def build(self, target=None, release=False, dev=False, jobs=None,
- features=None, android=None, verbose=False, debug_mozjs=False, params=None):
+ features=None, android=None, verbose=False, debug_mozjs=False, params=None,
+ with_debug_assertions=False):
if android is None:
android = self.config["build"]["android"]
features = features or self.servo_features()
@@ -217,10 +222,7 @@ class MachCommands(CommandBase):
build_start = time()
env = self.build_env(target=target, is_build=True)
- # TODO: If this ends up making it, we should probably add a
- # --release-with-debug-assertions option or similar, so it's easier to
- # build locally.
- if env.get("SERVO_ENABLE_DEBUG_ASSERTIONS", None):
+ if with_debug_assertions:
env["RUSTFLAGS"] = "-C debug_assertions"
if android:
@@ -339,7 +341,12 @@ class MachCommands(CommandBase):
@CommandArgument('--release', '-r',
action='store_true',
help='Build in release mode')
- def build_cef(self, jobs=None, verbose=False, release=False):
+ @CommandArgument('--with-debug-assertions',
+ default=None,
+ action='store_true',
+ help='Enable debug assertions in release')
+ def build_cef(self, jobs=None, verbose=False, release=False,
+ with_debug_assertions=False):
self.ensure_bootstrapped()
ret = None
@@ -358,10 +365,7 @@ class MachCommands(CommandBase):
build_start = time()
env = self.build_env(is_build=True)
- # TODO: If this ends up making it, we should probably add a
- # --release-with-debug-assertions option or similar, so it's easier to
- # build locally.
- if env.get("SERVO_ENABLE_DEBUG_ASSERTIONS", None):
+ if with_debug_assertions:
env["RUSTFLAGS"] = "-C debug_assertions"
with cd(path.join("ports", "cef")):