about summary refs log tree commit diff
path: root/src/bootstrap
diff options
context:
space:
mode:
authorYuki Okushi <jtitor@2k36.org>2021-06-21 09:42:15 +0900
committerGitHub <noreply@github.com>2021-06-21 09:42:15 +0900
commite435e3259dc61cfae8cfae26e49eb21a7a9b438b (patch)
tree66539a8c3b6a5785ac70ad806ac8599de89b5fc8 /src/bootstrap
parente7a4f1e3fcb9af6841a07f073432b838193550d4 (diff)
parent1e9f0b367e0b7dc9902502cfa09bcc52d2215261 (diff)
downloadrust-e435e3259dc61cfae8cfae26e49eb21a7a9b438b.tar.gz
rust-e435e3259dc61cfae8cfae26e49eb21a7a9b438b.zip
Rollup merge of #86156 - ehuss:linkchecker-fixes, r=Mark-Simulacrum
Fix a bug in the linkchecker

There was a small typo in the linkchecker (in #85652) that caused it to report a `#` fragment link error pointing to the wrong file (it was displaying the path to the source file, not the target of the link).

This also includes a few other changes:
- Fixes the tests due to some changes in the redirect handling in #84703.
- Adds the tests to rustbuild to run whenever the linkchecker itself is run.
- Updates the tests to validate more of the output (so that a mistake like this would have been caught).

Closes #86144
Diffstat (limited to 'src/bootstrap')
-rw-r--r--src/bootstrap/builder/tests.rs5
-rw-r--r--src/bootstrap/test.rs17
2 files changed, 22 insertions, 0 deletions
diff --git a/src/bootstrap/builder/tests.rs b/src/bootstrap/builder/tests.rs
index 4d7c207e3ab..e7fb8c0d4d5 100644
--- a/src/bootstrap/builder/tests.rs
+++ b/src/bootstrap/builder/tests.rs
@@ -613,9 +613,14 @@ mod dist {
         // Note that the stages here are +1 than what they actually are because
         // Rustdoc::run swaps out the compiler with stage minus 1 if --stage is
         // not 0.
+        //
+        // The stage 0 copy is the one downloaded for bootstrapping. It is
+        // (currently) needed to run "cargo test" on the linkchecker, and
+        // should be relatively "free".
         assert_eq!(
             first(builder.cache.all::<tool::Rustdoc>()),
             &[
+                tool::Rustdoc { compiler: Compiler { host: a, stage: 0 } },
                 tool::Rustdoc { compiler: Compiler { host: a, stage: 1 } },
                 tool::Rustdoc { compiler: Compiler { host: a, stage: 2 } },
             ]
diff --git a/src/bootstrap/test.rs b/src/bootstrap/test.rs
index 319b56a0b70..93ba8b07f5b 100644
--- a/src/bootstrap/test.rs
+++ b/src/bootstrap/test.rs
@@ -124,8 +124,25 @@ You can skip linkcheck with --exclude src/tools/linkchecker"
 
         builder.info(&format!("Linkcheck ({})", host));
 
+        // Test the linkchecker itself.
+        let bootstrap_host = builder.config.build;
+        let compiler = builder.compiler(0, bootstrap_host);
+        let cargo = tool::prepare_tool_cargo(
+            builder,
+            compiler,
+            Mode::ToolBootstrap,
+            bootstrap_host,
+            "test",
+            "src/tools/linkchecker",
+            SourceType::InTree,
+            &[],
+        );
+        try_run(builder, &mut cargo.into());
+
+        // Build all the default documentation.
         builder.default_doc(&[]);
 
+        // Run the linkchecker.
         let _time = util::timeit(&builder);
         try_run(
             builder,