Skip to content

Commit

Permalink
Remove cargo workspace to build rustdoc-gui test crates because of ca…
Browse files Browse the repository at this point in the history
…rgo config not being applied
  • Loading branch information
GuillaumeGomez committed Jul 21, 2021
1 parent 1bf8a83 commit 3bafcf8
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 35 deletions.
1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ members = [
exclude = [
"build",
"compiler/rustc_codegen_cranelift",
"src/test/rustdoc-gui",
# HACK(eddyb) This hardcodes the fact that our CI uses `/checkout/obj`.
"obj",
# The `x` binary is a thin wrapper that calls `x.py`, which initializes
Expand Down
31 changes: 20 additions & 11 deletions src/bootstrap/test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -907,18 +907,27 @@ impl Step for RustdocGUI {
// We remove existing folder to be sure there won't be artifacts remaining.
let _ = fs::remove_dir_all(&out_dir);

let src_path = "src/test/rustdoc-gui/src";
let src_path = builder.build.src.join("src/test/rustdoc-gui/src");
// We generate docs for the libraries present in the rustdoc-gui's src folder.
let mut cargo = Command::new(&builder.initial_cargo);
cargo
.arg("doc")
.arg("--workspace")
.arg("--target-dir")
.arg(&out_dir)
.env("RUSTDOC", builder.rustdoc(self.compiler))
.env("RUSTC", builder.rustc(self.compiler))
.current_dir(&builder.build.src.join(src_path));
builder.run(&mut cargo);
for entry in src_path.read_dir().expect("read_dir call failed") {
if let Ok(entry) = entry {
let path = entry.path();

if !path.is_dir() {
continue;
}

let mut cargo = Command::new(&builder.initial_cargo);
cargo
.arg("doc")
.arg("--target-dir")
.arg(&out_dir)
.env("RUSTDOC", builder.rustdoc(self.compiler))
.env("RUSTC", builder.rustc(self.compiler))
.current_dir(path);
builder.run(&mut cargo);
}
}

// We now run GUI tests.
let mut command = Command::new(&nodejs);
Expand Down
18 changes: 0 additions & 18 deletions src/test/rustdoc-gui/src/Cargo.lock

This file was deleted.

6 changes: 0 additions & 6 deletions src/test/rustdoc-gui/src/Cargo.toml

This file was deleted.

0 comments on commit 3bafcf8

Please sign in to comment.