about summary refs log tree commit diff
diff options
context:
space:
mode:
authorMark Rousskov <mark.simulacrum@gmail.com>2021-04-04 14:51:22 -0400
committerMark Rousskov <mark.simulacrum@gmail.com>2021-04-04 14:57:05 -0400
commitf06efd2a24761b3f2b73d9888a8f945de5ec26e4 (patch)
tree646c0c708fa9402e811d29d08fb535b7437b57dd
parentb3a4f91b8d16f65e3220f14fc7867fed0cc7d1e7 (diff)
downloadrust-f06efd2a24761b3f2b73d9888a8f945de5ec26e4.tar.gz
rust-f06efd2a24761b3f2b73d9888a8f945de5ec26e4.zip
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.
-rw-r--r--src/bootstrap/doc.rs11
1 files changed, 10 insertions, 1 deletions
diff --git a/src/bootstrap/doc.rs b/src/bootstrap/doc.rs
index 1168d54b55e..fc79fc10fb4 100644
--- a/src/bootstrap/doc.rs
+++ b/src/bootstrap/doc.rs
@@ -461,7 +461,16 @@ impl Step for Std {
         // create correct links between crates because rustdoc depends on the
         // existence of the output directories to know if it should be a local
         // or remote link.
-        let krates = ["core", "alloc", "std", "proc_macro", "test"];
+        //
+        // There's also a mild hack here where we build the first crate in this
+        // list, core, twice. This is currently necessary to make sure that
+        // cargo's cached rustc/rustdoc versions are up to date which means
+        // cargo won't delete the out_dir we create for the stampfile.
+        // Essentially any crate could go into the first slot here as it's
+        // output directory will be deleted by us (as cargo will purge the stamp
+        // file during the first slot's run), and core is relatively fast to
+        // build so works OK to fill this 'dummy' slot.
+        let krates = ["core", "core", "alloc", "std", "proc_macro", "test"];
         for krate in &krates {
             run_cargo_rustdoc_for(krate);
         }