Bug 1451956 - Switch stylo function signature checking to use generated bindings. r=xidorn
authorBobby Holley <bobbyholley@gmail.com>
Wed, 18 Apr 2018 10:41:56 -0700
changeset 467967 cabd679ad5c6c864457adcf46703f0efc1590fe1
parent 467966 1dfbb10696ab6ca83903852ae15cf6fac6155f10
child 467968 39f5189c574b0a14db6ddc23c9c9ec8410a55048
push id9165
push userasasaki@mozilla.com
push dateThu, 26 Apr 2018 21:04:54 +0000
treeherdermozilla-beta@064c3804de2e [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersxidorn
bugs1451956
milestone61.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1451956 - Switch stylo function signature checking to use generated bindings. r=xidorn MozReview-Commit-ID: A7sWaD2PInN
servo/ports/geckolib/tests/build.rs
--- a/servo/ports/geckolib/tests/build.rs
+++ b/servo/ports/geckolib/tests/build.rs
@@ -6,18 +6,21 @@ extern crate regex;
 
 use regex::Regex;
 use std::env;
 use std::fs::File;
 use std::io::{BufRead, BufReader, Write};
 use std::path::Path;
 
 fn main() {
+    // https://github.com/rust-lang/cargo/issues/3544
+    let style_out_dir = env::var_os("DEP_FOR SOME REASON THE LINKS KEY IS REQUIRED \
+                                     TO PASS DATA AROUND BETWEEN BUILD SCRIPTS_OUT_DIR").unwrap();
     let root_path = Path::new("../../../");
-    let bindings_file = root_path.join("components/style/gecko/generated/bindings.rs");
+    let bindings_file = Path::new(&style_out_dir).join("gecko/bindings.rs");
     let glue_file = root_path.join("ports/geckolib/glue.rs");
 
     println!("cargo:rerun-if-changed=build.rs");
     println!("cargo:rerun-if-changed={}", glue_file.display());
     println!("cargo:rerun-if-changed={}", bindings_file.display());
 
     let env_out_dir = env::var("OUT_DIR").unwrap();
     let out_dir = Path::new(&env_out_dir);
@@ -65,19 +68,16 @@ fn main() {
 
         for line in r.lines() {
             let s = line.unwrap().replace("pub extern \"C\" fn", "pub unsafe extern \"C\" fn");
             w.write_all(s.as_bytes()).unwrap();
             w.write_all(b"\n").unwrap();
         }
     }
 
-    // https://github.com/rust-lang/cargo/issues/3544
-    let style_out_dir = env::var_os("DEP_FOR SOME REASON THE LINKS KEY IS REQUIRED \
-                                     TO PASS DATA AROUND BETWEEN BUILD SCRIPTS_OUT_DIR").unwrap();
     File::create(out_dir.join("bindings.rs"))
         .unwrap()
         .write_all(format!("include!(concat!({:?}, \"/gecko/structs.rs\"));",
                            style_out_dir).as_bytes())
         .unwrap();
 
     if env::var_os("MOZ_SRC").is_some() {
         println!("cargo:rustc-cfg=linking_with_gecko")