public inbox for docs@lists.yoctoproject.org
 help / color / mirror / Atom feed
From: Antonin Godard <antonin.godard@bootlin.com>
To: docs@lists.yoctoproject.org
Cc: Thomas Petazzoni <thomas.petazzoni@bootlin.com>,
	 Quentin Schulz <quentin.schulz@cherry.de>,
	 Antonin Godard <antonin.godard@bootlin.com>
Subject: [PATCH 5/8] Makefile: wrap set_versions.py with flock
Date: Mon, 22 Dec 2025 13:27:51 +0100	[thread overview]
Message-ID: <20251222-concurrent-safety-v1-5-e3d86e44cd38@bootlin.com> (raw)
In-Reply-To: <20251222-concurrent-safety-v1-0-e3d86e44cd38@bootlin.com>

The set_versions.py script modified files in the source directory. To
improve concurrent docs builds, wrap the set_versions.py with flock,
with a 30 seconds timeout.

Signed-off-by: Antonin Godard <antonin.godard@bootlin.com>
---
 documentation/.gitignore | 1 +
 documentation/Makefile   | 8 ++++----
 2 files changed, 5 insertions(+), 4 deletions(-)

diff --git a/documentation/.gitignore b/documentation/.gitignore
index b23d598054..a5a5efc19c 100644
--- a/documentation/.gitignore
+++ b/documentation/.gitignore
@@ -9,3 +9,4 @@ releases.rst
 */svg/*.pdf
 styles/*
 !styles/config
+set-versions.lock
diff --git a/documentation/Makefile b/documentation/Makefile
index 5f84a93e32..fe49d74cc6 100644
--- a/documentation/Makefile
+++ b/documentation/Makefile
@@ -50,7 +50,7 @@ PNGs := $(foreach dir, $(IMAGEDIRS), $(patsubst %.svg,%.png,$(wildcard $(SOURCED
 	$(SVG2PNG) --format=png --output=$@ $<
 
 clean:
-	@rm -rf $(BUILDDIR) $(PNGs) $(PDFs) poky.yaml sphinx-static/switchers.js releases.rst
+	@rm -rf $(BUILDDIR) $(PNGs) $(PDFs) poky.yaml sphinx-static/switchers.js releases.rst set-versions.lock
 
 checks:
 	$(SOURCEDIR)/tools/check-glossaries --docs-dir $(SOURCEDIR)
@@ -63,14 +63,14 @@ sphinx-lint:
 	sphinx-lint $(SPHINXLINTDOCS)
 
 epub: $(PNGs)
-	$(SOURCEDIR)/set_versions.py
+	flock -w 30 "$(SOURCEDIR)"/set-versions.lock -c $(SOURCEDIR)/set_versions.py
 	@$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
 
 # Note: we need to pass buf_size here (which is also configurable from
 # texmf.cnf), to avoid following error:
 #   Unable to read an entire line---bufsize=200000. Please increase buf_size in texmf.cnf.
 latexpdf: $(PDFs)
-	$(SOURCEDIR)/set_versions.py
+	flock -w 30 "$(SOURCEDIR)"/set-versions.lock -c $(SOURCEDIR)/set_versions.py
 	buf_size=10000000 $(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
 
 all: html epub latexpdf
@@ -78,5 +78,5 @@ all: html epub latexpdf
 # Catch-all target: route all unknown targets to Sphinx using the new
 # "make mode" option.  $(O) is meant as a shortcut for $(SPHINXOPTS).
 %:
-	$(SOURCEDIR)/set_versions.py
+	flock -w 30 "$(SOURCEDIR)"/set-versions.lock -c $(SOURCEDIR)/set_versions.py
 	@$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)

-- 
2.51.0



  parent reply	other threads:[~2025-12-22 12:28 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-12-22 12:27 [PATCH 0/8] Parallel docs build improvements Antonin Godard
2025-12-22 12:27 ` [PATCH 1/8] tools/build-docs-container: guarantee the image to run matches the just-built image Antonin Godard
2025-12-22 12:27 ` [PATCH 2/8] Makefile: allow to specify build directory Antonin Godard
2025-12-22 12:27 ` [PATCH 3/8] tools/build-docs-container: build in separate directory for each distro Antonin Godard
2025-12-22 12:27 ` [PATCH 4/8] tools/build-docs-container: create symlink to latest build output Antonin Godard
2026-01-12 11:24   ` Quentin Schulz
2025-12-22 12:27 ` Antonin Godard [this message]
2026-01-12 11:40   ` [docs] [PATCH 5/8] Makefile: wrap set_versions.py with flock Quentin Schulz
2025-12-22 12:27 ` [PATCH 6/8] tools/build-docs-container: allow running non-interactively Antonin Godard
2026-01-12 11:43   ` Quentin Schulz
2025-12-22 12:27 ` [PATCH 7/8] tools/build-docs-container: allow passing extra args to $OCI run Antonin Godard
2026-01-12 13:20   ` Quentin Schulz
2025-12-22 12:27 ` [PATCH 8/8] tools/build-docs-container: make it possible to print the distro list Antonin Godard
2026-01-12 13:25   ` Quentin Schulz
2026-01-09 17:06 ` [PATCH 0/8] Parallel docs build improvements Quentin Schulz

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20251222-concurrent-safety-v1-5-e3d86e44cd38@bootlin.com \
    --to=antonin.godard@bootlin.com \
    --cc=docs@lists.yoctoproject.org \
    --cc=quentin.schulz@cherry.de \
    --cc=thomas.petazzoni@bootlin.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox