fix: link a build file only where it is recorded

Every source link on the site leads to a path the source record saw at
a commit. The Build file row linked pin_build files unchecked, eight of
them at commits the record did not hold. build_source_paths now records
the build files read at a commit, and the row links only those: a tag
can move and stays plain text. The record run also picked up two cited
paths it had not seen before (pom2 CMakeLists.txt, pcem configure.ac).
This commit is contained in:
Abdessamad Derraz committed 2026-11-06 09:14:42 +01:00
1 parent ef6607302d
commit 856cb5618f
4 files changed
+64 -9

No files matched your search

+8 -5
View File
@@ -8198,17 +8198,20 @@ def _exact_size(size: int) -> str:
def _build_file_links(pin_build: list[dict]) -> list[str]:
"""Each platform build file that holds the revision, linked at the
revision it was read at. The prose of pin_frozen named the file as
plain text, while pin_build carries all a pinned link needs."""
from sitesources import _browse_repo, _source_permalink # noqa: PLC0415
commit it was read at when the source record holds it. The prose of
pin_frozen named the file as plain text."""
from sitesources import _browse_repo, _source_permalink, tree_holds # noqa: PLC0415
links = []
for build in pin_build:
repo = _browse_repo(str(build["repo"]))
path = str(build["path"])
revision = str(build["revision"])
text = f"{_escape_tags(_platform_display(str(build['platform'])))} {_code(path)}"
if repo is not None:
text = f"[{text}]({_source_permalink(repo, str(build['revision']), path, None, None)})"
# Linked where the record saw the file at that commit, as every
# source link is: a tag can move, and is never recorded.
if repo is not None and tree_holds(repo, revision, path):
text = f"[{text}]({_source_permalink(repo, revision, path, None, None)})"
links.append(f"{text} at {_code(str(build['revision']))} sets {_code(str(build['variable']))}")
return links