]> git.lizzy.rs Git - rust.git/commitdiff
use helper function in the rebuild logic of the rustc_*san crates
authorJorge Aparicio <japaricious@gmail.com>
Sun, 5 Feb 2017 01:10:29 +0000 (20:10 -0500)
committerJorge Aparicio <japaricious@gmail.com>
Wed, 8 Feb 2017 23:51:43 +0000 (18:51 -0500)
src/Cargo.lock
src/librustc_asan/Cargo.toml
src/librustc_asan/build.rs
src/librustc_lsan/Cargo.toml
src/librustc_lsan/build.rs
src/librustc_msan/Cargo.toml
src/librustc_msan/build.rs
src/librustc_tsan/Cargo.toml
src/librustc_tsan/build.rs

index 8e987ba3b7f154c679fbbe5d9ff4a3a5053fa173..c1222dc444a22bfabe6a9fdfc146a33e73184743 100644 (file)
@@ -273,6 +273,7 @@ name = "rustc_asan"
 version = "0.0.0"
 dependencies = [
  "alloc_system 0.0.0",
+ "build_helper 0.1.0",
  "cmake 0.1.18 (registry+https://github.com/rust-lang/crates.io-index)",
  "core 0.0.0",
 ]
@@ -415,6 +416,7 @@ name = "rustc_lsan"
 version = "0.0.0"
 dependencies = [
  "alloc_system 0.0.0",
+ "build_helper 0.1.0",
  "cmake 0.1.18 (registry+https://github.com/rust-lang/crates.io-index)",
  "core 0.0.0",
 ]
@@ -458,6 +460,7 @@ name = "rustc_msan"
 version = "0.0.0"
 dependencies = [
  "alloc_system 0.0.0",
+ "build_helper 0.1.0",
  "cmake 0.1.18 (registry+https://github.com/rust-lang/crates.io-index)",
  "core 0.0.0",
 ]
@@ -548,6 +551,7 @@ name = "rustc_tsan"
 version = "0.0.0"
 dependencies = [
  "alloc_system 0.0.0",
+ "build_helper 0.1.0",
  "cmake 0.1.18 (registry+https://github.com/rust-lang/crates.io-index)",
  "core 0.0.0",
 ]
index abbd7cc0966ea24d35ab1613e07577f0209276d6..2d4872b1fc942513f03712b1b870a14ef80c1188 100644 (file)
@@ -9,6 +9,7 @@ name = "rustc_asan"
 path = "lib.rs"
 
 [build-dependencies]
+build_helper = { path = "../build_helper" }
 cmake = "0.1.18"
 
 [dependencies]
index 3e33efcadb8074f8a09ff3cfe30bf31dafee3897..015be14bd495a7213a62e3268b06e8bfca006156 100644 (file)
@@ -8,6 +8,7 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+extern crate build_helper;
 extern crate cmake;
 
 use std::path::PathBuf;
@@ -29,21 +30,9 @@ fn main() {
                  dst.join("build/lib/linux").display());
         println!("cargo:rustc-link-lib=static=clang_rt.asan-x86_64");
 
-        let src_dir = PathBuf::from(env::var_os("CARGO_MANIFEST_DIR").unwrap());
-        let mut stack = src_dir.join("../compiler-rt")
-            .read_dir()
-            .unwrap()
-            .map(|e| e.unwrap())
-            .filter(|e| &*e.file_name() != ".git")
-            .collect::<Vec<_>>();
-        while let Some(entry) = stack.pop() {
-            let path = entry.path();
-            if entry.file_type().unwrap().is_dir() {
-                stack.extend(path.read_dir().unwrap().map(|e| e.unwrap()));
-            } else {
-                println!("cargo:rerun-if-changed={}", path.display());
-            }
-        }
+        build_helper::rerun_if_changed_anything_in_dir(&PathBuf::from(env::var("CARGO_MANIFEST_DIR")
+                .unwrap())
+            .join("../compiler-rt"));
     }
 
     println!("cargo:rerun-if-changed=build.rs");
index ac53f3fe73a751cbcb74133a66c1c783bb26f0bb..bc1f2ead76884927592a01b283303000bdebf4f2 100644 (file)
@@ -9,6 +9,7 @@ name = "rustc_lsan"
 path = "lib.rs"
 
 [build-dependencies]
+build_helper = { path = "../build_helper" }
 cmake = "0.1.18"
 
 [dependencies]
index f13928d2bd4570b61b09cf6e721084a840e61da7..5773777d1f81b4bf600061dde806da2d0b85b869 100644 (file)
@@ -8,6 +8,7 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+extern crate build_helper;
 extern crate cmake;
 
 use std::path::PathBuf;
