Skip to content
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

linkcheck: fix filtering of the source files #2019

Merged
merged 1 commit into from
Aug 3, 2024

Conversation

marxin
Copy link
Contributor

@marxin marxin commented Jul 23, 2024

If I run the mkbook build on top of #2017, I get the following before this PR:

❯ RUST_LOG=info mdbook build
2024-07-23 16:33:33 [INFO] (mdbook::book): Book building has started
2024-07-23 16:33:33 [INFO] (mdbook::book): Running the html backend
2024-07-23 16:33:33 [INFO] (mdbook::book): Running the linkcheck backend
2024-07-23 16:33:33 [INFO] (mdbook::renderer): Invoking the "linkcheck" renderer
Checking files changed in master...: src/backend/updating-llvm.md src/mir/optimizations.md src/mir/passes.md src/mir/visitor.md src/profile-guided-optimization.md 
exec mdbook-linkcheck -f src/backend/updating-llvm.md src/mir/optimizations.md src/mir/passes.md src/mir/visitor.md src/profile-guided-optimization.md 
[2024-07-23T14:33:34Z INFO  mdbook_linkcheck] Started the link checker
[2024-07-23T14:33:34Z INFO  mdbook_linkcheck] Scanning book for links
[2024-07-23T14:33:34Z INFO  mdbook_linkcheck] Found 0 links (0 incomplete links)
[2024-07-23T14:33:34Z INFO  mdbook_linkcheck] No broken links found

as seen, the src/ prefix is present as arguments to mdbook_linkcheck, but the filtering in the tool does not present the files with the prefix!

After my change:

❯ RUST_LOG=info mdbook build
2024-07-23 16:30:43 [INFO] (mdbook::book): Book building has started
2024-07-23 16:30:43 [INFO] (mdbook::book): Running the html backend
2024-07-23 16:30:44 [INFO] (mdbook::book): Running the linkcheck backend
2024-07-23 16:30:44 [INFO] (mdbook::renderer): Invoking the "linkcheck" renderer
Checking files changed in master...: backend/updating-llvm.md mir/optimizations.md mir/passes.md mir/visitor.md profile-guided-optimization.md 
exec mdbook-linkcheck -f backend/updating-llvm.md mir/optimizations.md mir/passes.md mir/visitor.md profile-guided-optimization.md 
[2024-07-23T14:30:44Z INFO  mdbook_linkcheck] Started the link checker
[2024-07-23T14:30:44Z INFO  mdbook_linkcheck] Scanning book for links
[2024-07-23T14:30:44Z INFO  mdbook_linkcheck] Found 73 links (2 incomplete links)
[2024-07-23T14:30:44Z WARN  linkcheck::validation::filesystem] Not checking that the "mono" section exists in "/home/marxin/Programming/rustc-dev-guide/src/appendix/glossary.md" because fragment resolution isn't implemented
[2024-07-23T14:30:44Z WARN  linkcheck::validation::filesystem] Not checking that the "def-id" section exists in "/home/marxin/Programming/rustc-dev-guide/src/appendix/glossary.md" because fragment resolution isn't implemented
[2024-07-23T14:30:44Z WARN  linkcheck::validation::filesystem] Not checking that the "stealing" section exists in "/home/marxin/Programming/rustc-dev-guide/src/mir/passes.md" because fragment resolution isn't implemented
[2024-07-23T14:30:44Z WARN  linkcheck::validation] Not checking "what-is-profiled-guided-optimization" in the current file because fragment resolution isn't implemented
[2024-07-23T14:30:44Z WARN  linkcheck::validation] Not checking "how-is-pgo-implemented-in-rustc" in the current file because fragment resolution isn't implemented
[2024-07-23T14:30:44Z WARN  linkcheck::validation] Not checking "overall-workflow" in the current file because fragment resolution isn't implemented
[2024-07-23T14:30:44Z WARN  linkcheck::validation] Not checking "compile-time-aspects" in the current file because fragment resolution isn't implemented
[2024-07-23T14:30:44Z WARN  linkcheck::validation] Not checking "create-binaries-with-instrumentation" in the current file because fragment resolution isn't implemented
[2024-07-23T14:30:44Z WARN  linkcheck::validation] Not checking "compile-binaries-where-optimizations-make-use-of-profiling-data" in the current file because fragment resolution isn't implemented
[2024-07-23T14:30:44Z WARN  linkcheck::validation] Not checking "runtime-aspects" in the current file because fragment resolution isn't implemented
[2024-07-23T14:30:44Z WARN  linkcheck::validation] Not checking "testing-pgo" in the current file because fragment resolution isn't implemented
[2024-07-23T14:30:44Z WARN  linkcheck::validation] Not checking "additional-information" in the current file because fragment resolution isn't implemented
[2024-07-23T14:30:44Z WARN  linkcheck::validation] Not checking "why-update-llvm" in the current file because fragment resolution isn't implemented
[2024-07-23T14:30:44Z WARN  linkcheck::validation] Not checking "bugfix-updates" in the current file because fragment resolution isn't implemented
[2024-07-23T14:30:44Z WARN  linkcheck::validation] Not checking "new-llvm-release-updates" in the current file because fragment resolution isn't implemented
[2024-07-23T14:30:44Z WARN  linkcheck::validation] Not checking "caveats-and-gotchas" in the current file because fragment resolution isn't implemented
error: It looks like "query.md" wasn't included in SUMMARY.md
   ┌─ mir/passes.md:29:19
   │
