servo: Merge #13601 - Ensure that SERVO_ENABLE_DEBUG_ASSERTIONS is also used in build-cef (from larsbergstrom:debug_assertions_cef); r=nox
authorLars Bergstrom <lars@lars.com>
Wed, 05 Oct 2016 09:57:06 -0500
changeset 339839 9bb1e7415bd101835a773421b5a5ae288a06c98f
parent 339838 a66c976d84b35e66dc8b2e12515d8631abc6b32f
child 339840 87fc57c8457def5fa65210f7e957998e14dc5ad6
push id31307
push usergszorc@mozilla.com
push dateSat, 04 Feb 2017 00:59:06 +0000
treeherdermozilla-central@94079d43835f [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersnox
servo: Merge #13601 - Ensure that SERVO_ENABLE_DEBUG_ASSERTIONS is also used in build-cef (from larsbergstrom:debug_assertions_cef); r=nox r? @nox Fixes #13591 This fixes the problem with rebuilding all of CEF on the linux-rel builders by ensuring it gets the same `RUSTFLAGS`. Proof: ``` [larsberg@larsberg servo2]$ ./mach build-cef -r Compiling embedding v0.0.1 (file:///Users/larsberg/servo2/ports/cef) Finished release [optimized] target(s) in 35.42 secs [Warning] Could not generate notification! Optional Python module 'pyobjc' is not installed. CEF build completed in 0:00:38 [larsberg@larsberg servo2]$ ``` Source-Repo: https://github.com/servo/servo Source-Revision: 9c2610146ae3a61e1da917a9fd5e3902bd267d4a
servo/python/servo/build_commands.py
--- a/servo/python/servo/build_commands.py
+++ b/servo/python/servo/build_commands.py
@@ -319,19 +319,28 @@ class MachCommands(CommandBase):
         if release:
             opts += ["--release"]
 
         servo_features = self.servo_features()
         if servo_features:
             opts += ["--features", "%s" % ' '.join("servo/" + x for x in servo_features)]
 
         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):
+            env["RUSTFLAGS"] = "-C debug_assertions"
+
         with cd(path.join("ports", "cef")):
             ret = call(["cargo", "build"] + opts,
-                       env=self.build_env(is_build=True), verbose=verbose)
+                       env=env,
+                       verbose=verbose)
         elapsed = time() - build_start
 
         # Generate Desktop Notification if elapsed-time > some threshold value
         notify_build_done(elapsed)
 
         print("CEF build completed in %s" % format_duration(elapsed))
 
         return ret