@@ -29,21 +30,9 @@ fn main() {
                  dst.join("build/lib/linux").display());
         println!("cargo:rustc-link-lib=static=clang_rt.lsan-x86_64");
 
-        let src_dir = PathBuf::from(env::var_os("CARGO_MANIFEST_DIR").unwrap());
-        let mut stack = src_dir.join("../compiler-rt")
-            .read_dir()
-            .unwrap()
-            .map(|e| e.unwrap())
-            .filter(|e| &*e.file_name() != ".git")
-            .collect::<Vec<_>>();
-        while let Some(entry) = stack.pop() {
-            let path = entry.path();
-            if entry.file_type().unwrap().is_dir() {
-                stack.extend(path.read_dir().unwrap().map(|e| e.unwrap()));
-            } else {
-                println!("cargo:rerun-if-changed={}", path.display());
-            }
-        }
+        build_helper::rerun_if_changed_anything_in_dir(&PathBuf::from(env::var("CARGO_MANIFEST_DIR")
+                .unwrap())
+            .join("../compiler-rt"));
     }
 
     println!("cargo:rerun-if-changed=build.rs");
index 628746ac232dfd45eb1d20b0370788e333cdcabc..45cc6b9839fb81a321e876b2c834744755ac5c56 100644 (file)
@@ -9,6 +9,7 @@ name = "rustc_msan"
 path = "lib.rs"
 
 [build-dependencies]
+build_helper = { path = "../build_helper" }
 cmake = "0.1.18"
 
 [dependencies]
index bf630c7844a22336057f605887332046e0364ee6..7a4c8f7073933f7d597991cf776cfa8e7662461f 100644 (file)
@@ -8,6 +8,7 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+extern crate build_helper;
 extern crate cmake;
 
 use std::path::PathBuf;
@@ -29,21 +30,9 @@ fn main() {
                  dst.join("build/lib/linux").display());
         println!("cargo:rustc-link-lib=static=clang_rt.msan-x86_64");
 
-        let src_dir = PathBuf::from(env::var_os("CARGO_MANIFEST_DIR").unwrap());
-        let mut stack = src_dir.join("../compiler-rt")
-            .read_dir()
-            .unwrap()
-            .map(|e| e.unwrap())
-            .filter(|e| &*e.file_name() != ".git")
-            .collect::<Vec<_>>();
-        while let Some(entry) = stack.pop() {
-            let path = entry.path();
-            if entry.file_type().unwrap().is_dir() {
-                stack.extend(path.read_dir().unwrap().map(|e| e.unwrap()));
-            } else {
-                println!("cargo:rerun-if-changed={}", path.display());
-            }
-        }
+        build_helper::rerun_if_changed_anything_in_dir(&PathBuf::from(env::var("CARGO_MANIFEST_DIR")
+                .unwrap())
+            .join("../compiler-rt"));
     }
 
     println!("cargo:rerun-if-changed=build.rs");
index 2af0ae3f73411da48d978e251dcb849e81882700..66d6236361ea233e5f13380e106d6cf181a71912 100644 (file)
@@ -9,6 +9,7 @@ name = "rustc_tsan"
 path = "lib.rs"
 
 [build-dependencies]
+build_helper = { path = "../build_helper" }
 cmake = "0.1.18"
 
 [dependencies]
index 2ba5866ab9d441ce04a48319a7bc75824f2ca8d5..84326ae8a71060440e436838afbf2080ca889e8e 100644 (file)
@@ -8,6 +8,7 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+extern crate build_helper;
 extern crate cmake;
 
 use std::path::PathBuf;
@@ -29,21 +30,9 @@ fn main() {
                  dst.join("build/lib/linux").display());
         println!("cargo:rustc-link-lib=static=clang_rt.tsan-x86_64");
 
-        let src_dir = PathBuf::from(env::var_os("CARGO_MANIFEST_DIR").unwrap());
-        let mut stack = src_dir.join("../compiler-rt")
-            .read_dir()
-            .unwrap()
-            .map(|e| e.unwrap())
-            .filter(|e| &*e.file_name() != ".git")
-            .collect::<Vec<_>>();
-        while let Some(entry) = stack.pop() {
-            let path = entry.path();
-            if entry.file_type().unwrap().is_dir() {
-                stack.extend(path.read_dir().unwrap().map(|e| e.unwrap()));
-            } else {
-                println!("cargo:rerun-if-changed={}", path.display());
-            }
-        }
+        build_helper::rerun_if_changed_anything_in_dir(&PathBuf::from(env::var("CARGO_MANIFEST_DIR")
+                .unwrap())
+            .join("../compiler-rt"));
     }
 
     println!("cargo:rerun-if-changed=build.rs");