about summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
authorMark Simulacrum <mark.simulacrum@gmail.com>2017-07-25 16:54:33 -0600
committerMark Simulacrum <mark.simulacrum@gmail.com>2017-07-27 05:51:22 -0600
commit4e5333cb2ba70b49a17c3c124bc47feba7fd761c (patch)
tree451794948a5a5c9e26236266590028a7f5133af6 /src
parente2e9b40e9aff842928c65606e47d9203a848a4e9 (diff)
downloadrust-4e5333cb2ba70b49a17c3c124bc47feba7fd761c.tar.gz
rust-4e5333cb2ba70b49a17c3c124bc47feba7fd761c.zip
Don't needlessly build rustdoc for compiletest.
For most tests, rustdoc isn't needed, so avoid building it.
Diffstat (limited to 'src')
-rw-r--r--src/bootstrap/check.rs7
-rw-r--r--src/tools/compiletest/src/common.rs2
-rw-r--r--src/tools/compiletest/src/main.rs6
-rw-r--r--src/tools/compiletest/src/runtest.rs6
4 files changed, 14 insertions, 7 deletions
diff --git a/src/bootstrap/check.rs b/src/bootstrap/check.rs
index 3b3b062b151..df15cbc9314 100644
--- a/src/bootstrap/check.rs
+++ b/src/bootstrap/check.rs
@@ -562,7 +562,12 @@ impl Step for Compiletest {
         cmd.arg("--compile-lib-path").arg(builder.rustc_libdir(compiler));
         cmd.arg("--run-lib-path").arg(builder.sysroot_libdir(compiler, target));
         cmd.arg("--rustc-path").arg(builder.rustc(compiler));
-        cmd.arg("--rustdoc-path").arg(builder.rustdoc(compiler));
+
+        // Avoid depending on rustdoc when we don't need it.
+        if mode == "rustdoc" || mode == "run-make" {
+            cmd.arg("--rustdoc-path").arg(builder.rustdoc(compiler));
+        }
+
         cmd.arg("--src-base").arg(build.src.join("src/test").join(suite));
         cmd.arg("--build-base").arg(testdir(build, compiler.host).join(suite));
         cmd.arg("--stage-id").arg(format!("stage{}-{}", compiler.stage, target));
diff --git a/src/tools/compiletest/src/common.rs b/src/tools/compiletest/src/common.rs
index cc95e1b8930..0d6b350a1d4 100644
--- a/src/tools/compiletest/src/common.rs
+++ b/src/tools/compiletest/src/common.rs
@@ -93,7 +93,7 @@ pub struct Config {
     pub rustc_path: PathBuf,
 
     // The rustdoc executable
-    pub rustdoc_path: PathBuf,
+    pub rustdoc_path: Option<PathBuf>,
 
     // The python executable to use for LLDB
     pub lldb_python: String,
diff --git a/src/tools/compiletest/src/main.rs b/src/tools/compiletest/src/main.rs
index 91f80a7afec..6fa758aeabe 100644
--- a/src/tools/compiletest/src/main.rs
+++ b/src/tools/compiletest/src/main.rs
@@ -67,7 +67,7 @@ pub fn parse_config(args: Vec<String> ) -> Config {
     opts.reqopt("", "compile-lib-path", "path to host shared libraries", "PATH")
         .reqopt("", "run-lib-path", "path to target shared libraries", "PATH")
         .reqopt("", "rustc-path", "path to rustc to use for compiling", "PATH")
-        .reqopt("", "rustdoc-path", "path to rustdoc to use for compiling", "PATH")
+        .optopt("", "rustdoc-path", "path to rustdoc to use for compiling", "PATH")
         .reqopt("", "lldb-python", "path to python to use for doc tests", "PATH")
         .reqopt("", "docck-python", "path to python to use for doc tests", "PATH")
         .optopt("", "valgrind-path", "path to Valgrind executable for Valgrind tests", "PROGRAM")
@@ -157,7 +157,7 @@ pub fn parse_config(args: Vec<String> ) -> Config {
         compile_lib_path: make_absolute(opt_path(matches, "compile-lib-path")),
         run_lib_path: make_absolute(opt_path(matches, "run-lib-path")),
         rustc_path: opt_path(matches, "rustc-path"),
-        rustdoc_path: opt_path(matches, "rustdoc-path"),
+        rustdoc_path: matches.opt_str("rustdoc-path").map(PathBuf::from),
         lldb_python: matches.opt_str("lldb-python").unwrap(),
         docck_python: matches.opt_str("docck-python").unwrap(),
         valgrind_path: matches.opt_str("valgrind-path"),
@@ -210,7 +210,7 @@ pub fn log_config(config: &Config) {
     logv(c, format!("compile_lib_path: {:?}", config.compile_lib_path));
     logv(c, format!("run_lib_path: {:?}", config.run_lib_path));
     logv(c, format!("rustc_path: {:?}", config.rustc_path.display()));
-    logv(c, format!("rustdoc_path: {:?}", config.rustdoc_path.display()));
+    logv(c, format!("rustdoc_path: {:?}", config.rustdoc_path));
     logv(c, format!("src_base: {:?}", config.src_base.display()));
     logv(c, format!("build_base: {:?}", config.build_base.display()));
     logv(c, format!("stage_id: {}", config.stage_id));
diff --git a/src/tools/compiletest/src/runtest.rs b/src/tools/compiletest/src/runtest.rs
index c6dc78ef505..93696561708 100644
--- a/src/tools/compiletest/src/runtest.rs
+++ b/src/tools/compiletest/src/runtest.rs
@@ -1192,7 +1192,8 @@ actual:\n\
                             self.testpaths.file.to_str().unwrap().to_owned()];
         args.extend(self.props.compile_flags.iter().cloned());
         let args = ProcArgs {
-            prog: self.config.rustdoc_path.to_str().unwrap().to_owned(),
+            prog: self.config.rustdoc_path
+                .as_ref().expect("--rustdoc-path passed").to_str().unwrap().to_owned(),
             args: args,
         };
         self.compose_and_run_compiler(args, None)
@@ -2163,7 +2164,8 @@ actual:\n\
            .env("S", src_root)
            .env("RUST_BUILD_STAGE", &self.config.stage_id)
            .env("RUSTC", cwd.join(&self.config.rustc_path))
-           .env("RUSTDOC", cwd.join(&self.config.rustdoc_path))
+           .env("RUSTDOC",
+               cwd.join(&self.config.rustdoc_path.as_ref().expect("--rustdoc-path passed")))
            .env("TMPDIR", &tmpdir)
            .env("LD_LIB_PATH_ENVVAR", procsrv::dylib_env_var())
            .env("HOST_RPATH_DIR", cwd.join(&self.config.compile_lib_path))