From 4781eb315b7bcf11682d68aafac2ce4739bfe166 Mon Sep 17 00:00:00 2001 From: Alex Crichton Date: Fri, 30 Dec 2016 09:26:25 -0800 Subject: travis: Add a distcheck target This commit adds a new entry to the Travis matrix which performs a "distcheck", which basically means that we create a tarball, extract that tarball, and then build/test inside there. This ensures that the tarballs we produce are actually able to be built/tested! Along the way this also updates the rustbuild distcheck definition to propagate the configure args from the top-level invocation. Closes #38691 --- src/bootstrap/check.rs | 1 + src/bootstrap/config.rs | 6 ++++++ src/bootstrap/util.rs | 4 ++-- 3 files changed, 9 insertions(+), 2 deletions(-) (limited to 'src/bootstrap') diff --git a/src/bootstrap/check.rs b/src/bootstrap/check.rs index ec0243908ed..0c6680fab66 100644 --- a/src/bootstrap/check.rs +++ b/src/bootstrap/check.rs @@ -554,6 +554,7 @@ pub fn distcheck(build: &Build) { .current_dir(&dir); build.run(&mut cmd); build.run(Command::new("./configure") + .args(&build.config.configure_args) .current_dir(&dir)); build.run(Command::new(build_helper::make(&build.config.build)) .arg("check") diff --git a/src/bootstrap/config.rs b/src/bootstrap/config.rs index 9767afd73ca..11c5b374ed9 100644 --- a/src/bootstrap/config.rs +++ b/src/bootstrap/config.rs @@ -94,6 +94,7 @@ pub struct Config { pub nodejs: Option, pub gdb: Option, pub python: Option, + pub configure_args: Vec, } /// Per-target configuration stored in the global configuration structure. @@ -519,6 +520,11 @@ impl Config { "CFG_ENABLE_SCCACHE" if value == "1" => { self.ccache = Some("sccache".to_string()); } + "CFG_CONFIGURE_ARGS" if value.len() > 0 => { + self.configure_args = value.split_whitespace() + .map(|s| s.to_string()) + .collect(); + } _ => {} } } diff --git a/src/bootstrap/util.rs b/src/bootstrap/util.rs index c9e756b6f99..2ab3776ada0 100644 --- a/src/bootstrap/util.rs +++ b/src/bootstrap/util.rs @@ -76,9 +76,9 @@ pub fn cp_r(src: &Path, dst: &Path) { /// Copies the `src` directory recursively to `dst`. Both are assumed to exist /// when this function is called. Unwanted files or directories can be skipped /// by returning `false` from the filter function. -pub fn cp_filtered bool>(src: &Path, dst: &Path, filter: &F) { +pub fn cp_filtered(src: &Path, dst: &Path, filter: &Fn(&Path) -> bool) { // Inner function does the actual work - fn recurse bool>(src: &Path, dst: &Path, relative: &Path, filter: &F) { + fn recurse(src: &Path, dst: &Path, relative: &Path, filter: &Fn(&Path) -> bool) { for f in t!(fs::read_dir(src)) { let f = t!(f); let path = f.path(); -- cgit 1.4.1-3-g733a5