Remove cargo workspace to build rustdoc-gui test crates because of cargo config not being applied

This commit is contained in:
Guillaume Gomez 2021-07-21 17:55:44 +02:00
parent 1bf8a839d3
commit 3bafcf87aa
4 changed files with 21 additions and 35 deletions

View File

@ -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

View File

@ -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);

View File

@ -1,18 +0,0 @@
# This file is automatically @generated by Cargo.
# It is not intended for manual editing.
version = 3
[[package]]
name = "implementors"
version = "0.1.0"
[[package]]
name = "lib2"
version = "0.1.0"
dependencies = [
"implementors",
]
[[package]]
name = "test_docs"
version = "0.1.0"

View File

@ -1,6 +0,0 @@
[workspace]
members = [
"test_docs",
"lib2",
"implementors",
]