Auto merge of #12319 - servo:stable-geckolib, r=larsbergstrom+SimonSapin

Use a stable compiler for build-geckolib

<!-- Please describe your changes on the following line: -->

---
<!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `__` with appropriate data: -->
- [x] `./mach build -d` does not report any errors
- [x] `./mach test-tidy` does not report any errors
- [x] These changes fix #11815 (github issue number if applicable).

<!-- Either: -->
- [ ] There are tests for these changes OR
- [x] These changes do not require tests because CI already runs `./mach build-geckolib`

<!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. -->

<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/12319)
<!-- Reviewable:end -->
This commit is contained in:
bors-servo 2016-07-08 16:20:14 -07:00 committed by GitHub
commit e50e4f99bf
10 changed files with 17 additions and 266 deletions

View file

@ -7,7 +7,6 @@ dependencies = [
"env_logger 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)",
"euclid 0.7.1 (registry+https://github.com/rust-lang/crates.io-index)",
"gecko_bindings 0.0.1",
"heapsize 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)",
"lazy_static 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)",
"libc 0.2.13 (registry+https://github.com/rust-lang/crates.io-index)",
"log 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)",
@ -17,10 +16,8 @@ dependencies = [
"string_cache 0.2.20 (registry+https://github.com/rust-lang/crates.io-index)",
"style 0.0.1",
"style_traits 0.0.1",
"time 0.1.35 (registry+https://github.com/rust-lang/crates.io-index)",
"url 1.1.1 (registry+https://github.com/rust-lang/crates.io-index)",
"util 0.0.1",
"uuid 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
@ -42,80 +39,18 @@ dependencies = [
"serde 0.7.11 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
name = "aster"
version = "0.19.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
[[package]]
name = "backtrace"
version = "0.2.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"backtrace-sys 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)",
"cfg-if 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
"dbghelp-sys 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)",
"kernel32-sys 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)",
"libc 0.2.13 (registry+https://github.com/rust-lang/crates.io-index)",
"rustc-demangle 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
"winapi 0.2.7 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
name = "backtrace-sys"
version = "0.1.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"gcc 0.3.28 (registry+https://github.com/rust-lang/crates.io-index)",
"libc 0.2.13 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
name = "bincode"
version = "0.5.8"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"byteorder 0.5.3 (registry+https://github.com/rust-lang/crates.io-index)",
"num-traits 0.1.32 (registry+https://github.com/rust-lang/crates.io-index)",
"rustc-serialize 0.3.19 (registry+https://github.com/rust-lang/crates.io-index)",
"serde 0.7.11 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
name = "bitflags"
version = "0.7.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
[[package]]
name = "byteorder"
version = "0.5.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
[[package]]
name = "cfg-if"
version = "0.1.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
[[package]]
name = "cssparser"
version = "0.5.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"encoding 0.2.32 (registry+https://github.com/rust-lang/crates.io-index)",
"heapsize 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)",
"heapsize_plugin 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)",
"matches 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)",
"serde 0.7.11 (registry+https://github.com/rust-lang/crates.io-index)",
"serde_macros 0.7.11 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
name = "dbghelp-sys"
version = "0.2.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"winapi 0.2.7 (registry+https://github.com/rust-lang/crates.io-index)",
"winapi-build 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
@ -209,11 +144,6 @@ name = "fnv"
version = "1.0.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
[[package]]
name = "gcc"
version = "0.3.28"
source = "registry+https://github.com/rust-lang/crates.io-index"
[[package]]
name = "gecko_bindings"
version = "0.0.1"
@ -234,11 +164,6 @@ dependencies = [
"kernel32-sys 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
name = "heapsize_plugin"
version = "0.1.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
[[package]]
name = "idna"
version = "0.1.0"
@ -249,19 +174,6 @@ dependencies = [
"unicode-normalization 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
name = "ipc-channel"
version = "0.2.4"
source = "git+https://github.com/servo/ipc-channel#8411eeabf3a712006ad1b47637b2d8fe71177f85"
dependencies = [
"bincode 0.5.8 (registry+https://github.com/rust-lang/crates.io-index)",
"lazy_static 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)",
"libc 0.2.13 (registry+https://github.com/rust-lang/crates.io-index)",
"rand 0.3.14 (registry+https://github.com/rust-lang/crates.io-index)",
"serde 0.7.11 (registry+https://github.com/rust-lang/crates.io-index)",
"uuid 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
name = "kernel32-sys"
version = "0.2.1"
@ -312,27 +224,6 @@ dependencies = [
"libc 0.2.13 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
name = "quasi"
version = "0.13.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
[[package]]
name = "quasi_codegen"
version = "0.13.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"aster 0.19.0 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
name = "quasi_macros"
version = "0.13.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"quasi_codegen 0.13.0 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
name = "quickersort"
version = "2.0.1"
@ -367,11 +258,6 @@ name = "regex-syntax"
version = "0.3.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
[[package]]
name = "rustc-demangle"
version = "0.1.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
[[package]]
name = "rustc-serialize"
version = "0.3.19"
@ -385,8 +271,6 @@ dependencies = [
"bitflags 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)",
"cssparser 0.5.6 (registry+https://github.com/rust-lang/crates.io-index)",
"fnv 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)",
"heapsize 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)",
"heapsize_plugin 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)",
"matches 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)",
"quickersort 2.0.1 (registry+https://github.com/rust-lang/crates.io-index)",
"smallvec 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)",
@ -398,30 +282,6 @@ name = "serde"
version = "0.7.11"
source = "registry+https://github.com/rust-lang/crates.io-index"
[[package]]
name = "serde_codegen"
version = "0.7.11"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"aster 0.19.0 (registry+https://github.com/rust-lang/crates.io-index)",
"quasi 0.13.0 (registry+https://github.com/rust-lang/crates.io-index)",
"quasi_macros 0.13.0 (registry+https://github.com/rust-lang/crates.io-index)",
"serde_item 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
name = "serde_item"
version = "0.2.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
[[package]]
name = "serde_macros"
version = "0.7.11"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"serde_codegen 0.7.11 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
name = "smallvec"
version = "0.1.8"
@ -455,8 +315,6 @@ dependencies = [
"euclid 0.7.1 (registry+https://github.com/rust-lang/crates.io-index)",
"fnv 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)",
"gecko_bindings 0.0.1",
"heapsize 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)",
"heapsize_plugin 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)",
"kernel32-sys 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)",
"lazy_static 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)",
"libc 0.2.13 (registry+https://github.com/rust-lang/crates.io-index)",
@ -466,8 +324,6 @@ dependencies = [
"rand 0.3.14 (registry+https://github.com/rust-lang/crates.io-index)",
"rustc-serialize 0.3.19 (registry+https://github.com/rust-lang/crates.io-index)",
"selectors 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)",
"serde 0.7.11 (registry+https://github.com/rust-lang/crates.io-index)",
"serde_macros 0.7.11 (registry+https://github.com/rust-lang/crates.io-index)",
"smallvec 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)",
"string_cache 0.2.20 (registry+https://github.com/rust-lang/crates.io-index)",
"style_traits 0.0.1",
@ -483,11 +339,7 @@ version = "0.0.1"
dependencies = [
"cssparser 0.5.6 (registry+https://github.com/rust-lang/crates.io-index)",
"euclid 0.7.1 (registry+https://github.com/rust-lang/crates.io-index)",
"heapsize 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)",
"heapsize_plugin 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)",
"rustc-serialize 0.3.19 (registry+https://github.com/rust-lang/crates.io-index)",
"serde 0.7.11 (registry+https://github.com/rust-lang/crates.io-index)",
"serde_macros 0.7.11 (registry+https://github.com/rust-lang/crates.io-index)",
"util 0.0.1",
]
@ -515,7 +367,6 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"kernel32-sys 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)",
"libc 0.2.13 (registry+https://github.com/rust-lang/crates.io-index)",
"rustc-serialize 0.3.19 (registry+https://github.com/rust-lang/crates.io-index)",
"winapi 0.2.7 (registry+https://github.com/rust-lang/crates.io-index)",
]
@ -545,13 +396,8 @@ name = "url"
version = "1.1.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"encoding 0.2.32 (registry+https://github.com/rust-lang/crates.io-index)",
"heapsize 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)",
"heapsize_plugin 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)",
"idna 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
"matches 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)",
"rustc-serialize 0.3.19 (registry+https://github.com/rust-lang/crates.io-index)",
"serde 0.7.11 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
@ -564,31 +410,18 @@ name = "util"
version = "0.0.1"
dependencies = [
"app_units 0.2.5 (registry+https://github.com/rust-lang/crates.io-index)",
"backtrace 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)",
"bitflags 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)",
"euclid 0.7.1 (registry+https://github.com/rust-lang/crates.io-index)",
"getopts 0.2.14 (registry+https://github.com/rust-lang/crates.io-index)",
"heapsize 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)",
"ipc-channel 0.2.4 (git+https://github.com/servo/ipc-channel)",
"lazy_static 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)",
"log 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)",
"num_cpus 0.2.13 (registry+https://github.com/rust-lang/crates.io-index)",
"rustc-serialize 0.3.19 (registry+https://github.com/rust-lang/crates.io-index)",
"serde 0.7.11 (registry+https://github.com/rust-lang/crates.io-index)",
"serde_macros 0.7.11 (registry+https://github.com/rust-lang/crates.io-index)",
"url 1.1.1 (registry+https://github.com/rust-lang/crates.io-index)",
"xdg 2.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
name = "uuid"
version = "0.2.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"rand 0.3.14 (registry+https://github.com/rust-lang/crates.io-index)",
"serde 0.7.11 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
name = "void"
version = "1.0.2"

View file

@ -10,29 +10,12 @@ name = "geckoservo"
path = "lib.rs"
crate-type = ["staticlib"]
[features]
default = ["servo_features"]
# Features that aren't actually required for geckolib, but match the ones used
# in the full Servo build. Enabling this reduces the number of things
# recompiled when building both Servo and geckolib in the same source tree.
servo_features = [
"heapsize",
"selectors/unstable",
"style/servo",
"time",
"url/query_encoding",
"url/rustc-serialize",
"uuid",
]
[dependencies]
app_units = "0.2.5"
cssparser = "0.5.4"
env_logger = "0.3"
euclid = "0.7.1"
gecko_bindings = {version = "0.0.1", path = "gecko_bindings"}
heapsize = {version = "0.3.0", optional = true}
lazy_static = "0.2"
libc = "0.2"
log = {version = "0.3.5", features = ["release_max_level_info"]}
@ -42,10 +25,8 @@ smallvec = "0.1"
string_cache = {version = "0.2.20", features = ["unstable"]}
style = {path = "../../components/style", features = ["gecko"]}
style_traits = {path = "../../components/style_traits"}
time = {version = "0.1", optional = true, features = ["rustc-serialize"]}
url = "1.0.0"
util = {path = "../../components/util"}
uuid = {version = "0.2", optional = true, features = ["v4", "serde"]}
[replace]
"string_cache:0.2.20" = {path = "string_cache"}

View file

@ -8,7 +8,6 @@ extern crate cssparser;
extern crate env_logger;
extern crate euclid;
extern crate gecko_bindings;
#[cfg(feature = "servo_features")] #[macro_use] extern crate heapsize;
#[macro_use]
extern crate lazy_static;
extern crate libc;

View file

@ -15,9 +15,6 @@ pub type SharedStyleContext = style::context::SharedStyleContext<GeckoSelectorIm
pub type PrivateStyleData = style::data::PrivateStyleData<GeckoSelectorImpl, GeckoComputedValues>;
pub type Animation = style::animation::Animation<GeckoSelectorImpl>;
#[cfg(feature = "servo_features")]
known_heap_size!(0, GeckoSelectorImpl, PseudoElement, NonTSPseudoClass);
#[derive(Debug, Clone)]
pub struct GeckoSelectorImpl;

View file

@ -1 +0,0 @@
/target

View file

@ -1,6 +0,0 @@
[package]
name = "stable-rust"
version = "0.0.1"
authors = ["The Servo Project Developers"]
[dependencies]

View file

@ -1,10 +0,0 @@
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
#[cfg(test)]
mod test {
#[test]
fn it_works() {
}
}

View file

@ -138,12 +138,7 @@ class MachCommands(CommandBase):
self.set_use_stable_rust(stable)
version = self.rust_version()
rust_path = self.rust_path()
if stable:
rust_dir = path.join(
self.context.sharedir, "rust", version, rust_path)
else:
rust_dir = path.join(
self.context.sharedir, "rust", rust_path)
rust_dir = path.join(self.context.sharedir, "rust", rust_path)
install_dir = path.join(self.context.sharedir, "rust", version)
if not force and path.exists(path.join(rust_dir, "rustc", "bin", "rustc" + BIN_SUFFIX)):
@ -160,9 +155,10 @@ class MachCommands(CommandBase):
# giving a directory name that will be the same as the tarball name (rustc is
# in that directory).
if stable:
rustc_url = "https://static.rust-lang.org/dist/%s.tar.gz" % rust_path
tarball = "rustc-%s-%s.tar.gz" % (version, host_triple())
else:
rustc_url = "https://static-rust-lang-org.s3.amazonaws.com/dist/%s.tar.gz" % rust_path
tarball = "%s/rustc-nightly-%s.tar.gz" % (version, host_triple())
rustc_url = "https://static-rust-lang-org.s3.amazonaws.com/dist/" + tarball
tgz_file = rust_dir + '-rustc.tar.gz'
download_file("Rust compiler", rustc_url, tgz_file)
@ -196,7 +192,7 @@ class MachCommands(CommandBase):
continue
if self.use_stable_rust():
std_url = ("https://static.rust-lang.org/dist/rust-std-%s-%s.tar.gz"
std_url = ("https://static-rust-lang-org.s3.amazonaws.com/dist/rust-std-%s-%s.tar.gz"
% (version, target_triple))
tgz_file = install_dir + ('rust-std-%s-%s.tar.gz' % (version, target_triple))
else:

View file

@ -265,43 +265,6 @@ class MachCommands(CommandBase):
print("Build completed in %s" % format_duration(elapsed))
return status
@Command('build-stable',
description='Build Servo using stable rustc',
category='build')
@CommandArgument('--target', '-t',
default=None,
help='Cross compile for given target platform')
@CommandArgument('--release', '-r',
action='store_true',
help='Build in release mode')
@CommandArgument('--dev', '-d',
action='store_true',
help='Build in development mode')
@CommandArgument('--jobs', '-j',
default=None,
help='Number of jobs to run in parallel')
@CommandArgument('--features',
default=None,
help='Space-separated list of features to also build',
nargs='+')
@CommandArgument('--android',
default=None,
action='store_true',
help='Build for Android')
@CommandArgument('--debug-mozjs',
default=None,
action='store_true',
help='Enable debug assertions in mozjs')
@CommandArgument('--verbose', '-v',
action='store_true',
help='Print verbose output')
@CommandArgument('params', nargs='...',
help="Command-line arguments to be passed through to Cargo")
def build_stable(self, target=None, release=False, dev=False, jobs=None,
features=None, android=None, verbose=False, debug_mozjs=False, params=None):
self.set_use_stable_rust()
self.build(target, release, dev, jobs, features, android, verbose, debug_mozjs, params)
@Command('build-cef',
description='Build the Chromium Embedding Framework library',
category='build')
@ -356,6 +319,7 @@ class MachCommands(CommandBase):
action='store_true',
help='Build in release mode')
def build_geckolib(self, jobs=None, verbose=False, release=False):
self.set_use_stable_rust()
self.ensure_bootstrapped()
ret = None
@ -367,11 +331,12 @@ class MachCommands(CommandBase):
if release:
opts += ["--release"]
build_start = time()
env = self.build_env()
env["CARGO_TARGET_DIR"] = path.join(self.context.topdir, "target", "geckolib")
build_start = time()
with cd(path.join("ports", "geckolib")):
ret = call(["cargo", "build"] + opts,
env=env, verbose=verbose)
ret = call(["cargo", "build"] + opts, env=env, verbose=verbose)
elapsed = time() - build_start
# Generate Desktop Notification if elapsed-time > some threshold value

View file

@ -218,10 +218,11 @@ class CommandBase(object):
return self._use_stable_rust
def rust_path(self):
version = self.rust_version()
if self._use_stable_rust:
return "rustc-%s-%s" % (self.rust_version(), host_triple())
return "%s/rustc-%s-%s" % (version, version, host_triple())
else:
return "%s/rustc-nightly-%s" % (self.rust_version(), host_triple())
return "%s/rustc-nightly-%s" % (version, host_triple())
def rust_version(self):
if self._rust_version is None or self._use_stable_rust != self._rust_version_is_stable:
@ -332,10 +333,7 @@ class CommandBase(object):
env["CARGO_HOME"] = self.config["tools"]["cargo-home-dir"]
if self.use_stable_rust():
env["CARGO_TARGET_DIR"] = path.join(self.context.topdir, "ports/stable-rust/target")
elif "CARGO_TARGET_DIR" not in env:
env["CARGO_TARGET_DIR"] = path.join(self.context.topdir, "target")
env["CARGO_TARGET_DIR"] = path.join(self.context.topdir, "target")
if extra_lib:
if sys.platform == "darwin":
@ -436,10 +434,9 @@ class CommandBase(object):
rustc_binary_exists = path.exists(rustc_path)
base_target_path = path.join(rust_root, "rustc", "lib", "rustlib")
target_exists = True
if target is not None:
target_path = path.join(base_target_path, target)
target_exists = path.exists(target_path)
target_path = path.join(base_target_path, target or host_triple())
target_exists = path.exists(target_path)
if not (self.config['tools']['system-rust'] or (rustc_binary_exists and target_exists)):
print("looking for rustc at %s" % (rustc_path))