Skip to content

Commit

Permalink
Rollup merge of rust-lang#56441 - ollie27:rustbuild_compiler_docs, r=…
Browse files Browse the repository at this point in the history
…alexcrichton

rustbuild: Fix issues with compiler docs

* Create output directories for crates beforehand so rustdoc uses relative links (fixes rust-lang#56107)
* Readd rustc_codegen_ssa (fixes rust-lang#56196)
* Don't build out of tree dependencies for rustdoc like we don't for rustc
  • Loading branch information
pietroalbini authored Dec 6, 2018
2 parents 0aa72ad + 3b705a0 commit 0be8537
Showing 1 changed file with 11 additions and 6 deletions.
17 changes: 11 additions & 6 deletions src/bootstrap/doc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -697,9 +697,6 @@ impl Step for Rustc {
return;
}

// Build libstd docs so that we generate relative links.
builder.ensure(Std { stage, target });

// Build rustc.
builder.ensure(compile::Rustc { compiler, target });

Expand All @@ -718,12 +715,16 @@ impl Step for Rustc {

// Find dependencies for top level crates.
let mut compiler_crates = HashSet::new();
for root_crate in &["rustc", "rustc_driver", "rustc_codegen_llvm"] {
for root_crate in &["rustc_driver", "rustc_codegen_llvm", "rustc_codegen_ssa"] {
let interned_root_crate = INTERNER.intern_str(root_crate);
find_compiler_crates(builder, &interned_root_crate, &mut compiler_crates);
}

for krate in &compiler_crates {
// Create all crate output directories first to make sure rustdoc uses
// relative links.
// FIXME: Cargo should probably do this itself.
t!(fs::create_dir_all(out_dir.join(krate)));
cargo.arg("-p").arg(krate);
}

Expand Down Expand Up @@ -797,8 +798,8 @@ impl Step for Rustdoc {
return;
}

// Build libstd docs so that we generate relative links.
builder.ensure(Std { stage, target });
// Build rustc docs so that we generate relative links.
builder.ensure(Rustc { stage, target });

// Build rustdoc.
builder.ensure(tool::Rustdoc { host: compiler.host });
Expand All @@ -822,6 +823,10 @@ impl Step for Rustdoc {
&[]
);

// Only include compiler crates, no dependencies of those, such as `libc`.
cargo.arg("--no-deps");
cargo.arg("-p").arg("rustdoc");

cargo.env("RUSTDOCFLAGS", "--document-private-items");
builder.run(&mut cargo);
}
Expand Down

0 comments on commit 0be8537

Please sign in to comment.