From c346482a77eb301d8ca21ac02f5d063852120ab3 Mon Sep 17 00:00:00 2001 From: Tim Neumann Date: Wed, 13 Jul 2016 15:05:52 +0200 Subject: [PATCH 1/3] create global doc dir for all doc targets --- src/bootstrap/doc.rs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/bootstrap/doc.rs b/src/bootstrap/doc.rs index ac90ab54737..247b9603c0b 100644 --- a/src/bootstrap/doc.rs +++ b/src/bootstrap/doc.rs @@ -155,6 +155,7 @@ pub fn std(build: &Build, stage: u32, target: &str, out: &Path) { /// is largely just a wrapper around `cargo doc`. pub fn test(build: &Build, stage: u32, target: &str, out: &Path) { println!("Documenting stage{} test ({})", stage, target); + t!(fs::create_dir_all(out)); let compiler = Compiler::new(stage, &build.config.build); let out_dir = build.stage_out(&compiler, Mode::Libtest) .join(target).join("doc"); @@ -175,6 +176,7 @@ pub fn test(build: &Build, stage: u32, target: &str, out: &Path) { /// dependencies. This is largely just a wrapper around `cargo doc`. pub fn rustc(build: &Build, stage: u32, target: &str, out: &Path) { println!("Documenting stage{} compiler ({})", stage, target); + t!(fs::create_dir_all(out)); let compiler = Compiler::new(stage, &build.config.build); let out_dir = build.stage_out(&compiler, Mode::Librustc) .join(target).join("doc"); From a2718217dca7bfcbb563337d53c3c1adea3321cc Mon Sep 17 00:00:00 2001 From: Tim Neumann Date: Wed, 13 Jul 2016 15:15:28 +0200 Subject: [PATCH 2/3] only remove directory if it exists --- src/bootstrap/doc.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/bootstrap/doc.rs b/src/bootstrap/doc.rs index 247b9603c0b..c2636384dbb 100644 --- a/src/bootstrap/doc.rs +++ b/src/bootstrap/doc.rs @@ -181,7 +181,7 @@ pub fn rustc(build: &Build, stage: u32, target: &str, out: &Path) { let out_dir = build.stage_out(&compiler, Mode::Librustc) .join(target).join("doc"); let rustdoc = build.rustdoc(&compiler); - if !up_to_date(&rustdoc, &out_dir.join("rustc/index.html")) { + if !up_to_date(&rustdoc, &out_dir.join("rustc/index.html")) && out_dir.exists() { t!(fs::remove_dir_all(&out_dir)); } let mut cargo = build.cargo(&compiler, Mode::Librustc, target, "doc"); From 3c0c663b0e0b66b61471aac34894a3fb78aa10fa Mon Sep 17 00:00:00 2001 From: Tim Neumann Date: Wed, 13 Jul 2016 15:40:42 +0200 Subject: [PATCH 3/3] build compiler docs if requested in config --- src/bootstrap/step.rs | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/src/bootstrap/step.rs b/src/bootstrap/step.rs index 4b3be04b57c..82ae70d22ca 100644 --- a/src/bootstrap/step.rs +++ b/src/bootstrap/step.rs @@ -380,10 +380,18 @@ impl<'a> Step<'a> { vec![self.doc_test(stage)] } Source::Doc { stage } => { - vec![self.doc_book(stage), self.doc_nomicon(stage), - self.doc_style(stage), self.doc_standalone(stage), - self.doc_std(stage), - self.doc_error_index(stage)] + let mut deps = vec![ + self.doc_book(stage), self.doc_nomicon(stage), + self.doc_style(stage), self.doc_standalone(stage), + self.doc_std(stage), + self.doc_error_index(stage), + ]; + + if build.config.compiler_docs { + deps.push(self.doc_rustc(stage)); + } + + deps } Source::Check { stage, compiler } => { // Check is just a pseudo step which means check all targets,