Remove `rust` as a submodule
This removes the `tests/rust` submodule and instead moves to lazily cloning it
during tests. This helps work around the fact that git dependencies on `syn`
will pull in all submodules, and rust takes forever to clone. In short, the
intention here is to make git dependencies on `syn` bearable to avoid Cargo
auto-cloning submodules.
diff --git a/tests/common/mod.rs b/tests/common/mod.rs
index 5ffeb84..da1e0cc 100644
--- a/tests/common/mod.rs
+++ b/tests/common/mod.rs
@@ -3,6 +3,8 @@
extern crate walkdir;
use std::env;
+use std::path::Path;
+use std::process::Command;
use std::u32;
use self::walkdir::DirEntry;
@@ -86,3 +88,29 @@
}
}
+pub fn clone_rust() {
+ if Path::new("tests/rust").is_dir() {
+ return
+ }
+
+ println!("cloning rust-lang/rust");
+ let result = Command::new("git")
+ .arg("clone")
+ .arg("https://github.com/rust-lang/rust")
+ .arg("tests/rust")
+ .status()
+ .unwrap();
+ println!("result: {}", result);
+ assert!(result.success());
+
+ println!("reset to known-good rev");
+ let result = Command::new("git")
+ .arg("reset")
+ .arg("--hard")
+ .arg("ddc5d7bd4b9ea3e8a8ccf82cb443e950be311d61")
+ .current_dir("tests/rust")
+ .status()
+ .unwrap();
+ println!("result: {}", result);
+ assert!(result.success());
+}