docs: tolerate stray whitespace in .so manpage aliases#4175
Conversation
|
@BsAtHome just wanted your eyes on this for a moment, is this the right fix? |
|
This is handling a symptom and not the cause. You may want to fix the translation instead. |
|
Agreed, fix the cause. I corrected the two German NAME strings in Weblate, so the immediate breakage is gone. But that does not stop the next translator reintroducing it. Root problem: a A |
1096e63 to
b6cbe00
Compare
A .so alias stub is a language-invariant redirect (just a path). asciidoctor emits these stubs as a byproduct of rendering a translated primary page, deriving the path from the translated NAME line, so a stray space in a translation can break the alias and abort the htmldocs build. Overwrite every translated stub with the canonical English one, after the primaries that emit them are built. The stub list is found at recipe time because the wildcard-based MAN_SRCS is empty on a clean build.
b6cbe00 to
5fab66d
Compare
A
.soalias stub is a redirect manpage with no prose: its body is just a path to the page it aliases, identical in every language. asciidoctor emits these stubs as a byproduct when it renders a translated primary page whose NAME line lists several functions, deriving the path from the translated NAME line. A stray space in the translation (name , otherinstead ofname, other) then lands in the path, producing a broken alias that aborts thehtmldocsbuild vialang_switcher_postprocess.py.Rather than trusting translated text for a structural path, this generates the translated
.sostubs from the canonical English original: once the translated primaries are built, every translated stub is overwritten with the English one. This fixes the roff page too (not just the HTML symlink) and removes the only path by which a translation can break the build.Seen in practice: the German build produced
de/man3/hal_del_funct_from_thread.3containing.so hal_add_funct_to_thread .3, from a space before the comma in the translated NAME line (hal_add_funct_to_thread , hal_del_funct_from_thread). The two affected German NAME strings have since been corrected in Weblate; this build change makes any future occurrence harmless.Verified on a full 8-language build: clean build with 0 malformed stubs and 0 dangling symlinks, and a second build is a no-op.