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

Document that linkcheck only looks at modified files when running locally #1034

Open
guswynn opened this issue Jan 22, 2021 · 5 comments
Open
Labels
A-linkcheck Area: linkcheck C-CI Category: CI for this repo E-needs-investigation Call for participation: this issue needs further investigation E-needs-writeup Call for participation: discussion can be written up without much research required

Comments

@guswynn
Copy link
Contributor

guswynn commented Jan 22, 2021

when i run
RUST_LOG=trace mdbook build
I get:

2021-01-22 08:35:53 [WARN] (mdbook::renderer): Renderer command `../../ci/linkcheck.sh`
uses a path relative to the renderer output directory `/Users/azw/repos/rustc-dev-guide/book/linkcheck`. This was previously accepted, but has been deprecated. Relative executable paths should be relative to the book root.
Checking files changed in master...: src/about-this-guide.md src/contributing.md src/git.md
[2021-01-22T16:35:53Z DEBUG mdbook_linkcheck] Loading cache from /Users/azw/repos/rustc-dev-guide/book/linkcheck/cache.json
[2021-01-22T16:35:53Z INFO  mdbook_linkcheck] Started the link checker
[2021-01-22T16:35:53Z DEBUG mdbook_linkcheck] Selected file: Some(["src/about-this-guide.md", "src/contributing.md", "src/git.md"])
[2021-01-22T16:35:53Z TRACE mdbook_linkcheck] Config {
[2021-01-22T16:35:53Z TRACE mdbook_linkcheck]     follow_web_links: true,
[2021-01-22T16:35:53Z TRACE mdbook_linkcheck]     traverse_parent_directories: false,
[2021-01-22T16:35:53Z TRACE mdbook_linkcheck]     exclude: [
[2021-01-22T16:35:53Z TRACE mdbook_linkcheck]         HashedRegex {
[2021-01-22T16:35:53Z TRACE mdbook_linkcheck]             string: "crates\\.io",
[2021-01-22T16:35:53Z TRACE mdbook_linkcheck]             re: crates\.io,
[2021-01-22T16:35:53Z TRACE mdbook_linkcheck]         },
[2021-01-22T16:35:53Z TRACE mdbook_linkcheck]         HashedRegex {
[2021-01-22T16:35:53Z TRACE mdbook_linkcheck]             string: "gcc\\.godbolt\\.org",[2021-01-22T16:35:53Z TRACE mdbook_linkcheck]             re: gcc\.godbolt\.org,
[2021-01-22T16:35:53Z TRACE mdbook_linkcheck]         },
[2021-01-22T16:35:53Z TRACE mdbook_linkcheck]         HashedRegex {
[2021-01-22T16:35:53Z TRACE mdbook_linkcheck]             string: "youtube\\.com",
[2021-01-22T16:35:53Z TRACE mdbook_linkcheck]             re: youtube\.com,
[2021-01-22T16:35:53Z TRACE mdbook_linkcheck]         },
[2021-01-22T16:35:53Z TRACE mdbook_linkcheck]         HashedRegex {
[2021-01-22T16:35:53Z TRACE mdbook_linkcheck]             string: "youtu\\.be",
[2021-01-22T16:35:53Z TRACE mdbook_linkcheck]             re: youtu\.be,
[2021-01-22T16:35:53Z TRACE mdbook_linkcheck]         },
[2021-01-22T16:35:53Z TRACE mdbook_linkcheck]         HashedRegex {
[2021-01-22T16:35:53Z TRACE mdbook_linkcheck]             string: "dl\\.acm\\.org",
[2021-01-22T16:35:53Z TRACE mdbook_linkcheck]             re: dl\.acm\.org,
[2021-01-22T16:35:53Z TRACE mdbook_linkcheck]         },
[2021-01-22T16:35:53Z TRACE mdbook_linkcheck]         HashedRegex {
[2021-01-22T16:35:53Z TRACE mdbook_linkcheck]             string: "cs\\.bgu\\.ac\\.il",
[2021-01-22T16:35:53Z TRACE mdbook_linkcheck]             re: cs\.bgu\.ac\.il,
[2021-01-22T16:35:53Z TRACE mdbook_linkcheck]         },
[2021-01-22T16:35:53Z TRACE mdbook_linkcheck]         HashedRegex {
[2021-01-22T16:35:53Z TRACE mdbook_linkcheck]             string: "www\\.amazon\\.com",
[2021-01-22T16:35:53Z TRACE mdbook_linkcheck]             re: www\.amazon\.com,
[2021-01-22T16:35:53Z TRACE mdbook_linkcheck]         },
[2021-01-22T16:35:53Z TRACE mdbook_linkcheck]         HashedRegex {
[2021-01-22T16:35:53Z TRACE mdbook_linkcheck]             string: "www\\.rustaceans\\.org",
[2021-01-22T16:35:53Z TRACE mdbook_linkcheck]             re: www\.rustaceans\.org,
[2021-01-22T16:35:53Z TRACE mdbook_linkcheck]         },
[2021-01-22T16:35:53Z TRACE mdbook_linkcheck]         HashedRegex {
[2021-01-22T16:35:53Z TRACE mdbook_linkcheck]             string: "play\\.rust-lang\\.org",
[2021-01-22T16:35:53Z TRACE mdbook_linkcheck]             re: play\.rust-lang\.org,
[2021-01-22T16:35:53Z TRACE mdbook_linkcheck]         },
[2021-01-22T16:35:53Z TRACE mdbook_linkcheck]     ],
[2021-01-22T16:35:53Z TRACE mdbook_linkcheck]     user_agent: "mdbook-linkcheck-0.7.2",
[2021-01-22T16:35:53Z TRACE mdbook_linkcheck]     cache_timeout: 86400,
[2021-01-22T16:35:53Z TRACE mdbook_linkcheck]     warning_policy: Error,
[2021-01-22T16:35:53Z TRACE mdbook_linkcheck]     http_headers: {},
[2021-01-22T16:35:53Z TRACE mdbook_linkcheck] }
[2021-01-22T16:35:53Z INFO  mdbook_linkcheck] Scanning book for links
[2021-01-22T16:35:53Z INFO  mdbook_linkcheck] Found 0 links (0 incomplete links)
[2021-01-22T16:35:53Z TRACE mio::sys::unix::kqueue] registering; token=Token(18446744073709551615); interests=Readable
[2021-01-22T16:35:53Z TRACE mio::poll] registering with poller
[2021-01-22T16:35:53Z DEBUG mdbook_linkcheck] Saving the cache to /Users/azw/repos/rustc-dev-guide/book/linkcheck/cache.json
[2021-01-22T16:35:53Z INFO  mdbook_linkcheck] No broken links found
2021-01-22 08:35:53 [TRACE] (mdbook::renderer): ../../ci/linkcheck.sh exited with output: ExitStatus(ExitStatus(0))

