Skip to content

Commit

Permalink
Rollup merge of #80362 - jyn514:rustc-macros, r=ehuss
Browse files Browse the repository at this point in the history
  • Loading branch information
Dylan-DPC authored Dec 28, 2020
2 parents cefe40b + 82acbc8 commit 18be436
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions src/bootstrap/doc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -500,18 +500,17 @@ impl Step for Rustc {
let target = self.target;
builder.info(&format!("Documenting stage{} compiler ({})", stage, target));

// This is the intended out directory for compiler documentation.
let out = builder.compiler_doc_out(target);
t!(fs::create_dir_all(&out));

let compiler = builder.compiler(stage, builder.config.build);

if !builder.config.compiler_docs {
builder.info("\tskipping - compiler/librustdoc docs disabled");
return;
}

// This is the intended out directory for compiler documentation.
let out = builder.compiler_doc_out(target);
t!(fs::create_dir_all(&out));

// Build rustc.
let compiler = builder.compiler(stage, builder.config.build);
builder.ensure(compile::Rustc { compiler, target });

// This uses a shared directory so that librustdoc documentation gets
Expand All @@ -521,6 +520,10 @@ impl Step for Rustc {
// merging the search index, or generating local (relative) links.
let out_dir = builder.stage_out(compiler, Mode::Rustc).join(target.triple).join("doc");
t!(symlink_dir_force(&builder.config, &out, &out_dir));
// Cargo puts proc macros in `target/doc` even if you pass `--target`
// explicitly (https://github.com/rust-lang/cargo/issues/7677).
let proc_macro_out_dir = builder.stage_out(compiler, Mode::Rustc).join("doc");
t!(symlink_dir_force(&builder.config, &out, &proc_macro_out_dir));

// Build cargo command.
let mut cargo = builder.cargo(compiler, Mode::Rustc, SourceType::InTree, target, "doc");
Expand Down

0 comments on commit 18be436

Please sign in to comment.