Fix "option Z is unstable" warning on geckolib with incremental=true

`incremental = true` can be set in the `[build]` section of `.servobuild`
to enable incremental compilation.

In `./mach build-geckolib`, which uses a stable version of the compiler,
this would cause a warning repeated for each invocation of rustc:

```
warning: the option `Z` is unstable and should only be used on the nightly
compiler, but it is currently accepted for backwards compatibility;
this will soon change, see issue #31847 for more details
```

This PR disables incremental compilation for `build-geckolib`,
regardless of `.servobuild` settings.
This commit is contained in:
Simon Sapin 2017-03-16 21:59:07 +01:00
parent e34aac03ff
commit af1edaa883

View file

@ -296,6 +296,11 @@ class CommandBase(object):
if not self.config["tools"]["system-rust"]:
self.config["tools"]["rust-root"] = path.join(
self.context.sharedir, "rust", self.rust_path())
if use_stable_rust:
# Cargo maintainer's position is that CARGO_INCREMENTAL is a nightly-only feature
# and should not be used on the stable channel.
# https://github.com/rust-lang/cargo/issues/3835
self.config["build"]["incremental"] = False
def use_stable_rust(self):
return self._use_stable_rust