Skip to content

Commit

Permalink
Don't needlessly build rustdoc for compiletest.
Browse files Browse the repository at this point in the history
For most tests, rustdoc isn't needed, so avoid building it.
  • Loading branch information
Mark-Simulacrum committed Jul 27, 2017
1 parent e2e9b40 commit 4e5333c
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 7 deletions.
7 changes: 6 additions & 1 deletion src/bootstrap/check.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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));
Expand Down
2 changes: 1 addition & 1 deletion src/tools/compiletest/src/common.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
6 changes: 3 additions & 3 deletions src/tools/compiletest/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down Expand Up @@ -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"),
Expand Down Expand Up @@ -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));
Expand Down
6 changes: 4 additions & 2 deletions src/tools/compiletest/src/runtest.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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))
Expand Down

0 comments on commit 4e5333c

Please sign in to comment.