which says it found no links in the book at all. Separately, when i manually run
RUST_LOG=trace mdbook-linkcheck -f src/git.md book or RUST_LOG=trace ../../ci/linkcheck.s it just hangs? Have I set up my local instance incorrectly? I think its very curious that it seems to be running the same thing

if I remove the command = from the linkcheck section of the book.toml, linkcheck works, but I get the classic Server returned 429 Too Many Requests for for github as well as some other interesting errors

@guswynn
Copy link
Contributor Author

guswynn commented Jan 22, 2021

when I run mdbook-linkcheck --standalone -f src/git.md book/ it also finds no links. It appears that mdbook uses stdin to communicate some context to renderers, perhaps that is broken in linkcheck.sh

@jyn514
Copy link
Member

jyn514 commented Jan 22, 2021

@guswynn this is intentional, if we don't cache the changes then you always get 429. If you change a file, it should detect the change and look for dead links.

@jyn514
Copy link
Member

jyn514 commented Feb 9, 2021

@guswynn is there any change you think we could make here? Otherwise I don't see much point in keeping the issue open. Maybe we should document this in the readme?

@guswynn
Copy link
Contributor Author

guswynn commented Feb 9, 2021

@jyn514 documenting how it works would be great!

@jyn514 jyn514 added the E-needs-writeup Call for participation: discussion can be written up without much research required label Feb 9, 2021
@jyn514 jyn514 changed the title Linkcheck appears to not find any links Document that linkcheck only looks at modified files when running locally Mar 26, 2023
@marxin
Copy link
Contributor

marxin commented Jul 25, 2024

Please consider mentioning that linkcheck suffers from the following false positive warning when -f option is being used: Michael-F-Bryan/mdbook-linkcheck#86.

@jieyouxu jieyouxu added C-CI Category: CI for this repo A-linkcheck Area: linkcheck E-needs-investigation Call for participation: this issue needs further investigation labels Nov 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-linkcheck Area: linkcheck C-CI Category: CI for this repo E-needs-investigation Call for participation: this issue needs further investigation E-needs-writeup Call for participation: discussion can be written up without much research required
Projects
None yet
Development

No branches or pull requests

4 participants