docs: pin manpage troff filename to the make target#4193
Conversation
|
@BsAtHome are we holding merges till sid is fixed? |
|
Hmm, due to you can detect wrong translations: It would make sense to fix (or remove) them and fail if it happens ever again. |
Currently only the independent doc package build fails. I was not at the dev-meeting yesterday, so I don't know whether the meeting took place or what was discussed. |
|
Agreed the warning is easy to miss in the build log, and detection without enforcement is weak. I would get to a hard gate in steps rather than flip to fail now:
One caveat for that to actually gate translations: Weblate currently lands both via PR and via direct branch merges (the recent So: warn now, clean Weblate, then a required standalone check. Same end state you are after, sequenced so we can merge today without wedging other PRs. |
|
You cannot enforce CI on weblate translations. People who translate do not usually look at CI. Translations are a tricky business and they are not well organized. It is also one-big-pile-of-text that is very hard to handle. Merges are ad-hoc and breaks are regular. It is hard to enforce structural changes to the translations as long as there is no real plan as how they are supposed to work and be organized. |
|
Fair, no enforcement then. Not a gate, a warning: a separate CI step runs the name check, never fails, and emits the mismatches as GitHub annotations plus a job-summary table. It shows up in the Checks tab instead of buried in the build log, and blocks nothing. Translators keep working as they do; whoever merges a weblate batch just gets a visible list of what drifted. That gives @hdiethelm the visibility without putting a gate on translations. Acceptable? |
|
Yes, that should be enough for now. |
6e26517 to
5f0cad1
Compare
|
Updated per the discussion, folded the CI warning in rather than opening another PR. The I fixed the current drift in Weblate, but that batch has not merged here yet, so the check will still flag those pages until the next Weblate sync lands. Since it only warns, that is harmless, and it shows the check doing its job in the meantime. |
5f0cad1 to
bab6d1e
Compare
|
I like your approach with CI workflow commands and the summary. But it's a bit much: BTW: Here is the doc how to do this if others want this to: https://docs.github.com/en/actions/reference/workflows-and-actions/workflow-commands |
asciidoctor names the troff from the page's NAME section, not the make target. po4a translates that NAME, so a translation that altered a command identifier (hm2_pktuart_read rendered as hm2_uart_read) misnames the troff; two pages then race for one output under -j, one going missing. Pass -o "$@" so the build graph sets each filename, produced once at its own name regardless of translation.
bab6d1e to
8dc405f
Compare
|
https://github.com/LinuxCNC/linuxcnc/actions/runs/27993036704 |
|
Looks nice! Not to much warnings, so you see the relevant ones and a good sumary. |
|
I did not look into translations yet, still new to linuxcnc. So you know probably better how much info is needed to fix it. It might be already good eneught. At least way better than before, a lot was broken and no one took notice. To much code has always the issue that someone needs to maintain and fix it sometimes in the future. |
|
Ok, why not. The example above would be hard to spot manually. |
|
I'm not sure I like it that much, it works.... Edit: |
f6fe989 to
91a8850
Compare
Very informative list of mismatches. Most, if not all, you'd not need to know the language to fix the translation. BTW, why is the dash vs em-dash a problem? Is there some processing step that can't handle it? It might have been introduced by auto- or assisted-translation. |
|
asciidoctor's manpage backend derives the page name by splitting the NAME line on the literal ASCII " - ". An em-dash or en-dash is not that separator, so it folds the volume into the name ( |
91a8850 to
7374946
Compare
|
I simplified the columns, I think the "search" col is all you really need to find it in weblate, and the "current" col is just to confirm what we see on this end, I already fixed all 65 warning in weblate, will have to wait for next weblate cycle to see if we get more, or if I missed any. I'm happy with it now 😊 |
After the doc build, scripts/manpage-name-check.py scans the built man tree for pages whose rendered .TH name disagrees with their filename, the sign of a translated NAME line that drifted from the command identifier. Quiet when nothing drifted. When something has, it prints each page with the string to search in Weblate and its current value side by side, so the output is a ready worklist. Never fails the build: in CI it writes that list to the job summary and emits one warning pointing at it. The NAME lines are managed in Weblate, so fixes go there.
7374946 to
d91856b
Compare

Reported by @hdiethelm in #4178, where a translated man page rendered with the content of a sibling page and a rerun changed which page was affected.
Problem
asciidoctor's manpage backend names its output file from the page's
== NAMEsection, not from the make target it was invoked for. The troff rule passed--destination-dirand trusted asciidoctor to pick the name. For the translated manpages that NAME line goes through po4a, so a translation that altered the command identifier redirected the troff to the wrong filename:de/.../hm2_pktuart_read.3.adocthen renders to a file namedhm2_uart_read.3, colliding with the realhm2_uart_readpage. Under-jthe two recipes race for one output: the loser is never written, the winner is nondeterministic, so a rerun changes which page is corrupted.Fix
Pass
-o "$@"so the build graph, not the page text, decides each filename. Every target is produced exactly once at its own name, regardless of translation state. A wrong translation can still make a page's visible text wrong, but it can no longer misname a file, race, or drop a page.NAME drift is still worth seeing, but the build is the wrong place to surface it (it disappears in the build log). So
scripts/manpage-name-check.pyscans the built man tree after the doc build and reports any page whose rendered.THname disagrees with its filename. It is quiet when nothing drifted. When something has, it prints each page with the exact string to search in Weblate and its current value side by side, so the list is a ready worklist. It never fails the build: in CI it writes that same list to the job summary and emits one warning pointing at it (rather than one annotation per page). The NAME lines are translatable strings managed in Weblate, so fixes go there. The check is a convenience for translation cleanup, not load-bearing, so it is easy to drop or fold into the build later if maintainers prefer.Verification
Full configured doc build with translations (
--enable-build-documentation --enable-build-documentation-translation), po4a over all languages, German built through to HTML, then built a second time:hm2_uart_read/hm2_pktuart_read,hm2_bspi_set_read/set_write,rtapi_stdint/rtapi_string) are all produced as distinct troff with the correct title, and the man HTML renders.Nothing to be done), which also confirms no target is left missing and po4a is not re-run.manpage-name-check.pyover the built tree flags the drifted translated pages and is silent on the English tree.Companion to #4175, which covers the same defect on the other output: that PR fixes the
.soalias stubs of multi-name pages; this fixes the primary page filename. They are independent and land in parallel.