From patchwork Fri Jan 30 07:52:31 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: AdrianF X-Patchwork-Id: 80079 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 58A98D49C72 for ; Fri, 30 Jan 2026 07:53:58 +0000 (UTC) Received: from mta-65-225.siemens.flowmailer.net (mta-65-225.siemens.flowmailer.net [185.136.65.225]) by mx.groups.io with SMTP id smtpd.msgproc01-g2.5979.1769759629649873188 for ; Thu, 29 Jan 2026 23:53:51 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=adrian.freihofer@siemens.com header.s=fm1 header.b=I8yP/ksu; spf=pass (domain: rts-flowmailer.siemens.com, ip: 185.136.65.225, mailfrom: fm-1329275-202601300753461598f3bbad0002072e-2yz9oy@rts-flowmailer.siemens.com) Received: by mta-65-225.siemens.flowmailer.net with ESMTPSA id 202601300753461598f3bbad0002072e for ; Fri, 30 Jan 2026 08:53:47 +0100 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; s=fm1; d=siemens.com; i=adrian.freihofer@siemens.com; h=Date:From:Subject:To:Message-ID:MIME-Version:Content-Type:Content-Transfer-Encoding:Cc:References:In-Reply-To; bh=bE3r7NnBjxkcEdZlhzGn2Lf/U8rJinkq6vqyijLx0SQ=; b=I8yP/ksuU0K08Wjq5koz9Y/U2mkmJGVx0cBh3z8HLD0SEBeNN5SPhoY9VFxz1Vrp3MZt36 JSyftUh/+EwwLDzo2K5UteU2nNeV17ygZvhj2SvpLemA3obF5CZJYsjh9t7pz3QQxR14FOy/ E09pyGREFWQjRByhgmECwOUe0+IlILT1pfcK8A8iWpEvbpy9qTb5FUCr/DkOJzPLYzgEEwS9 JYL8iGiIS2UX8nrFdxiq3dMYqf8Tg4cXAxnVDOXb3J3PQ+n6Kl2qkn+wGzEZum/hKOmFFqbJ h1jxUcejL1pwM86U/3xbrjl3KMwcA17xqT3/scF3FTWLJfHvcL9gIHOA==; From: AdrianF To: openembedded-core@lists.openembedded.org Cc: Adrian Freihofer Subject: [PATCH 1/2] build-sysroots: Serialize native and target sysroot population Date: Fri, 30 Jan 2026 08:52:31 +0100 Message-ID: <20260130075333.940897-2-adrian.freihofer@siemens.com> In-Reply-To: <20260130075333.940897-1-adrian.freihofer@siemens.com> References: <20260130075333.940897-1-adrian.freihofer@siemens.com> MIME-Version: 1.0 X-Flowmailer-Platform: Siemens Feedback-ID: 519:519-1329275:519-21489:flowmailer List-Id: X-Webhook-Received: from 45-33-107-173.ip.linodeusercontent.com [45.33.107.173] by aws-us-west-2-korg-lkml-1.web.codeaurora.org with HTTPS for ; Fri, 30 Jan 2026 07:53:58 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/230185 From: Adrian Freihofer Calling (what devtool ide-sdk --mode shared does internally): bitbake meta-ide-support:do_build cmake-example:do_populate_sysroot bitbake build-sysroots:do_build_target_sysroot \ build-sysroots:do_build_native_sysroot can fail with errors like: Exception: subprocess.CalledProcessError: Command '.../tmp/sysroots/qemux86-64/usr/bin/postinst-base-passwd' returned non-zero exit status 1. Subprocess output: .../tmp/sysroots/x86_64/usr/sbin/useradd Running groupadd commands... NOTE: cmake-example: Performing groupadd with [--root ../tmp/sysroots/qemux86-64 --system cmake-example] awk: error while loading shared libraries: libtinfo.so.5: cannot open shared object file: No such file or directory ERROR: cmake-example: groupadd command did not succeed. The root cause is a race condition between do_build_target_sysroot and do_build_native_sysroot. When run in parallel, do_build_target_sysroot executes postinstall scripts (e.g., useradd) that invoke awk, while do_build_native_sysroot is concurrently installing gawk-native into the shared native sysroot (which is in PATH for do_build_target_sysroot). Since sstate artifact installation is not atomic, awk binaries can be installed before their dependent libraries. If do_build_target_sysroot picks up the newly installed but incomplete awk, it fails with missing library errors. The situation is created by a mix of: - gawk-native in ASSUME_PROVIDED (use host awk) - glibc depending on gawk-replacement-native (builds gawk-native) - Both tasks populating the same shared native sysroot directory Fix this by adding a lockfile to both tasks, ensuring they cannot run concurrently and avoiding the race condition where partially installed native tools are accessed. While lockfiles are generally avoided in BitBake due to performance concerns, this is acceptable here since these tasks are not on a critical performance path. [YOCTO #16135] Signed-off-by: Adrian Freihofer --- meta/recipes-core/meta/build-sysroots.bb | 2 ++ 1 file changed, 2 insertions(+) diff --git a/meta/recipes-core/meta/build-sysroots.bb b/meta/recipes-core/meta/build-sysroots.bb index b0b8fb3c79..3ee9565862 100644 --- a/meta/recipes-core/meta/build-sysroots.bb +++ b/meta/recipes-core/meta/build-sysroots.bb @@ -36,6 +36,7 @@ python do_build_native_sysroot () { } do_build_native_sysroot[cleandirs] = "${STANDALONE_SYSROOT_NATIVE}" do_build_native_sysroot[nostamp] = "1" +do_build_native_sysroot[lockfiles] = "${WORKDIR}/build-sysroots.lock" addtask do_build_native_sysroot python do_build_target_sysroot () { @@ -47,6 +48,7 @@ python do_build_target_sysroot () { } do_build_target_sysroot[cleandirs] = "${STANDALONE_SYSROOT}" do_build_target_sysroot[nostamp] = "1" +do_build_target_sysroot[lockfiles] = "${WORKDIR}/build-sysroots.lock" addtask do_build_target_sysroot do_clean[cleandirs] += "${STANDALONE_SYSROOT} ${STANDALONE_SYSROOT_NATIVE}" From patchwork Fri Jan 30 07:52:32 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: AdrianF X-Patchwork-Id: 80078 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 46DCCD49C6F for ; Fri, 30 Jan 2026 07:53:58 +0000 (UTC) Received: from mta-64-225.siemens.flowmailer.net (mta-64-225.siemens.flowmailer.net [185.136.64.225]) by mx.groups.io with SMTP id smtpd.msgproc02-g2.5994.1769759629653883826 for ; Thu, 29 Jan 2026 23:53:51 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=adrian.freihofer@siemens.com header.s=fm1 header.b=NqUVPDsM; spf=pass (domain: rts-flowmailer.siemens.com, ip: 185.136.64.225, mailfrom: fm-1329275-20260130075347538c58cede000207a0-sl4bmj@rts-flowmailer.siemens.com) Received: by mta-64-225.siemens.flowmailer.net with ESMTPSA id 20260130075347538c58cede000207a0 for ; Fri, 30 Jan 2026 08:53:47 +0100 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; s=fm1; d=siemens.com; i=adrian.freihofer@siemens.com; h=Date:From:Subject:To:Message-ID:MIME-Version:Content-Type:Content-Transfer-Encoding:Cc:References:In-Reply-To; bh=I6W4BjMzVnEfe+o8VkMROFQkzc/oPOgyjMhRjXU5yPk=; b=NqUVPDsMuNSUrg+CRMlISi3Tz7VO6xz3hLc0CAJStCGOa+q9z69bieT8BSI19yaB0+fK9P VsD1v8TqsRJzY0tCkk9KcSmQhgP+J4twEWcHUOJVfjwlWuWDRWFMhkg3CBbOVObI+HmnXKEM zr8oksi/1VZs7ClMVWyHQHhePIlY7ig5ZASg5jVQR+SIcoaz9NymwBiJmvxgeyAhNo3sNoic YYWwZWnJfIz8+bYorGQ53m+unn2WhZZRnamce08ouZfXdNBvSXkNuPQHuykCe/BzVOv9Iy4u Z874ISfK1xMu5+i10Itg3H2azm3xEVvNvwRNxiBtpwRMlh+CiizuHrnw==; From: AdrianF To: openembedded-core@lists.openembedded.org Cc: Adrian Freihofer Subject: [PATCH 2/2] build-sysroots: Add sysroot tasks to default build and remove warning Date: Fri, 30 Jan 2026 08:52:32 +0100 Message-ID: <20260130075333.940897-3-adrian.freihofer@siemens.com> In-Reply-To: <20260130075333.940897-1-adrian.freihofer@siemens.com> References: <20260130075333.940897-1-adrian.freihofer@siemens.com> MIME-Version: 1.0 X-Flowmailer-Platform: Siemens Feedback-ID: 519:519-1329275:519-21489:flowmailer List-Id: X-Webhook-Received: from 45-33-107-173.ip.linodeusercontent.com [45.33.107.173] by aws-us-west-2-korg-lkml-1.web.codeaurora.org with HTTPS for ; Fri, 30 Jan 2026 07:53:58 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/230183 From: Adrian Freihofer Add both do_build_native_sysroot and do_build_target_sysroot to the do_build dependency chain, allowing "bitbake build-sysroots" to populate both sysroots automatically. This is now safe to do since the previous commit added lockfiles to serialize these tasks, preventing the race condition where they could interfere with each other when run concurrently. Remove the do_build_warn task which instructed users to call the tasks explicitly, as this is no longer necessary. The warning was not clear. For somebody who knwos about the race condition, it was obvious that they should call the tasks explicitly, but for all other users this was just confusing. Signed-off-by: Adrian Freihofer --- meta/recipes-core/meta/build-sysroots.bb | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/meta/recipes-core/meta/build-sysroots.bb b/meta/recipes-core/meta/build-sysroots.bb index 3ee9565862..c094b8ae53 100644 --- a/meta/recipes-core/meta/build-sysroots.bb +++ b/meta/recipes-core/meta/build-sysroots.bb @@ -19,14 +19,6 @@ deltask install deltask populate_sysroot deltask recipe_qa -do_build_warn () { - bbwarn "Native or target sysroot population needs to be explicitly selected; please use -bitbake -c build_native_sysroot build-sysroots -bitbake -c build_target_sysroot build-sysroots -or both." -} -addtask do_build_warn before do_build - python do_build_native_sysroot () { targetsysroot = d.getVar("STANDALONE_SYSROOT") nativesysroot = d.getVar("STANDALONE_SYSROOT_NATIVE") @@ -37,7 +29,7 @@ python do_build_native_sysroot () { do_build_native_sysroot[cleandirs] = "${STANDALONE_SYSROOT_NATIVE}" do_build_native_sysroot[nostamp] = "1" do_build_native_sysroot[lockfiles] = "${WORKDIR}/build-sysroots.lock" -addtask do_build_native_sysroot +addtask do_build_native_sysroot before do_build python do_build_target_sysroot () { targetsysroot = d.getVar("STANDALONE_SYSROOT") @@ -49,6 +41,6 @@ python do_build_target_sysroot () { do_build_target_sysroot[cleandirs] = "${STANDALONE_SYSROOT}" do_build_target_sysroot[nostamp] = "1" do_build_target_sysroot[lockfiles] = "${WORKDIR}/build-sysroots.lock" -addtask do_build_target_sysroot +addtask do_build_target_sysroot before do_build do_clean[cleandirs] += "${STANDALONE_SYSROOT} ${STANDALONE_SYSROOT_NATIVE}"