Skip to content

Commit f06efd2

Browse files
Workaround increased cache clearing in Cargo
1.52 Cargo adds rust-lang/cargo#8640 which means that cargo will try to purge the doc directory caches for us. In theory this may mean that we can jettison the clear_if_dirty for rustdoc versioning entirely, but for now just workaround the effects of this change in a less principled but more local way.
1 parent b3a4f91 commit f06efd2

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

Diff for: src/bootstrap/doc.rs

+10-1
Original file line numberDiff line numberDiff line change
@@ -461,7 +461,16 @@ impl Step for Std {
461461
// create correct links between crates because rustdoc depends on the
462462
// existence of the output directories to know if it should be a local
463463
// or remote link.
464-
let krates = ["core", "alloc", "std", "proc_macro", "test"];
464+
//
465+
// There's also a mild hack here where we build the first crate in this
466+
// list, core, twice. This is currently necessary to make sure that
467+
// cargo's cached rustc/rustdoc versions are up to date which means
468+
// cargo won't delete the out_dir we create for the stampfile.
469+
// Essentially any crate could go into the first slot here as it's
470+
// output directory will be deleted by us (as cargo will purge the stamp
471+
// file during the first slot's run), and core is relatively fast to
472+
// build so works OK to fill this 'dummy' slot.
473+
let krates = ["core", "core", "alloc", "std", "proc_macro", "test"];
465474
for krate in &krates {
466475
run_cargo_rustdoc_for(krate);
467476
}

0 commit comments

Comments
 (0)