Skip to content

Possible bug: duplicate rST hyperlink targets don't appear to emit a warning during project processing? #13383

Open
@jayaddison

Description

@jayaddison

Describe the bug

This is observed from a build of the Linux kernel documentation in Arch Linux; relevant diffoscope output can be found here: https://reproducible.archlinux.org/api/v0/builds/740203/diffoscope

It seems that sometimes the hyperlink href (destination) included in the HTML output for a document may resolve to a different document, despite a local declaration of the target (in the RST source).

This is visible as a diff in the output quickly-build-trimmed-linux.html HTML file as:

│ ├── usr/lib/modules/6.13.3-arch1-1/build/Documentation/admin-guide/quickly-build-trimmed-linux.html
│ │┄ 'html2text' not available in path.
│ │ @@ -1172,15 +1172,15 @@
│ │  guide would defeat its purpose, as without such a focus you would need dozens or
│ │  hundreds of constructs along the lines of ‘in case you are having <insert
│ │  machine or distro>, you at this point have to do <this and that>
│ │  <instead|additionally>’. Each of which would make the text longer, more
│ │  complicated, and harder to follow.</p>
│ │  <p>That being said: this of course is a balancing act. Hence, if you think an
│ │  additional use-case is worth describing, suggest it to the maintainers of this
│ │ -document, as <a class="reference internal" href="#submit-improvements"><span class="std std-ref">described above</span></a>.</p>
│ │ +document, as <a class="reference internal" href="verify-bugs-and-bisect-regressions.html#submit-improvements"><span class="std std-ref">described above</span></a>.</p>
│ │  </section>
│ │  </section>
│ │  </section>
│ │  
│ │  
│ │            </div>

One characteristic of the problem link is that it is declared locally within quickly-build-trimmed-linux.rst -- but also, separately within the verify-bugs-and-bisect-regressions.rst file that the referencing link sometimes mistakenly resolves to.

I believe this problem was previously identified as one of I think three non-determinism problems reported in #6714 (we fixed one of those, another remains open, and the item I'm reporting again here seems untracked).

A workaround could be to remove the ambiguity in the kernel documentation, and that may be straightforward to do. Even so, I think this may be a bug in Sphinx.

cc @bmwiedemann
cc @kpcyrd

How to Reproduce

TBD

Environment Information

Platform:              linux; (Arch Linux; precise version TBD)
Python version:        3.13.2 (precise version TBD)
Python implementation: CPython
Sphinx version:        8.1.3
Docutils version:      0.21.2
Jinja2 version:        3.1.5
Pygments version:      2.19.1

Sphinx extensions

extensions = ['kerneldoc', 'rstFlatTable', 'kernel_include',
              'kfigure', 'sphinx.ext.ifconfig', 'automarkup',
              'maintainers_include', 'sphinx.ext.autosectionlabel',
              'kernel_abi', 'kernel_feat', 'translations']

Additional context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions