From fe0d2866f12aabedca5cc4394d642a5bf0e30fbe Mon Sep 17 00:00:00 2001 From: Simon Sapin Date: Sun, 14 Jan 2018 01:38:37 +0100 Subject: [PATCH 1/4] Restore the ability to disable incremental compilation It became the default in debug mode in the last Rust/Cargo update. --- python/servo/command_base.py | 4 +++- servobuild.example | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/python/servo/command_base.py b/python/servo/command_base.py index bfc7192df97..b58ac21807f 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", {}) @@ -439,6 +439,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..a328e24725e 100644 --- a/servobuild.example +++ b/servobuild.example @@ -40,8 +40,10 @@ 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 +# The default is enabled in debug mode only. #incremental = false +#incremental = true # Whether to use ThinLTO or not #thinlto = false From 631623a80ed7cd2c15eb1dd2abfcfc3b9b7e59e4 Mon Sep 17 00:00:00 2001 From: Simon Sapin Date: Sun, 14 Jan 2018 01:39:31 +0100 Subject: [PATCH 2/4] Remove work-around that is now unnecessary We use rustup.rs, where each toolchain has its own Cargo version. --- python/servo/command_base.py | 4 ---- 1 file changed, 4 deletions(-) diff --git a/python/servo/command_base.py b/python/servo/command_base.py index b58ac21807f..360fe1a2701 100644 --- a/python/servo/command_base.py +++ b/python/servo/command_base.py @@ -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: From 9ec53344f5e4895e24d6b4df7bbf49470c060a51 Mon Sep 17 00:00:00 2001 From: Simon Sapin Date: Tue, 16 Jan 2018 14:39:01 +0100 Subject: [PATCH 3/4] servobuild: comment some more on the default value --- servobuild.example | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/servobuild.example b/servobuild.example index a328e24725e..2a65bbabc8d 100644 --- a/servobuild.example +++ b/servobuild.example @@ -41,7 +41,10 @@ debug-mozjs = false #rustflags = "" # Enable or disable rustc’s incremental compilation -# The default is enabled in debug mode only. +# 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 From e790ee976ee2734705c513ab6ecc47af275c92b7 Mon Sep 17 00:00:00 2001 From: Simon Sapin Date: Tue, 16 Jan 2018 14:39:30 +0100 Subject: [PATCH 4/4] servobuild: remove obsolete comment --- servobuild.example | 2 -- 1 file changed, 2 deletions(-) diff --git a/servobuild.example b/servobuild.example index 2a65bbabc8d..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