about summary refs log tree commit diff
diff options
context:
space:
mode:
authorJosh Stone <jistone@redhat.com>2017-04-26 12:37:12 -0700
committerJosh Stone <jistone@redhat.com>2017-04-26 12:37:12 -0700
commitc5cd4cb51e1a77cd4f10ce2d04fc29621354afc9 (patch)
treef192ba9a7d938ab2c6248df931b4fe0dcdf2d8ee
parentb9bdb1766d68dbe5da0e0cd65b2227186004d2cf (diff)
downloadrust-c5cd4cb51e1a77cd4f10ce2d04fc29621354afc9.tar.gz
rust-c5cd4cb51e1a77cd4f10ce2d04fc29621354afc9.zip
Add a distcheck for rust-src completeness
-rw-r--r--src/bootstrap/check.rs21
-rw-r--r--src/bootstrap/dist.rs7
2 files changed, 28 insertions, 0 deletions
diff --git a/src/bootstrap/check.rs b/src/bootstrap/check.rs
index 8ab07e9e5b5..f8b3ee0edc8 100644
--- a/src/bootstrap/check.rs
+++ b/src/bootstrap/check.rs
@@ -663,6 +663,7 @@ pub fn distcheck(build: &Build) {
         return
     }
 
+    println!("Distcheck");
     let dir = build.out.join("tmp").join("distcheck");
     let _ = fs::remove_dir_all(&dir);
     t!(fs::create_dir_all(&dir));
@@ -680,6 +681,26 @@ pub fn distcheck(build: &Build) {
     build.run(Command::new(build_helper::make(&build.config.build))
                      .arg("check")
                      .current_dir(&dir));
+
+    // Now make sure that rust-src has all of libstd's dependencies
+    println!("Distcheck rust-src");
+    let dir = build.out.join("tmp").join("distcheck-src");
+    let _ = fs::remove_dir_all(&dir);
+    t!(fs::create_dir_all(&dir));
+
+    let mut cmd = Command::new("tar");
+    cmd.arg("-xzf")
+       .arg(dist::rust_src_installer(build))
+       .arg("--strip-components=1")
+       .current_dir(&dir);
+    build.run(&mut cmd);
+
+    let toml = dir.join("rust-src/lib/rustlib/src/rust/src/libstd/Cargo.toml");
+    build.run(Command::new(&build.cargo)
+                     .arg("generate-lockfile")
+                     .arg("--manifest-path")
+                     .arg(&toml)
+                     .current_dir(&dir));
 }
 
 /// Test the build system itself
diff --git a/src/bootstrap/dist.rs b/src/bootstrap/dist.rs
index 7e04b3660cd..5db9ac8295f 100644
--- a/src/bootstrap/dist.rs
+++ b/src/bootstrap/dist.rs
@@ -310,11 +310,18 @@ pub fn std(build: &Build, compiler: &Compiler, target: &str) {
     t!(fs::remove_dir_all(&image));
 }
 
+/// The path to the complete rustc-src tarball
 pub fn rust_src_location(build: &Build) -> PathBuf {
     let plain_name = format!("rustc-{}-src", build.rust_package_vers());
     distdir(build).join(&format!("{}.tar.gz", plain_name))
 }
 
+/// The path to the rust-src component installer
+pub fn rust_src_installer(build: &Build) -> PathBuf {
+    let name = pkgname(build, "rust-src");
+    distdir(build).join(&format!("{}.tar.gz", name))
+}
+
 /// Creates a tarball of save-analysis metadata, if available.
 pub fn analysis(build: &Build, compiler: &Compiler, target: &str) {
     assert!(build.config.extended);