self.prepare_units()?;
self.prepare()?;
custom_build::build_map(&mut self)?;
- self.check_collistions()?;
+ self.check_collisions()?;
+ // We need to make sure that if there were any previous docs
+ // already compiled, they were compiled with the same Rustc version that we're currently
+ // using. Otherways we must remove the `doc/` folder and compile again forcing a rebuild.
+ //
+ // This is important because the `.js`/`.html` & `.css` files that are generated by Rustc don't have
+ // any versioning (See https://github.com/rust-lang/cargo/issues/8461).
+ // Therefore, we can end up with weird bugs and behaviours if we mix different
+ // compiler versions of these files.
+ let doc_dir = self.files().host_root().join("doc");
+ let (fingerprint, doc_dir_removed) = RustDocFingerprint::check_rustdoc_fingerprint(
+ &doc_dir,
+ self.bcx.rustc().verbose_version.as_str(),
+ )?;
+ if doc_dir_removed {
+ fingerprint.write(&doc_dir)?
+ };
+
for unit in &self.bcx.roots {
// Build up a list of pending jobs, each of which represent
// compiling a particular package. No actual work is executed as