rust-lang / rust

Empowering everyone to build reliable and efficient software.
https://www.rust-lang.org
Other
97k stars 12.54k forks source link

Run linkchecker just on some docs? #76762

Open RalfJung opened 4 years ago

RalfJung commented 4 years ago

I once again had a CI run fail due to a bad rustdoc link, and figured I'd try running that linkchecker locally. So I ran ./x.py test linkchecker --test-args library/alloc, realized it was building a full rustc (tidy seems to overwrite that default so maybe the linkchecker should, too? that sounds like https://github.com/rust-lang/rust/issues/76371), added --stage 0, and still had to wait quite a bit while it built rustbook and "unstable-book-gen" and whatnot, none of which is needed to ensure that the liballoc docs do not have bad links. And then it still built a full rustc so I stopped, I guess I will have to rely on CI for this.

Is there any way to runst linkcheker on the docs for library/alloc without building rustc?

ehuss commented 4 years ago

I think the short answer is "no". One of the issues is that the docs use relative links, so the linkchecker needs the other docs available to check that the target of the link exists.

I could try to do a simple fix for #76371 to avoid the second build of rustc, but at least one build of rustc is needed for the rustc book.

For me, with rustc already built, running the linkchecker takes about 2.5 minutes.

jyn514 commented 4 years ago

at least one build of rustc is needed for the rustc book.

If you had compiler-docs = false, would that still be necessary? Being able to run linkchecker with stage 0 seems useful.