-
Notifications
You must be signed in to change notification settings - Fork 12.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add a link validator to rustbuild #32133
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
We'll tack on more steps here later
Run `cargo doc` to generate all documentation for the standard library, and also add a target which generates documentation for the compiler as well (but don't enable it by default).
Use a macro so it automatically picks up new steps.
We've actually got quite a few tools that are compiled as part of our build, let's start housing them all in a `tools` directory.
Instead of using a `is_std: bool`, instead use a more well-typed and self-documenting enum to indicate the mode in which Cargo is being invoked.
The stage0 rustdoc comes from the snapshot, and we need a shim like with `rustc` to pass `--cfg` for now.
Add a script to get run which verifies that `href` links in documents are correct. We're always getting a steady stream of "fix a broken link" PRs and issue reports, and we should probably just nip them all in the bud.
Just always build stage1 rustdoc, it's really not that much more to build as it's essentially just one library.
A few categories: * Links into compiler docs were just all removed as we're not generating compiler docs. * Move up one more level to forcibly go to std docs to fix inlined documentation across the facade crates.
This is actually a reexported implementation detail in the `rt::v1` module but rustdoc doesn't like reexporting items from `doc(hidden)` modules. Do what we'd end up doing anyway from an API perspective and make a public-facing `enum` that can be retranslated under the hood if necessary.
Right now whenever rustdoc inlines a struct or enum from another crate it ends up inlining *all* `impl` items found in the other crate at the same time. The rationale for this was to discover all trait impls which are otherwise not probed for. This unfortunately picks up a lot of impls of public traits for private types, causing lots of broken links. This commit instead hoards all of those inlined impls into a temporary storage location which is then selectively drawn from whenever we inline a new type. This should ensure that we still inline all relevant impls while avoiding all private ones.
This adds a step and a rule for building the error index as part of rustbuild.
r? @brson - mostly rustbuild |
48 tasks
Oh and I should also mention that this adds support for generating crate docs via rustbuild. This PR ended up doing a bit more than I originally intended... |
r=me |
⌛ Testing commit 3e6fed3 with merge aeb85a9... |
bors
added a commit
that referenced
this pull request
Mar 11, 2016
Add a link validator to rustbuild This commit was originally targeted at just adding a link checking script to the rustbuild system. This ended up snowballing a bit to extend rustbuild to be amenable to various tools we have as part of the build system in general. There's a new `src/tools` directory which has a number of scripts/programs that are purely intended to be used as part of the build system and CI of this repository. This is currently inhabited by rustbook, the error index generator, and a new linkchecker script added as part of this PR. I suspect that more tools like compiletest, tidy scripts, snapshot scripts, etc will migrate their way into this directory over time. The commit which adds the error index generator shows the steps necessary to add new tools to the build system, namely: 1. New steps are defined for building the tool and running the tool 2. The dependencies are configured 3. The steps are implemented In terms of the link checker, these commits do a few things: * A new `src/tools/linkchecker` script is added. This will read an entire documentation tree looking for broken relative links (HTTP links aren't followed yet). * A large number of broken links throughout the documentation were fixed. Many of these were just broken when viewed from core as opposed to std, but were easily fixed. * A few rustdoc bugs here and there were fixed
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This commit was originally targeted at just adding a link checking script to the rustbuild system. This ended up snowballing a bit to extend rustbuild to be amenable to various tools we have as part of the build system in general.
There's a new
src/tools
directory which has a number of scripts/programs that are purely intended to be used as part of the build system and CI of this repository. This is currently inhabited by rustbook, the error index generator, and a new linkchecker script added as part of this PR. I suspect that more tools like compiletest, tidy scripts, snapshot scripts, etc will migrate their way into this directory over time.The commit which adds the error index generator shows the steps necessary to add new tools to the build system, namely:
In terms of the link checker, these commits do a few things:
src/tools/linkchecker
script is added. This will read an entire documentation tree looking for broken relative links (HTTP links aren't followed yet).