mirror of
https://github.com/kevinveenbirkenbach/computer-playbook.git
synced 2026-11-08 11:46:35 +00:00
Sphinx's i18n transform parses every msgstr into a temporary document whose settings carry the whole BuildEnvironment (sphinx/transforms/ i18n.py, Sphinx 9.2). MyST nodes patched into the page keep pointing at that document, and write_doctree only detaches the environment from the page's own settings, so every translated Markdown page was pickled with a full environment copy: a German doctree of drv-lid-switch grew from 21 KB to 5.5 MB, the whole doctree tree from 95 MB to 2.5 GB. The write phase loads them all back and the forked -j worker copies the parent, so the `deployed:de` build reached 5+ GB in the parent and was OOM-killed inside the docs container in CI run 40625679270 (Jenkins#1, Nextcloud#11), drove shared 16 GB swarm runners into swap and the watchdog's memory and I/O-wedge aborts (GitLab#2, Nextcloud#7/#9/#10), and left the daemon answering 500 to the queue task for the failed build. AdoptTranslatedNodes runs right after the Locale transform and points every node whose document is not the page back at the page; conf.py loads it for every build the image runs. No size, limit or budget changes, and docs stays deployed wherever a variant declares it. Measured locally on the full German build at -j 2: parent peak 685 MB (was 5.3 GB and climbing when stopped at about a quarter of the write phase), total 2.4 GB (was 8.35 GB), doctrees 92 MB (was 2.5 GB). The English HTML of all 5,373 pages is byte-identical before and after. A real German MyST build in the new test finds no foreign nodes and no BuildEnvironment in the saved page; without the transform it fails. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>