From 7d4a80005f45bb8c88292612e599d1694ad2c2f5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Emilio=20Cobos=20=C3=81lvarez?= Date: Fri, 2 Mar 2018 08:45:09 -0500 Subject: [PATCH] servo: Merge #20170 - Reland #20160 since it just needed a revendor that didn't happen automatically (from emilio:formatted-style); r=emilio Source-Repo: https://github.com/servo/servo Source-Revision: 679d2de4e74ecca7bd1b6d8b7d76e9bbd8821718 --HG-- extra : subtree_source : https%3A//hg.mozilla.org/projects/converted-servo-linear extra : subtree_revision : 6e36ef2c981984efddc6fb36a01db7c3cd2418b3 --- servo/Cargo.lock | 9 +++++---- servo/components/style/Cargo.toml | 2 +- servo/components/style/build_gecko.rs | 18 ++++++++++++++---- 3 files changed, 20 insertions(+), 9 deletions(-) diff --git a/servo/Cargo.lock b/servo/Cargo.lock index 667417edd67b..1549268d3917 100644 --- a/servo/Cargo.lock +++ b/servo/Cargo.lock @@ -148,7 +148,7 @@ dependencies = [ [[package]] name = "bindgen" -version = "0.32.2" +version = "0.32.3" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "cexpr 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", @@ -159,7 +159,8 @@ dependencies = [ "lazy_static 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", "log 0.3.9 (registry+https://github.com/rust-lang/crates.io-index)", "peeking_take_while 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", - "quote 0.3.15 (registry+https://github.com/rust-lang/crates.io-index)", + "proc-macro2 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", + "quote 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)", "regex 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", "which 1.0.3 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -2949,7 +2950,7 @@ dependencies = [ "app_units 0.6.1 (registry+https://github.com/rust-lang/crates.io-index)", "arrayvec 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)", "atomic_refcell 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", - "bindgen 0.32.2 (registry+https://github.com/rust-lang/crates.io-index)", + "bindgen 0.32.3 (registry+https://github.com/rust-lang/crates.io-index)", "bitflags 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", "byteorder 1.2.1 (registry+https://github.com/rust-lang/crates.io-index)", "cfg-if 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", @@ -3614,7 +3615,7 @@ dependencies = [ "checksum base64 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)" = "96434f987501f0ed4eb336a411e0631ecd1afa11574fe148587adc4ff96143c9" "checksum binary-space-partition 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)" = "88ceb0d16c4fd0e42876e298d7d3ce3780dd9ebdcbe4199816a32c77e08597ff" "checksum bincode 0.9.2 (registry+https://github.com/rust-lang/crates.io-index)" = "9a6301db0b49fb63551bc15b5ae348147101cdf323242b93ec7546d5002ff1af" -"checksum bindgen 0.32.2 (registry+https://github.com/rust-lang/crates.io-index)" = "6ed9557522980fcdb4986097c2ea9d2504eafa7e5818f393110205b5325a52ce" +"checksum bindgen 0.32.3 (registry+https://github.com/rust-lang/crates.io-index)" = "8b242e11a8f446f5fc7b76b37e81d737cabca562a927bd33766dac55b5f1177f" "checksum bitflags 0.9.1 (registry+https://github.com/rust-lang/crates.io-index)" = "4efd02e230a02e18f92fc2735f44597385ed02ad8f831e7c1c1156ee5e1ab3a5" "checksum bitflags 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "f5cde24d1b2e2216a726368b2363a273739c91f4e3eb4e0dd12d672d396ad989" "checksum bitreader 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)" = "80b13e2ab064ff3aa0bdbf1eff533f9822dc37899821f5f98c67f263eab51707" diff --git a/servo/components/style/Cargo.toml b/servo/components/style/Cargo.toml index de06aebbc146..9f46e54f8354 100644 --- a/servo/components/style/Cargo.toml +++ b/servo/components/style/Cargo.toml @@ -78,7 +78,7 @@ kernel32-sys = "0.2" [build-dependencies] lazy_static = "1" log = "0.3" -bindgen = { version = "0.32.2", optional = true } +bindgen = { version = "0.32.3", optional = true } regex = {version = "0.2", optional = true} walkdir = "1.0" toml = {version = "0.2.1", optional = true, default-features = false} diff --git a/servo/components/style/build_gecko.rs b/servo/components/style/build_gecko.rs index 7415bff8a26e..bf6ded11c341 100644 --- a/servo/components/style/build_gecko.rs +++ b/servo/components/style/build_gecko.rs @@ -204,15 +204,25 @@ mod bindings { // Disable rust unions, because we replace some types inside of // them. - // - // FIXME(emilio, bug 1432153): Make the bindings rustfmt'd on - // automation. let mut builder = Builder::default() - .rustfmt_bindings(false) .rust_target(RustTarget::Stable_1_0); + let rustfmt_path = env::var_os("MOZ_AUTOMATION").and_then(|_| { + env::var_os("TOOLTOOL_DIR") + }).map(PathBuf::from); + + builder = match rustfmt_path { + Some(path) => { + builder.with_rustfmt(path.join("rustc").join("bin").join("rustfmt")) + }, + None => { + builder.rustfmt_bindings(env::var_os("STYLO_RUSTFMT_BINDINGS").is_some()) + } + }; + for dir in SEARCH_PATHS.iter() { builder = builder.clang_arg("-I").clang_arg(dir.to_str().unwrap()); } + builder = builder.include(add_include("mozilla-config.h")); if env::var("CARGO_FEATURE_GECKO_DEBUG").is_ok() {