From patchwork Thu Oct 9 10:23:58 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Quentin Schulz X-Patchwork-Id: 1911 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id BE716CCD18C for ; Thu, 9 Oct 2025 10:24:16 +0000 (UTC) Received: from smtp-bc0c.mail.infomaniak.ch (smtp-bc0c.mail.infomaniak.ch [45.157.188.12]) by mx.groups.io with SMTP id smtpd.web10.8911.1760005453633104591 for ; Thu, 09 Oct 2025 03:24:14 -0700 Authentication-Results: mx.groups.io; dkim=none (message not signed); spf=pass (domain: 0leil.net, ip: 45.157.188.12, mailfrom: foss+yocto@0leil.net) Received: from smtp-3-0000.mail.infomaniak.ch (smtp-3-0000.mail.infomaniak.ch [10.4.36.107]) by smtp-3-3000.mail.infomaniak.ch (Postfix) with ESMTPS id 4cj5Zg5Ql7zf9n; Thu, 9 Oct 2025 12:24:11 +0200 (CEST) Received: from unknown by smtp-3-0000.mail.infomaniak.ch (Postfix) with ESMTPA id 4cj5Zg1SPlzsj0; Thu, 9 Oct 2025 12:24:11 +0200 (CEST) From: Quentin Schulz Subject: [PATCH v2 0/3] tools/build-docs-container: improve concurrent safety Date: Thu, 09 Oct 2025 12:23:58 +0200 Message-Id: <20251009-iid-file-v2-0-715d527457f0@cherry.de> MIME-Version: 1.0 X-B4-Tracking: v=1; b=H4sIAD6N52gC/23MQQrCMBCF4auUWTuSxKZNXXkP6aIkEzMgrUykW Erubuza5f94fDtkEqYM12YHoZUzL3MNc2rAp2l+EHKoDUYZq5UakDlg5CdhNH3Xu5ZUayzU+0s o8ueg7mPtxPm9yHbIq/6tf5BVo8Yw+MnZ7uKd8zefSGQ7B4KxlPIFsbIPZKAAAAA= X-Change-ID: 20251009-iid-file-f276784e0425 To: docs@lists.yoctoproject.org Cc: Quentin Schulz X-Mailer: b4 0.14.3 X-Infomaniak-Routing: alpha List-Id: X-Webhook-Received: from li982-79.members.linode.com [45.33.32.79] by aws-us-west-2-korg-lkml-1.web.codeaurora.org with HTTPS for ; Thu, 09 Oct 2025 10:24:16 -0000 X-Groupsio-URL: https://lists.yoctoproject.org/g/docs/message/7677 Currently, it is possible to run the script from two different trees and ending up running the wrong image due to the non-uniqueness of our tags. Indeed, one could simply run the script in parallel for the same distro. Script runtime A will build the image A and tag it X, Script runtime B will build the image B and tag it X, Script runtime B will run the tag X (image B), Script runtime A will run the tag X (image B). Note that this problem exists whether we are building from the same tree concurrently or from different yocto-docs trees concurrently. This fixes the issue by using the iid-file generated by podman build containing the sha of the just-built image as "image" argument to podman run, guaranteeing we are using the image we just built. This also now forces builds triggered by tools/build-docs-container to build in separate directories. This helps comparing the output between different runs as well as making sure we aren't reusing the build directory from another run by mistake. The downside is that it can clutter your local tree and make clean is not able to clean previous runs because it cannot know which build directory you picked in earlier runs. set_versions.py still modifies the tree so this probably means we aren't concurrent-safe from the same tree because of that. But we should now be safe running tools/build-docs-container from separate trees. Signed-off-by: Quentin Schulz --- Changes in v2: - made image_id_file a global variable so the trap can use the variable, - added patch to customize BUILDDIR, - added patch to set BUILDDIR uniquely per run of tools/build-docs-container, - Link to v1: https://lore.kernel.org/r/20251009-iid-file-v1-1-d9ca8563c88c@cherry.de --- Quentin Schulz (3): tools/build-docs-container: guarantee the image to run matches the just-built image Makefile: allow to specify build directory tools/build-docs-container: build in separate directory for each distro documentation/Makefile | 2 +- documentation/tools/build-docs-container | 18 ++++++++++++------ 2 files changed, 13 insertions(+), 7 deletions(-) --- base-commit: 09c7800333b17b21e50d2a089a3ae1b123697243 change-id: 20251009-iid-file-f276784e0425 Best regards,