29 │ [^query]: See the [Queries](../query.md) chapter for the general concept of query.
   │                   ^^^^^^^^^^^^^^^^^^^^^^ It looks like "query.md" wasn't included in SUMMARY.md

error: It looks like "query.md" wasn't included in SUMMARY.md
    ┌─ mir/passes.md:167:16
    │
167 │ (remember that [queries are memoized](../query.html), so executing a query twice
    │                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ It looks like "query.md" wasn't included in SUMMARY.md

error: It looks like "mir/index.md" wasn't included in SUMMARY.md
  ┌─ mir/optimizations.md:3:48
  │
3 │ MIR optimizations are optimizations run on the [MIR][mir] to produce better MIR
  │                                                ^^^^^^^^^^ It looks like "mir/index.md" wasn't included in SUMMARY.md

error: It looks like "appendix/glossary.md" wasn't included in SUMMARY.md
  ┌─ mir/optimizations.md:7:1
  │
7 │ [monomorphized][monomorph] yet), these optimizations are particularly
  │ ^^^^^^^^^^^^^^^^^^^^^^^^^^ It looks like "appendix/glossary.md" wasn't included in SUMMARY.md

error: It looks like "query.md" wasn't included in SUMMARY.md
   ┌─ mir/optimizations.md:19:31
   │
19 │ The [`optimized_mir`][optmir] [query] is called to produce the optimized MIR
   │                               ^^^^^^^ It looks like "query.md" wasn't included in SUMMARY.md

error: It looks like "appendix/glossary.md" wasn't included in SUMMARY.md
   ┌─ mir/optimizations.md:20:13
   │
20 │ for a given [`DefId`][defid]. This query makes sure that the borrow checker has
   │             ^^^^^^^^^^^^^^^^ It looks like "appendix/glossary.md" wasn't included in SUMMARY.md

error: It looks like "llvm-coverage-instrumentation.md" wasn't included in SUMMARY.md
   ┌─ profile-guided-optimization.md:60:1
   │
60 │ [`-C instrument-coverage`](./llvm-coverage-instrumentation.md), but using these
   │ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ It looks like "llvm-coverage-instrumentation.md" wasn't included in SUMMARY.md

error: Server returned 404 Not Found for https://github.com/rust-lang/rust/tree/master/tests/run-make-fulldeps
    ┌─ profile-guided-optimization.md:138:4
    │
138 │ in [run-make tests][rmake-tests] (the relevant tests have `pgo` in their name).
    │    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Server returned 404 Not Found for https://github.com/rust-lang/rust/tree/master/tests/run-make-fulldeps

error: Potential incomplete link
   ┌─ mir/visitor.md:40:52
   │
40 │ A very simple example of a visitor can be found in [`LocalFinder`].
   │                                                    ^^^^^^^^^^^^^^^ Did you forget to define a URL for ``LocalFinder``?
   │
   = hint: declare the link's URL. For example: `[`LocalFinder`]: http://example.com/`

error: Potential incomplete link
   ┌─ mir/visitor.md:44:2
   │
44 │ -[`LocalFinder`]: https://doc.rust-lang.org/nightly/nightly-rustc/rustc_mir_transform/prettify/struct.LocalFinder.html
   │  ^^^^^^^^^^^^^^^ Did you forget to define a URL for ``LocalFinder``?
   │
   = hint: declare the link's URL. For example: `[`LocalFinder`]: http://example.com/`

[2024-07-23T14:30:44Z INFO  mdbook_linkcheck] 8 broken links found
Error: One or more incorrect links

@Kobzol
Copy link
Contributor

Kobzol commented Jul 24, 2024

Good catch. I wonder why don't we just linkcheck all the files though 🤔

@marxin
Copy link
Contributor Author

marxin commented Jul 24, 2024

Good catch. I wonder why don't we just linkcheck all the files though 🤔

It's explained here: #913 (mainly because of: avoiding the 429 Too Many
Requests issues we've been seeing
).

@Kobzol
Copy link
Contributor

Kobzol commented Jul 24, 2024

Ah, makes sense, thanks.

