servo: Merge #19763 - Restore the ability to disable incremental compilation (from servo:unincremental); r=nox
authorSimon Sapin <simon.sapin@exyr.org>
Thu, 18 Jan 2018 04:08:02 -0600
changeset 399799 c032c1742ebf1256920b5dc87f0375d6b92001dd
parent 399798 780c013a773a8d01458a978e4ffce3c7df9c838f
child 399800 f2f92fe82b0ecb733948dd01954380bb20849559
push id33278
push useraciure@mozilla.com
push dateThu, 18 Jan 2018 21:46:52 +0000
treeherdermozilla-central@496576272683 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersnox
bugs19763
milestone59.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
servo: Merge #19763 - Restore the ability to disable incremental compilation (from servo:unincremental); r=nox It became the default in debug mode in the last Rust/Cargo update. Source-Repo: https://github.com/servo/servo Source-Revision: f3220eab1e6f39b4817e5ea62755a4dc6cb15c87
servo/python/servo/command_base.py
servo/servobuild.example
--- a/servo/python/servo/command_base.py
+++ b/servo/python/servo/command_base.py
@@ -273,17 +273,17 @@ class CommandBase(object):
         self.config["tools"].setdefault("rustc-with-gold", get_env_bool("SERVO_RUSTC_WITH_GOLD", True))
 
         self.config.setdefault("build", {})
         self.config["build"].setdefault("android", False)
         self.config["build"].setdefault("mode", "")
         self.config["build"].setdefault("debug-mozjs", False)
         self.config["build"].setdefault("ccache", "")
         self.config["build"].setdefault("rustflags", "")
-        self.config["build"].setdefault("incremental", False)
+        self.config["build"].setdefault("incremental", None)
         self.config["build"].setdefault("thinlto", False)
 
         self.config.setdefault("android", {})
         self.config["android"].setdefault("sdk", "")
         self.config["android"].setdefault("ndk", "")
         self.config["android"].setdefault("toolchain", "")
         # Set default android target
         self.handle_android_target("armv7-linux-androideabi")
@@ -291,20 +291,16 @@ class CommandBase(object):
         self.set_use_geckolib_toolchain(False)
 
     _use_geckolib_toolchain = False
     _geckolib_toolchain = None
     _default_toolchain = None
 
     def set_use_geckolib_toolchain(self, use_geckolib_toolchain=True):
         self._use_geckolib_toolchain = use_geckolib_toolchain
-        if use_geckolib_toolchain:
-            # We use Cargo Nightly 1.24 with Rust 1.22,
-            # it passes `-C incremental` to rustc, which is new in Rust 1.24.
-            self.config["build"]["incremental"] = False
 
     def toolchain(self):
         if self._use_geckolib_toolchain:
             return self.geckolib_toolchain()
         else:
             return self.default_toolchain()
 
     def geckolib_toolchain(self):
@@ -434,16 +430,18 @@ class CommandBase(object):
             # Always build harfbuzz from source
             env["HARFBUZZ_SYS_NO_PKG_CONFIG"] = "true"
 
         if extra_path:
             env["PATH"] = "%s%s%s" % (os.pathsep.join(extra_path), os.pathsep, env["PATH"])
 
         if self.config["build"]["incremental"]:
             env["CARGO_INCREMENTAL"] = "1"
+        elif self.config["build"]["incremental"] is not None:
+            env["CARGO_INCREMENTAL"] = "0"
 
         if extra_lib:
             if sys.platform == "darwin":
                 env["DYLD_LIBRARY_PATH"] = "%s%s%s" % \
                                            (os.pathsep.join(extra_lib),
                                             os.pathsep,
                                             env.get("DYLD_LIBRARY_PATH", ""))
             else:
--- a/servo/servobuild.example
+++ b/servo/servobuild.example
@@ -1,11 +1,9 @@
 # Copy this file to .servobuild in the Servo root directory
-# Be sure to set the cache-dir correctly, otherwise extra
-# copies of the Rust compiler may get downloaded
 
 # Paths starting with "./" are relative to the repo root
 
 # Tool options
 [tools]
 # If use-rustup is set to false, mach will run for example "cargo build"
 # instead of "rustup run --install <toolchain> cargo build"
 # It is then the user’s responsibility to ensure that cargo and especially rustc
@@ -35,18 +33,23 @@ android = false
 debug-mozjs = false
 
 # Set to the path to your ccache binary to enable caching of compiler outputs
 #ccache = "/usr/local/bin/ccache"
 
 # Any optional flags that will be added to $RUSTFLAGS
 #rustflags = ""
 
-# Enable rustc’s incremental compilation
+# Enable or disable rustc’s incremental compilation
+# Cargo’s default is to enable it in debug mode but not in release mode.
+# Leaving this key unspecified makes mach keep Cargo’s default.
+# It can be set to true or false in order to always enable or always disable
+# incremental compilation.
 #incremental = false
+#incremental = true
 
 # Whether to use ThinLTO or not
 #thinlto = false
 
 # Android information
 [android]
 # Defaults to the value of $ANDROID_SDK, $ANDROID_NDK, $ANDROID_TOOLCHAIN, $ANDROID_PLATFORM respectively
 #sdk = "/opt/android-sdk"