fix(tools): resolve documentation links as repository paths on Windows #1254
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/1254"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Imported from boykopovar/AnyPS5. Originally posted by popcoder565 on 2026-10-07T19:55:17Z.
What
tools/check_conventions.pynormalized link targets withos.path.normpath, which returns backslash paths on Windows. Every relative link added to a Markdown file then failed thedoc-linkcheck ("Relative link to a file that does not exist"), andlisted()compares the same resolved paths, so a silent stub listed in TechnicalDebt was not found on Windows either. Links are repository-relative POSIX paths, so they are now normalized withposixpath.normpath. On Linux the result is unchanged, asos.pathisposixpaththere. For the same reason CI cannot catch this bug: the Conventions job runs on Linux, so the falsedoc-linkerrors only appear when the check is run on Windows, as CONTRIBUTING asks before pushing.Tested
Windows 10 (19045), Python 3.13.9.
python tools/check_conventions.py --base origin/mainreported adoc-linkerror before this change and passes with it.docs/dev/TechnicalDebt.md,links()resolves../../core/shader/recompiler/Recompiler.cpp,../user/USAGE.md#buildand/README.mdtocore/shader/recompiler/Recompiler.cpp,docs/user/USAGE.mdandREADME.md, andlisted()finds a stub named on a TechnicalDebt line that links its file.Checklist
main; no other open PR implements the same functionsNotImplemented_nid_no_patch); silent stubs are listed in TechnicalDebt.mdfiles or images added to the repository (attach them to this PR)Imported from boykopovar/AnyPS5. Originally posted by Dextroid17 on 2026-10-07T20:27:23Z.
Verified this one, and the substitution is right — with a caveat worth writing down, because no CI here can see the bug.
links()resolves a documentation link against the file's directory, and the result is compared against the repository's own file list (tools/check_conventions.py:148,resolved not in self.tree). On Windowsos.pathisntpath, so onmainthe resolved path comes back with backslashes while the tree holds POSIX paths, and every relative link reads as missing:On the Linux runner
os.path is posixpathanswersTrue, which is exactly why the conventions job is green either way and why this never surfaced.What I did not do: I could not drive the real function under Windows semantics from here to show the end-to-end failure, because on Linux
os.pathisposixpath— rebinding one rebinds both, and a test written that way passes on both versions. So the evidence is the substitution itself plus the comparison at line 148, not a run on Windows. Saying that rather than implying a test I did not do.The change is a no-op on Linux, so it needs no test — but a sentence in the body recording why (Linux
os.path is posixpath, so CI cannot catch this) would help whoever wonders next.Imported from boykopovar/AnyPS5. Originally posted by popcoder565 on 2026-10-07T20:52:12Z.
Thanks for checking. I added that to the description: the Conventions job runs on Linux, where os.path is posixpath, so CI can’t catch this. The false doc-link errors only show up when the check runs on Windows.