@spastorino spastorino merged commit f15edb8 into rust-lang:master Aug 3, 2024
1 check passed
@marxin marxin deleted the fix-linkcheck.sh branch August 4, 2024 12:04
matthiaskrgr added a commit to matthiaskrgr/rust that referenced this pull request Aug 14, 2024
Update books

## rust-lang/book

7 commits in 67fa536768013d9d5a13f3a06790521d511ef711..04bc1396bb857f35b5dda1d773c9571e1f253304
2024-07-31 13:19:44 UTC to 2024-07-16 18:18:38 UTC

- mdbook-trpl-listing: Add missing elided lifetimes (rust-lang/book#3995)
- infra: include ghp-import and git push in generate-preview script (rust-lang/book#3998)
- infra: add robots.txt for GH Pages previews (rust-lang/book#3997)
- Clarify function definitions vs. expressions (rust-lang/book#3870)
- infra: fix some shellcheck issues in CI config (rust-lang/book#3988)
- infra: support test renderer in mdbook preprocessors (rust-lang/book#3982)
- Improve handling of `<Listing>`s (rust-lang/book#3975)

## rust-lang/edition-guide

4 commits in 5454de3d12b9ccc6375b629cf7ccda8264640aac..aeeb287d41a0332c210da122bea8e0e91844ab3e
2024-08-06 21:16:24 UTC to 2024-07-29 21:41:36 UTC

- Stabilize unsafe extern blocks (rust-lang/edition-guide#313)
- Add chapter for Lifetime Capture Rules 2024 (rust-lang/edition-guide#316)
- 2024: Add page for missing_fragment_specifier (rust-lang/edition-guide#315)
- Add documentation for 2024 prelude migration. (rust-lang/edition-guide#314)

## rust-lang/nomicon

3 commits in 0ebdacadbda8ce2cd8fbf93985e15af61a7ab895..6ecf95c5f2bfa0e6314dfe282bf775fd1405f7e9
2024-08-11 16:55:29 UTC to 2024-08-09 23:25:22 UTC

- Stabilize `min_exhaustive_patterns` (rust-lang/nomicon#445)
- repr(int) enums: both size and sign matter (rust-lang/nomicon#458)
- Update what-unsafe-does.md (rust-lang/nomicon#457)

## rust-lang/reference

6 commits in 2e191814f163ee1e77e2d6094eee4dd78a289c5b..62cd0df95061ba0ac886333f5cd7f3012f149da1
2024-08-11 21:06:12 UTC to 2024-07-30 06:34:03 UTC

- Reformat (and only reformat) the inline assembly chapter (rust-lang/reference#1550)
- Changes for unsafe extern blocks (RFC 3484) (rust-lang/reference#1536)
- Stabilize Wasm relaxed SIMD (rust-lang/reference#1421)
- Remove custom blockquote styling (rust-lang/reference#1547)
- Fix std-links for generics with commas. (rust-lang/reference#1549)
- Add details on how names are introduced. (rust-lang/reference#1052)

## rust-lang/rust-by-example

3 commits in 89aecb6951b77bc746da73df8c9f2b2ceaad494a..8f94061936e492159f4f6c09c0f917a7521893ff
2024-08-06 17:25:35 UTC to 2024-07-16 20:58:25 UTC

- Update lifetime_bounds.md (rust-lang/rust-by-example#1869)
- Remove the link to Japanese translation (rust-lang/rust-by-example#1868)
- Add an example of implementing the FromStr trait for Circles. (rust-lang/rust-by-example#1865)

## rust-lang/rustc-dev-guide

12 commits in 0c4d55cb59fe440d1a630e4e5774d043968edb3f..43d83780db545a1ed6d45773312fc578987e3968
2024-08-08 17:54:27 UTC to 2024-07-19 07:15:12 UTC

- Added 'the' in chapter "Running test" subtitle "Run unit tests on the compiler/library" (rust-lang/rustc-dev-guide#2040)
- Correct rust code block in *Dataflow Analysis* (rust-lang/rustc-dev-guide#2037)
- linkcheck: fix filtering of the source files (rust-lang/rustc-dev-guide#2019)
- chore: fix some comments (rust-lang/rustc-dev-guide#2028)
- linkcheck: fix reported broken links (part 2) (rust-lang/rustc-dev-guide#2024)
- typo (rust-lang/rustc-dev-guide#2029)
- Fix broken links in `llvm-coverage-instrumentation.md` (rust-lang/rustc-dev-guide#2027)
- Fix invalid link to toolstate documentation (rust-lang/rustc-dev-guide#2021)
- linkcheck: fix reported broken links (part 1) (rust-lang/rustc-dev-guide#2022)
- fix link (rust-lang/rustc-dev-guide#2020)
- MIR docs: fix borked links and update style (rust-lang/rustc-dev-guide#2017)
- Update adding.md (rust-lang/rustc-dev-guide#2016)
rust-timer added a commit to rust-lang-ci/rust that referenced this pull request Aug 15, 2024
Rollup merge of rust-lang#129015 - rustbot:docs-update, r=ehuss

Update books

## rust-lang/book

7 commits in 67fa536768013d9d5a13f3a06790521d511ef711..04bc1396bb857f35b5dda1d773c9571e1f253304
2024-07-31 13:19:44 UTC to 2024-07-16 18:18:38 UTC

- mdbook-trpl-listing: Add missing elided lifetimes (rust-lang/book#3995)
- infra: include ghp-import and git push in generate-preview script (rust-lang/book#3998)
- infra: add robots.txt for GH Pages previews (rust-lang/book#3997)
- Clarify function definitions vs. expressions (rust-lang/book#3870)
- infra: fix some shellcheck issues in CI config (rust-lang/book#3988)
- infra: support test renderer in mdbook preprocessors (rust-lang/book#3982)
- Improve handling of `<Listing>`s (rust-lang/book#3975)

## rust-lang/edition-guide

4 commits in 5454de3d12b9ccc6375b629cf7ccda8264640aac..aeeb287d41a0332c210da122bea8e0e91844ab3e
2024-08-06 21:16:24 UTC to 2024-07-29 21:41:36 UTC

- Stabilize unsafe extern blocks (rust-lang/edition-guide#313)
- Add chapter for Lifetime Capture Rules 2024 (rust-lang/edition-guide#316)
- 2024: Add page for missing_fragment_specifier (rust-lang/edition-guide#315)
- Add documentation for 2024 prelude migration. (rust-lang/edition-guide#314)

## rust-lang/nomicon

3 commits in 0ebdacadbda8ce2cd8fbf93985e15af61a7ab895..6ecf95c5f2bfa0e6314dfe282bf775fd1405f7e9
2024-08-11 16:55:29 UTC to 2024-08-09 23:25:22 UTC

- Stabilize `min_exhaustive_patterns` (rust-lang/nomicon#445)
- repr(int) enums: both size and sign matter (rust-lang/nomicon#458)
- Update what-unsafe-does.md (rust-lang/nomicon#457)

## rust-lang/reference

6 commits in 2e191814f163ee1e77e2d6094eee4dd78a289c5b..62cd0df95061ba0ac886333f5cd7f3012f149da1
2024-08-11 21:06:12 UTC to 2024-07-30 06:34:03 UTC

- Reformat (and only reformat) the inline assembly chapter (rust-lang/reference#1550)
- Changes for unsafe extern blocks (RFC 3484) (rust-lang/reference#1536)
- Stabilize Wasm relaxed SIMD (rust-lang/reference#1421)
- Remove custom blockquote styling (rust-lang/reference#1547)
- Fix std-links for generics with commas. (rust-lang/reference#1549)
- Add details on how names are introduced. (rust-lang/reference#1052)

## rust-lang/rust-by-example

3 commits in 89aecb6951b77bc746da73df8c9f2b2ceaad494a..8f94061936e492159f4f6c09c0f917a7521893ff
2024-08-06 17:25:35 UTC to 2024-07-16 20:58:25 UTC

- Update lifetime_bounds.md (rust-lang/rust-by-example#1869)
- Remove the link to Japanese translation (rust-lang/rust-by-example#1868)
- Add an example of implementing the FromStr trait for Circles. (rust-lang/rust-by-example#1865)

## rust-lang/rustc-dev-guide

12 commits in 0c4d55cb59fe440d1a630e4e5774d043968edb3f..43d83780db545a1ed6d45773312fc578987e3968
2024-08-08 17:54:27 UTC to 2024-07-19 07:15:12 UTC

- Added 'the' in chapter "Running test" subtitle "Run unit tests on the compiler/library" (rust-lang/rustc-dev-guide#2040)
- Correct rust code block in *Dataflow Analysis* (rust-lang/rustc-dev-guide#2037)
- linkcheck: fix filtering of the source files (rust-lang/rustc-dev-guide#2019)
- chore: fix some comments (rust-lang/rustc-dev-guide#2028)
- linkcheck: fix reported broken links (part 2) (rust-lang/rustc-dev-guide#2024)
- typo (rust-lang/rustc-dev-guide#2029)
- Fix broken links in `llvm-coverage-instrumentation.md` (rust-lang/rustc-dev-guide#2027)
- Fix invalid link to toolstate documentation (rust-lang/rustc-dev-guide#2021)
- linkcheck: fix reported broken links (part 1) (rust-lang/rustc-dev-guide#2022)
- fix link (rust-lang/rustc-dev-guide#2020)
- MIR docs: fix borked links and update style (rust-lang/rustc-dev-guide#2017)
- Update adding.md (rust-lang/rustc-dev-guide#2016)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants