diff --git a/python/servo/command_base.py b/python/servo/command_base.py index bfc7192df97..360fe1a2701 100644 --- a/python/servo/command_base.py +++ b/python/servo/command_base.py @@ -278,7 +278,7 @@ class CommandBase(object): 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", {}) @@ -296,10 +296,6 @@ class CommandBase(object): 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: @@ -439,6 +435,8 @@ class CommandBase(object): 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": diff --git a/servobuild.example b/servobuild.example index 98dd8edaf9c..2df2dc256e1 100644 --- a/servobuild.example +++ b/servobuild.example @@ -1,6 +1,4 @@ # 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 @@ -40,8 +38,13 @@ debug-mozjs = false # 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