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 marks local links broken when they reference files produced later, during in HTML building #9383

Open
tuukkamustonen opened this issue Jun 28, 2021 · 1 comment

Comments

@tuukkamustonen
Copy link

tuukkamustonen commented Jun 28, 2021

Describe the bug

After #5208 sphinx-build -b linkcheck is now checking links to local files, too. That was released in Sphinx 3.2.0.

However, it generates false positives in certain cases.

To Reproduce

As in:

.. figure:: architecture.png
   :target: ../_images/architecture.png

Target (../_images/architecture.png) exists and works correctly in the rendered HTML, but link checker marks it as failure.

@tk0miya commented at #5208 (comment):

The target file will be available only on building HTML. Because the files under _images are copied by HTML builder. It means they're not available on linkcheck. It's like a chicken-and-egg problem.

Expected behavior

Sphinx should not mark the link as broken.

Environment info

  • OS: Linux
  • Python version: 3.7.10
  • Sphinx version: 3.5.4
  • Sphinx extensions: n/a
  • Extra tools: n/a
@staticdev
Copy link

@tk0miya I tried to give my first contribution to sphinx on this issue. I was able to debug and understand the problem. But the solution is not clear to me because of your comment of chicken-egg problem. What is the impact of changing the order to run linkcheck AFTER the build files are generated?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants