From a3fe394c7534fdb9217259699b02d2aa3f8c2ba9 Mon Sep 17 00:00:00 2001 From: onur-ozkan Date: Sat, 4 Nov 2023 21:12:37 +0300 Subject: [PATCH] ensure existence of the tool crate dir before linking Signed-off-by: onur-ozkan --- src/bootstrap/src/core/build_steps/doc.rs | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/src/bootstrap/src/core/build_steps/doc.rs b/src/bootstrap/src/core/build_steps/doc.rs index 8929ad1a6cd4..04cf9a3d15c3 100644 --- a/src/bootstrap/src/core/build_steps/doc.rs +++ b/src/bootstrap/src/core/build_steps/doc.rs @@ -829,13 +829,16 @@ 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 out_dir in &out_dirs { + t!(fs::create_dir_all(&out_dir)); + symlink_dir_force(&builder.config, &out, &out_dir); + } - for out_dir in out_dirs { - symlink_dir_force(&builder.config, &out, &out_dir); + $(for krate in $crates { + let dir_name = krate.replace("-", "_"); + t!(fs::create_dir_all(out_dirs[0].join(&*dir_name))); + })? } // Build cargo command.