Skip to content

docs(build): stage translated images atomically to fix a -j race - #4368

Merged
BsAtHome merged 1 commit into
LinuxCNC:masterfrom
grandixximo:fix/docs-image-stage-race
Aug 9, 2026
Merged

docs(build): stage translated images atomically to fix a -j race#4368
BsAtHome merged 1 commit into
LinuxCNC:masterfrom
grandixximo:fix/docs-image-stage-race

Conversation

@grandixximo

Copy link
Copy Markdown
Contributor

Fixes a rare parallel-build failure seen in CI package-indep (cp: cannot create regular file '.../de/drivers/images/GM_ENDSWpinout.png': File exists).

.adoc-images-stamp and the per-file TRANSLATED_IMAGE_RULE both stage the same translated images, and under -j two cp -f calls on the same destination intermittently fail with EEXIST (reproduced locally with parallel cp loops: 5 failures in 10000 ops). Both recipes now copy to a unique mktemp file and mv -f atomically, with chmod 644 to restore the permissions plain cp produced (mktemp creates 600).

Verified with full translated docs builds: all images stage at 644, no leftover temp files.

.adoc-images-stamp and the per-file TRANSLATED_IMAGE_RULE both stage the
same translated images, and under parallel make two cp -f calls on the
same destination intermittently fail with "cannot create regular file:
File exists".  Seen in CI package-indep on PR LinuxCNC#4367
(de/drivers/images/GM_ENDSWpinout.png).

Stage via mktemp + mv -f instead: the rename is atomic so concurrent
stagers can no longer produce EEXIST, and chmod 644 restores the
permissions plain cp used to give the new file (mktemp makes 600).
@BsAtHome
BsAtHome merged commit 1313b7e into LinuxCNC:master Aug 9, 2026
16 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants