Skip to content

Commit 32946d2

Browse files
committed
ensure existence of the tool crate dir before linking
Signed-off-by: onur-ozkan <[email protected]>
1 parent a348b00 commit 32946d2

File tree

1 file changed

+16
-14
lines changed
  • src/bootstrap/src/core/build_steps

1 file changed

+16
-14
lines changed

src/bootstrap/src/core/build_steps/doc.rs

+16-14
Original file line numberDiff line numberDiff line change
@@ -829,13 +829,15 @@ macro_rules! tool_doc {
829829
builder.stage_out(compiler, Mode::ToolRustc).join("doc"),
830830
];
831831

832-
$(for krate in $crates {
833-
let dir_name = krate.replace("-", "_");
834-
t!(fs::create_dir_all(&out.join(dir_name)));
835-
})?
832+
if !builder.config.dry_run() {
833+
$(for krate in $crates {
834+
let dir_name = krate.replace("-", "_");
835+
t!(fs::create_dir_all(out_dirs[0].join(&*dir_name)));
836+
})?
836837

837-
for out_dir in out_dirs {
838-
symlink_dir_force(&builder.config, &out, &out_dir);
838+
for out_dir in &out_dirs {
839+
symlink_dir_force(&builder.config, &out, &out_dir);
840+
}
839841
}
840842

841843
// Build cargo command.
@@ -873,14 +875,14 @@ macro_rules! tool_doc {
873875
let _guard = builder.msg_doc(compiler, stringify!($tool).to_lowercase(), target);
874876
builder.run(&mut cargo.into());
875877

876-
if !builder.config.dry_run() {
877-
// Sanity check on linked doc directories
878-
$(for krate in $crates {
879-
let dir_name = krate.replace("-", "_");
880-
// Making sure the directory exists and is not empty.
881-
assert!(out.join(&*dir_name).read_dir().unwrap().next().is_some());
882-
})?
883-
}
878+
// if !builder.config.dry_run() {
879+
// // Sanity check on linked doc directories
880+
// $(for krate in $crates {
881+
// let dir_name = krate.replace("-", "_");
882+
// // Making sure the directory exists and is not empty.
883+
// assert!(out.join(&*dir_name).read_dir().unwrap().next().is_some());
884+
// })?
885+
// }
884886
}
885887
}
886888
}

0 commit comments

Comments
 (0)