Skip to content

Commit

Permalink
ensure existence of the tool crate dir before linking
Browse files Browse the repository at this point in the history
Signed-off-by: onur-ozkan <[email protected]>
  • Loading branch information
onur-ozkan committed Nov 5, 2023
1 parent a348b00 commit 32946d2
Showing 1 changed file with 16 additions and 14 deletions.
30 changes: 16 additions & 14 deletions src/bootstrap/src/core/build_steps/doc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -829,13 +829,15 @@ macro_rules! tool_doc {
builder.stage_out(compiler, Mode::ToolRustc).join("doc"),
];

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

for out_dir in out_dirs {
symlink_dir_force(&builder.config, &out, &out_dir);
for out_dir in &out_dirs {
symlink_dir_force(&builder.config, &out, &out_dir);
}
}

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

if !builder.config.dry_run() {
// Sanity check on linked doc directories
$(for krate in $crates {
let dir_name = krate.replace("-", "_");
// Making sure the directory exists and is not empty.
assert!(out.join(&*dir_name).read_dir().unwrap().next().is_some());
})?
}
// if !builder.config.dry_run() {
// // Sanity check on linked doc directories
// $(for krate in $crates {
// let dir_name = krate.replace("-", "_");
// // Making sure the directory exists and is not empty.
// assert!(out.join(&*dir_name).read_dir().unwrap().next().is_some());
// })?
// }
}
}
}
Expand Down

0 comments on commit 32946d2

Please sign in to comment.