Skip to content

fix warnings when linkcheck is disabled - #2989

Merged
jyn514 merged 1 commit into
rust-lang:mainfrom
jyn514:linkcheck-warnings
Sep 1, 2026
Merged

fix warnings when linkcheck is disabled#2989
jyn514 merged 1 commit into
rust-lang:mainfrom
jyn514:linkcheck-warnings

Conversation

@jyn514

@jyn514 jyn514 commented Aug 29, 2026

Copy link
Copy Markdown
Member

fixes #2808

@apiraino does this fix your problem? i believe those are just warnings and not hard errors, i would expect the output to still show up in book/html.

disclosure: the code and test were generated by an LLM. i wrote the comments.

@rustbot

rustbot commented Aug 29, 2026

Copy link
Copy Markdown
Collaborator

Thanks for the PR. If you have write access, feel free to merge this PR if it does not need reviews. You can request a review using r? rustc-dev-guide or r? <username>.

@rustbot rustbot added the S-waiting-on-review Status: this PR is waiting for a reviewer to verify its content label Aug 29, 2026
@apiraino

apiraino commented Sep 1, 2026

Copy link
Copy Markdown
Contributor

oh, I had forgot about this.

This change just hides the error, which is not exactly what I had in mind. I'd like to investigate why linkcheck2 or the linkcheck.sh script return this error.

@jyn514

jyn514 commented Sep 1, 2026

Copy link
Copy Markdown
Member Author

well, i don’t think it’s an error, it’s a warning. what’s happening is:

  1. mdbook spawns linkcheck and pipes the chapter to it on stdin
  2. linkcheck.sh decides it doesn’t need to check links, since this isn’t in CI. it exits without reading stdin.
  3. mdbook gets an EPIPE error and warns that the extension didn’t read stdin.

this makes sense for mdbook to do, the most likely thing that happened (from its perspective) is that linkcheck crashed. but for our use case, the warning is just noise.

@apiraino

apiraino commented Sep 1, 2026

Copy link
Copy Markdown
Contributor

hm, I see.

Also, why did you add an additional CI step building without checking links?

@jyn514

jyn514 commented Sep 1, 2026

Copy link
Copy Markdown
Member Author

Also, why did you add an additional CI step building without checking links?

because that's what reproduces this warning. the warning previously only happened when running locally.

@jyn514
jyn514 merged commit ee27449 into rust-lang:main Sep 1, 2026
2 checks passed
@rustbot rustbot removed the S-waiting-on-review Status: this PR is waiting for a reviewer to verify its content label Sep 1, 2026
@jyn514
jyn514 deleted the linkcheck-warnings branch September 1, 2026 10:27
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.

Can't build locally

3 participants